# Communication Layer Architecture for a Production Line Digital Twin Using Hierarchical Colored Petri Nets

Adam Sulak, Charles Steinmetz, Achim Rettberg

► To cite this version:

Adam Sulak, Charles Steinmetz, Achim Rettberg. Communication Layer Architecture for a Production Line Digital Twin Using Hierarchical Colored Petri Nets. 7th International Embedded Systems Symposium (IESS), Nov 2022, Lippstadt, Germany. pp.41-50, 10.1007/978-3-031-34214-1_4 . hal-04645296

HAL Id: hal-04645296

https://inria.hal.science/hal-04645296v1

Submitted on 11 Jul 2024

**HAL** is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_2.png" /></figure>

ifip

International Federation for Information Processing

This document is the original author manuscript of a paper submitted to an IFIP
conference proceedings or other IFIP publication by Springer Nature. As such, there
may be some differences in the official published version of the paper. Such
differences, if any, are usually due to reformatting during preparation for publication or
minor corrections made by the author(s) during final proofreading of the publication
manuscript.
# Communication Layer architecture for a production line Digital Twin using Hierarchical Colored Petri Nets

Adam Sulak, Charles Steinmetz, Achim Rettberg

Hochschule Hamm-Lippstadt, Lippstadt NRW 59557, Germany

adam.sulak@stud.hshl.de, charles.steinmetz@hshl.de,

achim.rettberg@hshl.de

**Abstract.** Modern enterprises must adapt to world events faster and faster to stay competitive. One of the ideas that gained traction in recent years that might help businesses speed up decision-making and decrease the cost of operations is the Digital Twin (DT) concept. Digital Twin allows for greater insight into how modelled systems work by creating a virtual copy of the system or object on which simulations can be performed. One of the key enablers to effective DTs is information exchange between the real system and its virtual copy. In this work we present architecture and prototype model of communication layer for Digital Twins of production line based on Hierarchical Colored Petri Nets (HCPNs).

**Keywords:** Digital Twin · Petri Net · Vertical Farm.

## 1 Introduction

Modern factories are immensely complex systems of interconnected machines that have to meet stringent requirements of efficiency and reliability [5]. Any time a production line is stalling due to a machine failure or overproduction there is a significant cost being incurred. To avoid stalling and ultimately decrease the final cost of a manufactured good many managerial, logistical and technological advances have been made [6]. In the technological sphere those improvements usually came down to the automation of tasks that were previously performed by human factory workers.

There is still a lack to be filled in the automation of decision-making of complex systems. For instance, people who manage production lines have to constantly make decisions related to the maintenance and running of a production line that could be automated. In this context, this work-in-progress paper addresses the communication problems that arise when connecting a real production line with an intelligent management system. The proposed approach uses the concept of Digital Twin supported by Hierarchical Colored Petri Nets [9].
## 2 Related Works

This chapter presents related works that have been used to build the proposed approach.

### 2.1 Place as a physical input

A paper published by researchers from Technical University of Crete presents an application of a Petri net based digital twin for controlling the process of creating an electric car from its design stage to the finished vehicle [8]. The Petri net in the DT uses extensions introduced in their previous work [7] as a way to describe unavoidable delays between specific tasks. This mechanism allows for creating a Digital Twin of the process which knows when to generate tokens depending on the stage of production.

### 2.2 Petri Net as a messenger between AI and the world

Researchers from Guangdong Institute of Semiconductor Industrial Technology and Northeastern University in their paper introduces new highly modified a version of Petri Net called Modified Hybrid Stochastic Timed Petri Nets (MHSTPN) [2]. These nets define different types of places for modeling discrete, continuous, timed, and stochastic processes which allow for precise representation of complex phenomena within machinery.

The author's goal is to create a system for automatic fault detection using machine learning techniques. To do so they model machine processes as a Petri Nets whose places are affected by sensor outputs from the machine. The state of the entire Petri Net is then read by a Machine Learning model which can determine the next optimal state of the Net and enable suitable tokens.

## 3 Concept of communication layer architecture for a Digital Twin using Hierarchical Colored Petri Nets

### 3.1 Digital Twin

For our purposes, Digital Twin [4] is a virtual copy of a physical entity that is connected with that physical entity. The Digital Twin gathers information from the physical entity and uses that information to further improve the simulation accuracy of a real object. Digital Twin can contain components such as a precise 3 dimensional model of components of the real object, data about properties of materials being used, software representing internal logic of the device, database for data collection, analytics engine for interpretation of data and simulations, and optionally AI for making decisions [1].

In this paper, the focus is on the communication scheme for exchanging data between real production line machines and their Digital Twin.
## 3.2 Layer Architecture

Layer architecture (figure 1) is a basic view of the structure of interactions between the real and digital twin. The Device Layer includes all the physical devices within a production line. Those various status messages are received by Control Layer whose purpose is to translate them into one standard format that is readable to Decision Layer. The Control layer has to translate messages in the opposite direction. When Decision Layer sends information on what actions to perform next, Control Layer must translate those actions into messages specific to machinery on production line. The Decision Layer itself, as the name suggests, is responsible for aggregating information from Physical Twin and making decisions based on that information and historic data acquired by the Decision Layer over the lifetime of the entire system.

<figure><img src="image_3.png" /><figcaption>Fig. 1: Layer Architecture</figcaption></figure>

**Control Mechanism for the devices** All the singular machines and interactions between them are modeled as HCPNs. The communication relies on a simple idea of having command and status places. These places are exposed as an interface to the outside world and allow a control of internal processes within a device. Command place is always an input place of a some transition that represents a state change while Status place is always an output place of a transition which informs about a change in the state. Figure 2a shows how this relation looks in practice. Places ‘P_IN’ and ‘P_OUT’ represent some physical inputs and outputs of the machine while ‘CMD’ and ‘STS’ ports are just abstract places for passing relevant information. The result of a transition is in the following figure 2b.

**Machines as Substitution Transitions** Substitution Transition is a mechanism for creating reusable components and submodules in HCPNs. To utilize transition substitution within machines and production lines we first have to
<figure><img src="image_4.png" /><figcaption>Fig. 2: Command and Status places as a part of transition</figcaption></figure>

identify the common structure of each machine. In figure 3 we have a model of a generic machine. Any machine in the model has some internal HCPN representation that models state behavior and actions. This internal Petri net has exposed input and output places responsible for holding tokens representing physical objects such as product components. The ‘1..N’ above is a shorthand signifying that in fact machine might have multiple inputs and outputs.

<figure><img src="image_5.png" /><figcaption>Fig. 3: Generic Machine Model</figcaption></figure>

The second vital part is a Command/Status interface which takes a single machine command token from the control system and decomposes it to a set of command tokens for specific command places within an interface that connects to transitions in internal HCPN. The interface does the opposite when it comes to status messages. Status tokens received from internal HCPN are composed
of a single status message inside the interface and exit a machine as a single
machine status token. Internal HCPN and Command/Status interface form a
single Petri which in higher level modeling is presented as a single transition
between inputs and outputs.

**Control Places Types** The following section we make a distinction between different types of command and status places. Those are:

- Transition Level Places - those are command and status places that are di-
  rectly connected to transition within an internal process of a machine. Tokens
  in those places do not contain hierarchical data that can be decomposed.

- Machine Level Places - those are places that are connected to the entire ma-
 chine represented as a substitution transition. Tokens in those places either
contain a set of commands or statuses that can be later decomposed into
individual transition-level tokens. Machine-level tokens additionally will in-
clude information that will help the machine interface to decompose it into
transition-level tokens.

- Line Level Places - those are places that connect to the entire production line as a substitution transition. Line level places hold tokens that contain a set of data that is decomposable into individual Machine Level tokens which in turn can be further decomposed to Transition level tokens. Line Level tokens besides holding data for lower-level tokens also includes information about the destination place.

**Connecting Machines** Chaining machines is done by sharing the output place of one machine with the input place of the other machines. Joined output and input places must have a matching place type. Figure 4 shows how individual machines can be connected using physical places and form a production line.

<figure><img src="image_6.png" /><figcaption>Fig. 4: Machine chaining pattern</figcaption></figure>

Machines are substitution transitions (by convention substitution transitions
have double border) that have a defined number of places for interacting with
them. Those places are used as joining nodes in a higher-level design where the
inner workings of the machine itself are not a concern.
**Network Bridge** Network Bridge is an abstraction over all communication protocols involved in sending token values between the production line and digital twin inside the control layer. Network Bridge exposes Machine Command output and Machine Status input places to which individual machines can be connected, as well as input places for Line Commands and output places for Line Statuses. Tokens that go through those inputs and outputs are transformed into packets and moved over physical network to their destination which is either a real production line or Control Layer. Network Bridge is meant to rely on existing communication protocols and is not further explored in this work.

**Digital Twin and Decision Layer Interface** The last section of the Control Layer consists of Status and Commands places for connecting to a Network Bridge, a pair of digital twins of a production line, interfaces for reading and writing tokens and interfaces for interacting with the digital twins. How those elements are connected together is presented in figure 5.

<figure><img src="image_7.png" /><figcaption>Fig. 5: Digital Twin Pair</figcaption></figure>

The reason for having two digital twins in the control layer is because they serve different purposes. The first digital twin on the left side of the figure is used as a source of absolute truth for the Decision Layer. The second location is the Main Interface which unpacks data from the token and passes it to Decision Layer. The second digital twin in the right portion of the figure is dedicated to performing simulations. It is not interacting directly with the real production line, but it
is used by Decision Layer in combination with historic data from the Knowledge Graph to determine the next Line Command token.

The advantage of having two Digital Twins is the fact that it enables the Decision Layer to detect unusual behaviors of the line by seeing differences between the output of the simulation and the actual state of the production line after sending the Command message. This way Decision The layer can compensate Digital Twins imperfections by informing human operators to investigate the issue or add compensation functions into the Knowledge Graph and use them when making future predictions.

# 4 Use case implementation: Vertical farming

As a point of reference we use a concept model of a fully automated Vertical Farm [3]. The entire process relies on the movement of a special drawer-like containers called pods which are used as a vessel for growing plants. When plants are fully grown all the pods are being loaded to a lorry or other transporter and delivered to a food store. Empty pods come back to a facility to be reused.

A subprocess that will be used as an example for the control layer model is the simple procedure of taking empty pods into a facility and preparing them for the next harvesting cycle (figure 6).

<figure><img src="image_8.png" /><figcaption>Fig. 6: Pod Cleaning and storage process</figcaption></figure>

Each rectangle in the figure represents a machine within a facility and a black point with a rhomboid is an entry point of the process. The process here does not join elements together it only moves pods from one machine to the other which makes it an easy target for the first basic model.

## 4.1 Real Line

The first major component of the Control Layer is the net representation of the real production line which we refer to simply as ‘Real Line’. Real Line is a chain of net models of each machine in the production line. Chaining is done by representing those nets as substitution transitions in a higher level assembly as presented earlier in figure 4. Real Line is built out of three sub-components: Pod Loader, Pod Cleaner and Quality Checker.
**Pod Loader** Pod Loader is a machine through which delivery trucks can return empty pods to the Vertical Farm. The machine takes pods from the loading frame to which trucks unload empty containers and moves them into a temporary storage area. From that storage space pods can be moved further for cleaning and inspection if needed. In figure 7 we can see the CPN model of a Pod Loader which in following section is reduced down to a single substitution transition.

<figure><img src="image_9.png" /><figcaption>Fig. 7: Pod Loader model</figcaption></figure>

The two remaining machines, Pod Cleaner and Quality Checker are implemented in similar fashion so they are not discussed in detail in this paper.

**Real Line Assembly** At this point, we have each machine of the Real Line implemented. Each of these machines can now be used as substitution transition in the Real Line assembly. Figure 8 shows the Real Line model which very closely reflects the concept of machine chaining from figure 4. Places between substitution transitions are referred to as transition places because they are at the same time output machine on the left and the input of the machine on the right. They exist only to conform to the semantics of Petri nets. The physical inputs and outputs of the entire module are just inputs of the first machine in the line and outputs of the last machine in the line. Each machine also exposes Control Machine Level places for connecting to a Network Bridge.

## 4.2 Digital Twin Pair

Digital Twin is the last component of the Control Layer to which the Decision Layer has direct access through the Digital Twin Interface. DT Pair is also a component in which Petri Nets must expose an interface for direct manipulation of the twin network. This means CPN Tools is not a sufficient modeling tool for testing interactions with Decision Layer. However, this is not an obstacle
<figure><img src="image_10.png" /><figcaption>Fig. 8: Real Line model</figcaption></figure>

when testing the Control Layer with a predetermined set of commands. DT Pair consists of two major assemblies, Current State DT and Simulation DT.

Current State Digital Twin (CSDT) uses a modified copy of the Real Line in which the state of the machine is altered according to the received status message and not a command. Machines in Current State DT is changed in such a way that their state transitions do not depend on external factors. What this means in practice is that any machine in which the processed object can take more than one path based on the parameters that are not controlled by the said machine is a subject of necessary modifications of the DT model so that external factors that affect state changes are replaced with paths that depend on the value of Machine Status Token.

Simulation DT is an exact copy of the Real Line model. Main DT Interface connects to Line Level Places and Netstate Interface to allow data exchange with the Decision Layer.

Assembly of DT Pair closely reflects structure of DT Pair concept in figure 5. As with the initial concept DT Pair exposes one input which leads Line Status Messages to Status Splitter that distributes data to CSDT components and one output Line Command place which has a direct link to the Decision Layer. The missing connections of input and output places and Netstate Interfaces of the Digital Twins with the Main DT Interface are caused by the fact that CPN Tools are not built to model interactions between Petri Nets and other software. Netstate and DT interfaces are just commented annotations to show how other components fall in together.

# 5 Conclusion

This work has addressed the communication problems that arise when connecting a real production line with an intelligent management system. The approach has been developed based on the Digital Twin concept and supported by Hierarchical Colored Petri Nets.

Concept of Machine Chaining could find its applications in a new generation of production line design tools where machine manufacturers would provide their
machine model as a form of closed-source API. This would open the door to
rapid factory building that would enable enterprises to adapt to world events
much faster. The great potential of Petri Net-based Control Layer is also hard to
overlook when it comes to integration with existing network protocols. When it
comes to already existing production lines the communication layer for the man-
agement system could be integrated into the factory system if machine interfaces
were connected to software adapters that expose them as a Command/Status
interface. This transformation would not require deep infrastructural changes
around the production line thanks to compatibility with existing network pro-
tocols.

References

[1] Aerospace Industries Association (AIAA). DIGITAL TWIN: DEFINITION VALUE. Accessed: 2022-03-30. 2022. URL: https://www.aiaa.org/docs/default-source/uploadedfiles/issues-and-advocacy/policy-papers/digital-twin-institute-position-paper-(december-2020).pdf.

[2] Ruimin Cao et al. “A Decision-Making Framework of Hybrid System Based on Modified Hybrid Stochastic Timed Petri Net and Deep Learning”. In: *IEEE Systems Journal* 15.2 (2021), pp. 1804–1814. DOI: 10.1109/JSYST. 2020.2983044.

[3] Dickson Despommier. *The vertical farm: feeding the world in the 21st century*. Macmillan, 2010.

[4] M Grieves. "Digital twin: Manufacturing excellence through virtual factory replication". In: URL http://www.apriso.com (2014).

[5] Sanja Lazarova-Molnar and Nader Mohamed. "Reliability assessment in the context of industry 4.0: data as a game changer". In: *Procedia Computer Science* 151 (2019), pp. 691–698.

[6] Marcos Leandro Hoffmann Souza et al. “A survey on decision-making based on system reliability in the context of Industry 4.0”. In: *Journal of Manufacturing Systems* 56 (2020), pp. 133–156.

[7] George J. Tsinarakis. “Modeling Task Dependencies in Project Management Using Petri Nets with Arc Extensions”. In: *2018 26th Mediterranean Conference on Control and Automation (MED)*. 2018, pp. 84–89. DOI: 10.1109/MED.2018.8442472.

[8] George J Tsinarakis et al. “Implementation of a petri-net based digital twin for the development procedure of an electric vehicle”. In: *2020 28th Mediterranean Conference on Control and Automation (MED)*. IEEE. 2020, pp. 862–867.

[9] YanPing Yang, QingPing Tan, and Yong Xiao. “Verifying web services composition based on hierarchical colored petri nets”. In: *Proceedings of the first international workshop on Interoperability of heterogeneous information systems*. 2005, pp. 47–54.