Full Text 01
Full Text 01
Full Text 01
Abdlkarim Alsaleh
A THESIS SUBMITTED TO THE DEPARTMENT OF ENGINEERING SCIENCE
AT UNIVERSITY WEST
2021
ii
Summary
This thesis work investigates the possibilities and limitations of using digital twin technology
to create virtual automation lines which can be used in education and research to conduct
automation labs virtually. The PTC automation line at University West has been used as a
case study in this thesis. The digital twin created in this work consists of three key parts: a
virtual model of the automation line created in Visual Components Premium 4.2, system
control (PLC-control program) created in TwinCat 3, and a Beckhoff ADS communication
protocol that connects the virtual model with the PLC program.
Using a virtual model of industrial-like lab equipment in place of a real system can bring
several benefits. It can increase visibility and safety in the system. It can also increase the
accessibility of the system. Conducting virtual labs and experiments can also help in reducing
the total cost of the system. The virtual twin of the automation line built in this work can be
used to help the users to conduct automation labs and experiments virtually and to test their
PLC programs offline.
iii
Preface
This thesis work was carried out in the spring of 2021 as a part of my study in the master
program in automation and robotics (distance, 2 years) at University West in Trollhättan,
Sweden. First of all, I would like to thank my supervisor David Simonsson and my examiner
Kristina Eriksson for providing me with all the needed help and support during the project.
I would also like to thank Gabriel Sebastian from the division of production systems at Uni-
versity West for all his help during this work.
iv
Affirmation
This master degree report, Applying digital twin technology in education and research, was written as
part of the master degree work needed to obtain a Master of Science with specialization in
Robotics degree at University West. All material in this report, that is not my own, is clearly
identified and used in an appropriate and correct way. The main part of the work included
in this degree project has not previously been published or used for obtaining another degree.
June 8, 2021
__________________________________________ __________
Signature by the author Date
Abdlkarim Alsaleh
v
Contents
Preface
SUMMARY ............................................................................................................................................III
PREFACE .............................................................................................................................................. IV
AFFIRMATION ....................................................................................................................................... V
CONTENTS ........................................................................................................................................... VI
SYMBOLS AND GLOSSARY .....................................................................................................................IX
Main Chapters
1 INTRODUCTION ............................................................................................................................ 1
1.1 BACKGROUND .................................................................................................................................... 1
1.2 PROBLEM FORMULATION ...................................................................................................................... 1
1.3 AIM AND RESEARCH QUESTION .............................................................................................................. 2
1.4 DELIMITATION .................................................................................................................................... 2
1.5 OUTLINE............................................................................................................................................ 2
2 RELATED WORK ............................................................................................................................ 3
2.1 DIGITAL TWIN ..................................................................................................................................... 3
2.1.1 Digital twin concept .............................................................................................................. 3
2.1.2 Digital twin and cyber-physical system ................................................................................ 3
2.1.3 DT dimensions....................................................................................................................... 4
2.2 DIGITAL TWIN ENABLING TECHNOLOGIES .................................................................................................. 4
2.2.1 Physical-world enabling technologies................................................................................... 4
2.2.2 Virtual model enabling technologies .................................................................................... 4
2.2.3 Data management enabling technologies............................................................................ 5
2.2.4 Services enabling technologies ............................................................................................. 6
2.2.5 Connections enabling technologies ...................................................................................... 6
2.3 DT LEVELS OF INTEGRATION .................................................................................................................. 6
2.3.1 Digital model ........................................................................................................................ 6
2.3.2 Digital shadow ...................................................................................................................... 6
2.3.3 Digital twin ........................................................................................................................... 6
2.4 MODELLING ....................................................................................................................................... 7
2.5 SIMULATION ...................................................................................................................................... 7
2.5.1 Simulation vs emulation ....................................................................................................... 7
2.6 INDUSTRIAL AUTOMATION .................................................................................................................... 8
2.6.1 Controller .............................................................................................................................. 9
2.6.2 Industrial communication ................................................................................................... 10
2.7 COMMISSIONING .............................................................................................................................. 10
2.7.1 Virtual commissioning (VC) ................................................................................................. 11
2.7.2 Virtual commissioning stages ............................................................................................. 11
2.7.3 Virtual commissioning workflow ........................................................................................ 12
3 METHOD ..................................................................................................................................... 13
vi
3.1 DATA COLLECTING ............................................................................................................................. 13
3.2 DATA PROCESSING............................................................................................................................. 13
3.2.1 Physical device modelling ................................................................................................... 14
3.2.2 Logical device modelling ..................................................................................................... 14
3.2.3 System control modelling ................................................................................................... 14
3.2.4 Communication................................................................................................................... 15
3.3 RESULT EVALUATION ......................................................................................................................... 15
4 DESIGN & IMPLEMENTATION ..................................................................................................... 16
4.1 AUTOMATION LINE SPECIFICATION ........................................................................................................ 16
4.2 AUTOMATION LINE WORKFLOW ........................................................................................................... 17
4.3 MODELLING ..................................................................................................................................... 18
4.3.1 Physical model building ...................................................................................................... 18
4.3.2 Logical model building ........................................................................................................ 19
4.3.3 System control building ...................................................................................................... 23
5 RESULTS AND DISCUSSION ......................................................................................................... 29
5.1 RESULT ANALYSIS .............................................................................................................................. 29
5.2 DISCUSSION ..................................................................................................................................... 30
6 CONCLUSION .............................................................................................................................. 31
6.1 FUTURE WORK AND RESEARCH ............................................................................................................ 31
6.2 CRITICAL DISCUSSION......................................................................................................................... 31
6.3 GENERALIZATION OF THE RESULT .......................................................................................................... 32
7 REFERENCES................................................................................................................................ 33
List of Figures
Figure 1: DT three-dimensional model. Adopted from [4]. .......................................................................... 4
Figure 2: DT five-dimensional model. Adopted from [4]. ............................................................................. 5
Figure 3: Classifying of DT enabling technologies. Adopted from [13]. ....................................................... 5
Figure 4: Different levels of the digital twin. Adopted from [6] and [8]. ...................................................... 6
Figure 5: Automation levels. Adopted from [27] and [29]. .......................................................................... 8
Figure 6: Productivity-flexibility relation in different automation systems. Inspired by [26] ...................... 9
Figure 7: PLC internal structure. Adopted from [34]. ................................................................................. 10
Figure 8: Virtual commissioning development stages. Adopted from [45]. ............................................... 11
Figure 9: Model configurations applied in commissioning. Adopted from [47]. ........................................ 12
Figure 10: Virtual commissioning workflow. Adopted from [48]. .............................................................. 12
Figure 11: Data processing layout. Adopted from [48]. ............................................................................. 14
Figure 12: Automation line layout .............................................................................................................. 16
Figure 13: Layout of Automation line communication. Adopted from line specifications......................... 17
Figure 14: State diagram of an assembly station. ...................................................................................... 18
Figure 15: An assembly station................................................................................................................... 19
Figure 16: Modelling behaviours in Visual Components. ........................................................................... 20
Figure 17: Part of the global Python script “helper.py”. ........................................................................... 20
Figure 18: Behaviours and features of the AGV. ........................................................................................ 21
Figure 19: AGV Python scripts. ................................................................................................................... 22
Figure 20: Behaviours added to all robots.................................................................................................. 22
Figure 21: Structure of the PLC program. ................................................................................................... 23
Figure 22: Global variable list. ................................................................. Fel! Bokmärket är inte definierat.
Figure 23: Code inside the function “FindCode”. .................................... Fel! Bokmärket är inte definierat.
Figure 24: Flowchart of the control programs. ....................................... Fel! Bokmärket är inte definierat.
Figure 25: HMI used to test the robot-level function blocks. .................. Fel! Bokmärket är inte definierat.
vii
Figure 26: Connected variables between Visual Components and TwinCat.Fel! Bokmärket är inte
definierat.
Figure 27: Part of the sub-program used to test the function blocks. .... Fel! Bokmärket är inte definierat.
Appendices
APPENDIX A: ROBOT-LEVEL FUNCTION BLOCKS
APPENDIX B: MAIN CONTROL PROGRAMS
APPENDIX C: SIMULATION VIDEO LINK
viii
Symbols and glossary
ix
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Introduction
1 Introduction
This chapter introduces the master’s thesis by giving a brief background of the thesis
topic, the definition of the research problem, the aim and the research qustion, and the
study delimitation and outline.
1.1 Background
Laboratory work is an essential component in research, education, and engineering
training. The majority of the universities and academic centres are equipped with mod-
ern laboratories. However, access to these laboratories might be restricted due to vari-
ous factors. In distance learning and research, for example, the physical labs equipment
is not always accessible for students and researchers. Another example of the restriction
factors is the restriction caused by the current Covid-19 pandemic over the last two
years.
To address this problem, the universities and academic centres need to adopt new
approaches in learning and research processes. One of the suggested approaches is to
build a virtual representation (a digital twin) of the laboratory equipment. This allows
the students and researchers to perform experiments virtually using simulation soft-
ware.
Most of the studies and research carried out on digital twins focus on their indus-
trial, commercial, and civil applications. However, there is a shortage of research that
addresses the applications of digital twin technology in research and education. This
project aims to contribute to filling the knowledge gap in this field.
The base of this project is the digital twin technology (DT). The digital twin is an
emerging technology, and it is considered a part of Cyber-Physical Systems (CPS). In
addition to DT and CPS, this work contributes to other research areas such as automa-
tion, virtual commissioning, smart manufacturing, and industry 4.0.
1
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Introduction
1.4 Delimitation
The focus of this study will be on the virtual commissioning of the new automation line
in university West PTC. The experiment used to compare the physical lab performance
to the virtual lab performance will be limited to one robotic cell of the automation line.
This experiment will be done by Behzad Far as part of his master’s thesis work [1]. The
practical part of this study will be designed and implemented using Visual Components
premium 4.2, AutoCAD 2021 and TwinCat 3. The physical behaviours of the modelled
components, such as gravity and inertia, will not be considered in this study.
1.5 Outline
The content of this work is structured in six main chapters. The first chapter provides
an overview of the thesis topic and addresses the thesis problem, objective, and limita-
tion. The second chapter is a literature review that surveys books and scholarly articles
to provide the required theoretical background information on the thesis topic. In the
third chapter, the methods and the work procedure used in this thesis work are pre-
sented. The design and implementation of the practical part of the research are pre-
sented in the fourth chapter. In the fifth chapter, the outcome of this study is presented
and evaluated. The recommendations, improvement and suggested future work are dis-
cussed in the sixth chapter.
2
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Related work
2 Related work
In this section, the theoretical background of the key concepts in this thesis is presented.
The aim is to build the required knowledge by studying and interpreting relevant and
most recent literature.
3
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Related work
The main focus in CPS is on communication, computing, and control [4], [9]. How-
ever, DT technology focuses more on virtual modelling. Sensors and actuators are the
key components in CPS while data and models are the main components of DT [9].
2.1.3 DT dimensions
Tao et al. [10] found that there are two models of DT in research: the three-dimensional
model and the five-dimensional model. In the three-dimensional model, DT has three
core components: physical space, virtual space, and connection. This model is illus-
trated in Figure 1.
In addition to the core components of the three-dimensional model, the five-di-
mensional model has two extra components: data and service [11], [12], [13]. The struc-
ture of the five-dimensional model is shown in Figure 2.
The virtual model represents the mapping of the physical system properties, behav-
iours, and rules in the virtual world. The services in DT are used to encapsulate the
complicated functions of DT into simple and user-friendly modules [4], [12]. Data in
this model is considered the main driver of the digital twin model. Data in a five-di-
mensional model can be obtained from physical systems. Data can also be collected
from virtual models and services. Connections are used to allow data exchange between
DT different core components [4], [13].
4
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Related work
5
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Related work
Figure 4: Different levels of the digital twin. Adopted from [6] and [8].
6
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Related work
2.4 Modelling
White and Ingalls defined a model in [14] as “an entity that is used to represent some other
entity for some defined purpose”. A model, in general, is an abstraction of a real complex
system and it is used mainly to study the behaviour of the real system when the system
under control cannot be observed directly due to the high cost of experimenting with
the real system or because of unsafety issues [14], [15]. There are three basic types of
models: physical models, mathematical models, and computer models.
Loper referred to physical models in [15] as iconic models. Physical models can be
static or dynamic. A static physical model is a scale model of the real system being
modelled. Static physical systems do not change with respect to time while dynamic
physical models do change with time [16]. A typical example of a static physical model
is the scaled-down model of a building under construction. The wind tunnel is a typical
example of a dynamic physical model.
Dym in [17] defined the mathematical model as “a representation in mathematical terms
of the behaviour of real devices and objects”. Mathematical models are usually represented using
a set of mathematical equations involving a set of variables and they are classified into
two basic categories: continuous models and discrete models. In continuous models,
the variables “vary continuously in space and time, while the variables in discrete models vary discon-
tinuously” [18].
Depending on how they change over time, the mathematical models can also be
divided into static mathematical models and dynamic mathematical models. When
mathematical models are implemented and manipulated using computers, they called
computer model [16].
2.5 Simulation
Simulation and modelling are very closely connected concepts. According to Singh in
[16], mathematical modelling can be considered as a simulation, and mathematical sim-
ulation can be considered as modelling.
Simulation is a practical process that aims to conduct experiments on a model of a
real system to study the behaviour of the system of interest [14]. Simulation, according
to White and Ingalls, is a practical method used to study a real system by developing a
model of the system and performing experiments on this model to understand the be-
haviour of the system under control [14].
Based on the nature of the system variables, Sokolowski and Banks in [19] classified
simulation models into three categories: discrete event simulation, continuous simula-
tion, and Monte Carlo simulation. In continuous simulations, the system variables are
continuous functions of time while in discrete event simulations, the variables are dis-
crete functions of time. Monte Carlo simulation uses probabilities to model the system
behaviour. The outcomes of the model are predicted based on randomly generated
samples of input variables.
7
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Related work
McGregor defined an emulation model as a model “where some functional part of the
model is carried out by a part of the real system” [21]. Emulation is employed basically in the
development and validation phases of the system life cycle [22].
The key difference between emulation and simulation models is the purpose of the
modelling. With simulation models, the primary aim is to analyse the system behaviour
and performance by trying and testing different scenarios and parameters [21] [23].
Emulation models aim to test the system logical control with various operating condi-
tions. Emulation models can be used as a risk-free training tool. Another important
difference is that emulation models should be run almost in real-time while simulation
models can run faster than the real-time of the modelled system [21].
8
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Related work
in fixed automation. With programmable automation, the system can be used to pro-
duce new products by re-programming it and without changing the current equipment.
The cost of changing the product in programmable automation is considerably low
compared to fixed automation systems. With flexible industrial automation, it is possi-
ble to use the same programming and equipment to produce a variety of products. The
relation between productivity and flexibility for the previous automation systems is
shown in Figure 6.
2.6.1 Controller
Controllers are considered to be the key parts of the industrial automation system as
they carry out the computing and the management of I/O signals in the system [31].
There are essentially four basic types of industrial controller: mechanical, pneumatic,
hydraulic, and electronic controllers. Electronic controllers can take two forms: a dis-
tributed control system (DCSs) and programmable logic controllers (PLCs) [24]. DCSs
are mainly used in process control and it is beyond the scope of this study.
PLC programming
The majority of key PLC manufactures follow international standard IEC 61131‐3
which is considered as a guideline for programming modern PLC systems. IEC 61131‐
3 defines five PLC programming languages. Three of these programming languages are
graphical and two are text-based. The graphical programming languages are Function
Block Diagram (FBD), Ladder Diagram (LD), and Sequential Function Chart (SFC),
while the text-based programming languages are: Structured Text (ST) and Instruction
List (IL) [34].
9
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Related work
2.7 Commissioning
American Society of Heating, Refrigerating and Air-Conditioning Engineers
(ASHRAE) has defined the commissioning process as “a quality-oriented process for achiev-
ing, verifying, and documenting that the performance of facilities, systems, and assemblies meets defined
objectives and criteria” [39].
10
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Related work
Commissioning is the last phase in the life cycle of a system building or upgrading
and it works as a bridge between the design and the operation of the system. Commis-
sioning is performed usually by a dedicated commission team in cooperation with the
operators and other technical staff [40].
Commissioning has typically three phases: pre-commissioning, core commissioning
and Start-up [41]. The pre-commissioning is the whole activities performed during the
system building phase to prepare the system for the core commissioning phase. The
core commissioning phase is to put the system equipment and sub-systems into their
“initial operation”. In the start-up phase of commissioning, the system is put into its actual
planned operation.
11
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Related work
12
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Method
3 Method
The method section describes the procedures and techniques used to solve the study
problem. This includes identifying the problem as well as collecting and processing the
data. This includes also analysing the result of the study [50].
13
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Method
14
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Method
3.2.4 Communication
The key parts of the digital twin of the automation line reside in different software
programs. A communication protocol is, therefore, required to allow these parts to
communicate and exchange data. There are two options of communication protocol
available to connect Visual Components models and TwinCat projects. These options
are Beckhoff ADS and OPC UA. In this work, however, the Beckhoff ADS protocol
will be used due to its simplicity in both implementation and configuration.
15
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Design & Implementation
This work aims to investigate the possibilities and limitations of building a digital twin
of automation lab equipment and using the digital twin to conduct automation labs and
experiments virtually. The new PTC automaton line at University West was used as a
case study in this work. More specifically, the automation line project in the course
Automation System (ATM700) was used for modelling and testing the digital twin. In
the course project, the automation line is designed to produce three similar types of
products. Three colour codes (red, blue, and green) are used to distinguish between
these products. Each product is assembled of three key parts of the same colour. The
parts are a plate, a cylinder, and a screw. Special pallets (assembly containers) are used
in production as fixtures during the assembly process. Other pallets (storage containers)
are used to store the assembly parts in the buffers of the assembly stations.
16
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Design & Implementation
Figure 13: Layout of Automation line communication. Adopted from line specifica-
tions.
− I/O station works as the communication medium for all other stations in the
line including the AGV. A station in the line can therefore communicate directly
only with the I/O station.
− All the product parts are made of metal, and they can trigger the conductive
sensors used in the robot tools to detect and identify the assembled parts in the
assembly containers.
− I/O station performs the line main control logic, and it assigns tasks to all sta-
tions in the line.
− The empty assembly containers are supplied to the assembly stations by the I/O
station.
− All storage buffers in the assembly stations are initially loaded by the staff with
random pallets of parts.
− The pallets of parts have a predefined quantity of items.
17
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Design & Implementation
4.3 Modelling
Modelling in this work comprised physical and logical models building as well as the
development of the system control. Through the model building, the following assump-
tions were made:
− The line is designed to produce three products in each production cycle.
− The products are assembled in a sequence which means that there is only one
assembly station working at any time of the production cycle.
18
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Design & Implementation
required some modifications to their default properties before using them. Figure 15
shows the key geometries in an assembly station.
Some of the required automation line components were not provided in the stand-
ard library of Visual Components but rather provided as pre-made 3D cad models. This
was especially true for the containers and the assembly parts (plates, cylinders, octa-
gons). These models were imported to the Visual component and even added to the
library.
The components that were neither found in the Visual Components standard library
nor created in other software were created from scratch. The components with simple
geometries were built directly in Visual Components Premium using its modelling fea-
tures. For example, the fixtures on the working table shown in Figure 15 were built
using this approach. The components with more complicated geometries required spe-
cial CAD software to build them. One instance of these components is the docking
station of the AGV (Figure 15) which was created in AutoCAD 2021.
Validation in this phase was done by drawing a comparison between the modelled
layout and the physical layout of the automation line. This involved checking that the
geometric and kinematic attributes of the modelled components were set according to
the specifications.
19
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Design & Implementation
20
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Design & Implementation
Signal behaviours, on the other hand, were used to give the components and their
behaviours the ability to interact with each other. The sensors were especially useful for
detecting and identifying certain components in the automation line. The frames were
added mostly to define the positions of the robots in the virtual environment.
It was not required to model all automation line components logically. This kind of
modelling was only required for the parts that involve directly in the production pro-
cesses. This includes the AGV, the robots, the sensors, and the dock stations.
AGVs in the standard library of VC are initially passive. They require additional
behaviours and features to be able to interact with their environment. Figure 18 shows
the behaviours and features added to the AGV, and Figure 19 shows a part of the
Python script used to control the AGV. The vehicle behaviour was used to define the
AGV as a moving component that can be controlled by a Python Script. The NextSta-
tion signal is an integer sent by the PLC program to indicate the ID of the station the
AGV is moving toward. MoveAGV is a function used to moves the AGV between two
positions using a set of pre-defined paths between fixed points on the automation line
floor. The surface of the AGV is equipped with a sensor that is triggered when the
AGV is loaded with an assembly container. This sensor was modelled using a ray cast
sensor which is a behaviour in Visual Components used mainly to measure distances
and detect components in Visual Components 3D models. Three signals may be used
in combination with a raycast sensor behaviour. These signals are a range signal, a com-
ponents signal and a Boolean signal. The Boolean signal is triggered when there is a
component within the detection threshold of the sensor. The component signal used
to identify what component detected by the sensor and the range signal is used to store
the distance between the sensor and the detected component.
The main difference between the I/O robot and the other robots in the line is that
there are no assembly processes performed in the I/O station. Despite this difference,
these robots have almost the same added behaviours and features. The key behaviour
required for all robots is the inductive sensor. The inductive sensor is attached to the
21
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Design & Implementation
22
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Design & Implementation
sensors were used along with the appropriated signals to detect the type of the scanned
container.
23
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Design & Implementation
− Connecting the PLC program variables with the Visual Components signals.
− Testing and validating the program.
Global variables
The global variables are required to exchange data between the PLC program and the
virtual model. They can also be used to change data between different POUs of the
program. In this work, the global variables were organised into global variable lists
(GVL). Figure 22 shows the global variables defined in every assembly station.
24
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Design & Implementation
Figure 23
the other is used by the first assembly station (STN100) to check for the assembled
parts in the currently received assembly container.
At the robot level, the function blocks are required to control the operations of the
robots. These operations include, for example, moving the arms of the robots to pre-
defined positions in the cell, picking and placing parts and containers, and assembling
parts. The function blocks which control the robots in the virtual environment have
the same structure as the function blocks used to control the robots in the real system.
This can help to smoothly transfer the PLC program between the two environments.
A full list of the robot-level function blocks can be found in Appendix A.
25
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Design & Implementation
26
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Design & Implementation
Connectivity
Beckhoff ADS (Automation Device Specification) interface was used in this work to
connect the PLC program to the virtual model. The key rationale behind choosing
Beckhoff ADS was its simplicity in comparison to the OPC UA interface.
The connection between the 3D model and the PLC program was established by
pairing the global variables in TwinCat with their related signals in Visual Components
using the connectivity feature in VC. Two sets of variables are used in this connection,
simulation-to-server variables, and server-to-simulation variables. AS the names sug-
gest, the simulation-to-server variables refer to the Visual Components signals con-
nected to their related input variables in the PLC program, while the server-to-simula-
tion variables refer to the PLC program variables connect to their related input signals
in Visual Components. Establishing a connection between Visual Components and
TwinCat required the following steps: adding the server, editing, and testing the con-
nection, and pairing the variables. In the first step, a Beckhoff ADS server was added
using the Visual Components connectivity configuration panel. The next step was to
set the ADS port and test the connection providing that the default port used by Twin-
Cat 3 is 851. The last step was to add the required simulation and server variables to
the server and to pair them with their related variable in the PLC program. Figure 26
shows a part of the connected variables between the Visual Components layout and the
TwinCat PLC program.
Validation
The last step in system control modelling was to test and validate the model. This was
done in two levels, POUs level and project level. At the first level, all the PLC project
POUs, such as the functions and the function blocks, were tested individually with the
27
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Design & Implementation
help of the Visual Components model. This was especially true for the robot-action
function blocks where a test program and a test HMI (Figure 25) were used to test
them. A part of the test program is shown in Figure 27.
At the project level, the whole PLC project was tested. The I/O station (STN500),
the AGV and three assembly stations (STN100-STN300) in the virtual model were used
to perform the required test experiments. During the test process, different scenarios
of buffers contents were tried, and the behaviour and the performance of the connected
virtual model were observed and evaluated.
Figure 27: Part of the sub-program used to test the function blocks.
28
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Results and discussion
In this chapter, the results of building the virtual model are presented, analysed, and
discussed.
29
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Results and discussion
signals sent from the PLC program to the Visual Components program will not be
received at the time when they are needed. This problem could be solved by increasing
the delay time between functions calls in the Python scripts in Visual Components, but
this solution increased the total time required to perform one production cycle.
Behzad Far in [1] has used the virtual models built in this project in an experiment
as a part of his master thesis work. The experiment involved creating a PLC program
to produce one product using one assembly station. According to Behzad Far, the as-
sembly process was tested in both manual mode and auto mode and the virtual mode
functioned perfectly in both modes.
5.2 Discussion
The model in this work was built using three main applications, namely, Visual Com-
ponents 4.2, TwinCat 3 and AutoCAD 2021. Building a well-functioning model re-
quires therefore good knowledge of these applications. Although there are a lot of suit-
able resources to learn AutoCAD, that is not the case when it comes to learning Visual
Components and TwinCat. The Courses and lessons offered by Visual Components
Academy are useful resources to learn the basic of modelling in Visual Components,
but they are probably not sufficient to acquire in-depth knowledge of the application.
It is also very hard to navigate through and find information in the TwinCat help system
which is the main source of information about the application and its programming
languages.
Writing, testing, debugging and troubleshooting the code that controls the virtual
model was extremely hard in this project. First of all, it was not easy to choose the
proper languages that suit the different tasks in TwinCat. It was also very hard to debug
the code in TwinCat especially for the code written in the ST language. The logic used
in this work to control the virtual model is split into two parts, the PLC program code
created in TwinCat and the Python scripts code created in Visual components. These
two parts are connected using a communication protocol. This structure makes it even
harder to debug and troubleshoot the code. It was also very tricky to use some function
blocks inside sub-programs written in ST language. This was especially true for the
timers and for the function blocks that contain timers.
30
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Conclusion
6 Conclusion
At the end of this work, it has been proved that it is possible to use the digital twin
technology to build virtual representations of the industrial-like lab equipment used in
education and research. The virtual models can be used to conduct certain labs virtually.
This answers the first parts of the research question of this work. The second part of
the RQ, related to the limitations of using these virtual twins, is answered in the follow-
ing sections.
31
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - Conclusion
the model. An effective solution for this problem will be utilizing an algorithm to ran-
domly fill the buffers with the pallets and parts.
In the real automation line, every station has its controller and thus its PLC program.
However, the system control implemented in this work uses only one PLC program to
control all the stations in the automaton line. This configuration was very helpful in
simplifying the implementation of the system control and its connection with the virtual
model. This can, however, be seen as a drawback because, with the current configura-
tion, it is hard to isolate or take control over individual stations in the line and also to
assign tasks to the virtual model users.
32
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - References
7 References
[1] S. Behzad Far, Digital Twin of Automation Line- Seamless Transfer, Trollhättan:
University West, 2021.
[2] R. Parmar, A. Leiponen and L. D. Tomas, “Building an organizational digital
twin,” Business Horizons, vol. 63, no. 6, pp. 725-736, 2020.
[3] K. Agalianos, S. T. Ponis, E. Aretoulaki, G. Plakas and O. Efthymiou, “Discrete
Event Simulation and Digital Twins: Review and Challenges for Logistics,”
Procedia Manufacturing, vol. 51, p. 1636–1641, 2020.
[4] F. Tao, M. Zhang and A. Nee, Digital Twin Driven Smart Manufacturing,
London: Academic Press, 2019.
[5] A. Rasheed, O. San and T. Kvamsdal, “Digital Twin: Values, Challenges and
Enablers From a Modeling Perspective,” IEEE Access, 2020.
[6] W. Kritzinger, M. Karner, G. Traar, J. Henjes and W. Sihn, “Digital Twin in
manufacturing: A categorical literature review and classification,” IFAC
(International Federation of Automatic Control), 2019.
[7] Y. Lu, C. Liu, K. I.-K. Wang, H. Huang and X. Xu, “Digital twin-driven smart
manufacturing: Connotation, reference model, applications and research issues,”
Robotics and Computer-Integrated Manufacturing, vol. 61, 2019.
[8] A. Fuller, Z. Fan, C. Day and C. Barlow, “Digital Twin: Enabling Technologies,,”
IEEE Access, 23 June 2020.
[9] F. Tao, Q. Qi, L. Wang and A. Nee, “Digital Twins and Cyber–Physical Systems
toward Smart Manufacturing and Industry 4.0:,” Engineering, vol. 5, p. 653–661,
2019.
[10] F. Tao, H. Zhang, A. Liu and A. Y. C. Nee, “Digital Twin in Industry: State-of-
the-Art,” IEEE, vol. 15, no. 4, 2019.
[11] C. Wu, Y. Zhou, M. V. P. Pessôa, Q. Peng and R. Tan, “Conceptual digital twin
modeling based on an integrated five-dimensional framework and TRIZ function
model,” Journal of Manufacturing Systems, 2020.
[12] L. Sun, A. Pei, X. Qi, S. Cao, R. Yang and X. Liu, “Dynamic Analysis of Digital
Twin System Based on Five-Dimensional Model,” Journal of Physics: Conference Series,
2020.
[13] Q. Qi, F. Tao, T. Hu, N. Anwer, A. Liu, Y. Wei, L. Wang and A. Y. C. Nee,
“Enabling technologies and tools for digital twin,” Journal of Manufacturing Systems,
2019.
[14] K. P. White and R. G. Ingalls, “Introduction to simulation,” in 2015 Winter
Simulation Conference (WSC), Huntington Beach, CA, 2015.
[15] M. L. Loper, Modeling and simulation in the systems engineering life cycle,
London: Springer, 2015.
[16] V. P. Singh, System modeling and simulation, New Delhi: New Age International
(P) Ltd, 2009.
33
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - References
[17] C. L. Dym, Principles of mathematical modeling, 2nd ed. ed., Amsterdam; Boston:
Elsevier Academic Press, 2004.
[18] A. C. Fowler, Mathematical models in the applied sciences, Cambridge:
Cambridge University Press, 1997.
[19] J. A. Sokolowski and C. M. Banks, Handbook of Real-World Applications in
Modeling and Simulation, Hoboken N.J.: Wiley, 2012.
[20] J. Norrman and J. Persson, Virtual Production Line - Virtual Commissioning, Lund:
Lund University, 2018.
[21] I. McGregor, “The relationship between simulation and emulation,” in The
relationship between simulation and emulation, San Diego, CA, USA, 2002.
[22] M. Ayani, M. Ganebäck and A. H. Ng, “Digital Twin: Applying emulation for
machine reconditioning,” Procedia CIRP, vol. 72, p. 243–248, 2018.
[23] B. Brooks, A. Davidson and I. McGregor, “THE EVOLVING
RELATIONSHIP BETWEEN SIMULATION AND EMULATION: FASTER
THAN REAL-TIME CONTROLS TESTING,” in Proceedings of the 2014 Winter
Simulation Conference, 2014.
[24] B. R. Mehta and Y. J. Reddy, Industrial process automation systems, Oxford, UK:
Elsevier Inc., 2015.
[25] J. Machado and E. Seabra, HiL simulation workbench for testing and validating PLC
programs, IEEE, 2013.
[26] W. M. Hawkins, Automating manufacturing operations, New York: Momentum;
London, 2013.
[27] L. Durkop, L. Wisniewski, S. Heymann, B. Lucke and J. Jasperneite, “Analyzing
the engineering effort for the commissioning of industrial automation systems,”
2015 IEEE 20th Conference on Emerging Technologies & Factory Automation (ETFA),
pp. 1-4, 2015.
[28] M. Foehr, J. Vollmar, A. Calà, P. Leitão, S. Karnouskos and A. W. Colombo,
“Engineering of Next Generation Cyber-Physical Automation System
Architectures,” Multi-Disciplinary Engineering for Cyber-Physical Production, 2017.
[29] T. Coito, J. L. Viegas, M. S. Martins, M. M. Cunha, J. Figueiredo, S. M. Vieira och
J. M. Sousa, ”A Novel Framework for Intelligent Automation,” IFAC-
PapersOnLine, vol. 52, nr 13, p. 1825–1830, 2019.
[30] M. P. Groover, Automation, production systems, and computer-integrated
manufacturing, Fourth edition, Global edition ed., Pearson Education Limited,
20116.
[31] F. Lamb, Industrial Automation Hands-on, New York: McGraw-Hill Publishing,
2013.
[32] W. Bolton, Mechatronics - A multidisciplinary approach, 5th ed. ed., Harlow:
Pearson, 2011.
[33] W. Bolton, Programmable logic controllers, 5th ed. ed., Amsterdam; Boston:
Newnes, 2009.
[34] D. H. Hanssen, Programmable logic controllers - A practical approach to IEC
61131-3 using CODESYS, Chichester West Sussex United Kingdom: Wiley, 2015.
34
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - References
[35] S. Vitturi, C. Zunino and T. Sauter, “Industrial Communication Systems and Their
Future Challenges: Next-Generation Ethernet, IIoT, and 5G,” in 2013 11th IEEE
International Conference on Industrial Informatics (INDIN), Bochum, Germany, 2013.
[36] T. Imanto and A. Adriansyah, “Performance Analysis of Profinet Network in
PLC-Based Automation System,” in 2020 2nd International Conference on Broadband
Communications, Wireless Sensors and Powering (BCWSP), Yogyakarta, Indonesia, 2020.
[37] S. MacKay, Practical industrial data networks: Design, installation and
troubleshooting, Oxford; Burlington, MA: Newnes, 2004.
[38] M. Bennulf, F. Danielsson and B. Svensson, “Identification of resources and parts
in a Plug and Produce system using OPC UA,” Procedia Manufacturing, vol. 38, p.
858–865, 2019.
[39] The Commissioning Process; ASHRAE Guideline; 0-2005, American Society of
Heating, Refrigerating and Air-Conditioning Engineers, Inc., 2005.
[40] M. G. Tribe and R. R. Johnson, “Effective Capital Project Commissioning,” in
2008 54th IEEE Pulp and Paper Industry Technical Conference - PPIC, Seattle, WA,
USA, 2008.
[41] A. Almasi, “Pre-commissioning, commissioning and start-up of industrial plants
and machineries,” Australian Journal of Mechanical Engineering, vol. 12, no. 2, p. 257–
263, 2014.
[42] P. Hoffmann, R. Schumann, T. M. Maksoud and G. C. Premier, “Virtual
commissioning of manufacturing systems: A review and new approaches for
simplification,” in European Conference on Modelling and Simulation; ECMS, Kuala
Lumpur, Malaysia, 2010.
[43] T. Lechler, E. Fischer, M. Metzner, A. Mayr and J. Franke, “Virtual
Commissioning – Scientific review and exploratory use cases in advanced
production systems,” Procedia CIRP, vol. 81, p. 1125–1130, 2019.
[44] H. Vermaak and J. Niemann, “Virtual commissioning: A tool to ensure effective
system integration,” in 2017 IEEE International Workshop 52017, Donostia, San
Sebastian, Spain, 2017.
[45] J. Nibert, M. E. Herniter and Z. Chambers, “Model-Based System Design for
MIL, SIL, and HIL,” World Electric Vehicle Journal, vol. 5, p. 1121, 2012.
[46] M. Ponchant, “D1.3 – Report on virtual test benches (MiL, SiL, HiL),” 2019.
[47] M. Cech, A.-J. Beltman and K. Ozols, “I-MECH – Smart System Integration for
Mechatronic Applications,” in 2019 24th IEEE International Conference 92019,
Zaragoza, Spain, 2019.
[48] C. G. Lee and S. C. Park, “Survey on the virtual commissioning of manufacturing
systems,” Journal of Computational Design and Engineering, vol. 1, no. 3, p. 213–222,
2014.
[49] S. T. Mortensen, Identify - Quantify - Obtain: Qualifications for virtual commissioning,
Aalborg, Denmark: Aalborg University Press, 2019.
[50] C. R. Kothari, Research methodology, New Delhi: New Age International (P)
Ltd., Publishers, 2004.
[51] A. Øvern, Industry 4.0 - Digital Twins and OPC UA, Norwegian University of
Science and Technology, 2018.
35
Degree Project for Master of Science with specialization in Robotics
Applying digital twin technology in education and research - References
36
Degree Project for Master of Science with specialization in Robotics
Short descriptive title of the work - Appendix A: Robot-level function blocks
Appendix 0:1
Degree Project for Master of Science with specialization in Robotics
Short descriptive title of the work - Appendix A: Robot-level function blocks
Appendix 0:2
Degree Project for Master of Science with specialization in Robotics
Short descriptive title of the work - Appendix A: Robot-level function blocks
Appendix 0:3
Degree Project for Master of Science with specialization in Robotics
Short descriptive title of the work - Appendix B: Main control programs
Appendix 0:4
Degree Project for Master of Science with specialization in Robotics
Short descriptive title of the work - Appendix B: Main control programs
Appendix 0:5
Degree Project for Master of Science with specialization in Robotics
Short descriptive title of the work - Appendix C: Simulation video link
https://youtu.be/q2IQgSsj6mU
Appendix 0:6