0% found this document useful (0 votes)
21 views38 pages

Chapter2 M. USAM

The document provides an introduction to Petri nets and their use in modeling discrete event systems. It defines Petri nets as a mathematical and graphical modeling tool composed of places, transitions, directed arcs, and tokens. Places represent system states, transitions represent events that cause state changes, and tokens flow through the net via arcs when transitions fire. The firing of transitions in a Petri net is controlled by the distribution of tokens and allows for modeling of concurrency, synchronization, and other characteristics of discrete systems. The document discusses simple Petri nets and their firing behavior as well as extensions of Petri nets used to model more complex systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views38 pages

Chapter2 M. USAM

The document provides an introduction to Petri nets and their use in modeling discrete event systems. It defines Petri nets as a mathematical and graphical modeling tool composed of places, transitions, directed arcs, and tokens. Places represent system states, transitions represent events that cause state changes, and tokens flow through the net via arcs when transitions fire. The firing of transitions in a Petri net is controlled by the distribution of tokens and allows for modeling of concurrency, synchronization, and other characteristics of discrete systems. The document discusses simple Petri nets and their firing behavior as well as extensions of Petri nets used to model more complex systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

CHAPTER 2

INTRODUCTION TO PETRI NETS AND MODELLING OF


DISCRETE EVENT SYSTEMS

2.1. INTRODUCTION

The rapid development in science and technology has brought about a lot of man-made
systems, which cannot be described with traditional differential or difference equations.
The examples of these systems include flexible manufacturing systems, computer
network systems, various transportation systems and others. The behaviour of these
systems is determined mostly by discrete events functioning in them. Such systems are
called discrete event systems (DES) or discrete event dynamic systems (DEDS), whose
characteristics can be identified as follows:

Concurrency: In a discrete event system many operations may take place at the same
time, i.e., simultaneously.

Asynchronous operations: Unlike the systems, in which each change or step is


synchronised by a global clock, in discrete event systems, the events often occur
asynchronously.

Event-driven: Discrete event systems can be characterised by a discrete state space, in


which changes in state are caused by event occurrences. In this case, any event may be
dependent on the occurrence of other events, i.e., the completion of one operation may
initiate another operation.

Non-determinism: Non-determinism results from uncertain event occurrences, i.e.,


different evolutions may be possible from a given state.
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

Petri nets, as a graphical and mathematical tool, are being increasingly used in the
modelling, analysis, design and control of discrete event systems (Zhou and DiCesare,
1993). Petri nets were named after Carl A. Petri, a contemporary German mathematician,
introduced a net-like mathematical tool for the study of communication with automata
(Petri, 1962). Ever since, there has been a great deal of research in different disciplines,
including manufacturing systems, computer science, communication systems, etc.
(Zurawski and Zhou, 1994). Petri nets enable a discrete event system of any kind to be
modelled. They present two interesting characteristics. Firstly, they make it possible to
model and visualise behaviours comprising concurrency, synchronisation and resource
sharing. Secondly, the theoretical results concerning them are plentiful (Alla and David,
1994). Petri nets have proven to be very useful in the modelling, analysis, simulation, and
control of manufacturing systems. They provide very useful models for the following
reasons (Desrochers and Al-Jaar, 1995):

• Petri nets capture the precedence relations and structural interactions of


stochastic, concurrent, and asynchronous events. In addition, their graphical
nature helps to visualise such complex systems.
• Conflicts and buffer sizes can be modelled easily and efficiently.
• Deadlocks in the system can be detected.
• Petri net models represent a hierarchical modelling tool with a well-
developed mathematical and practical foundation.
• Various extensions of Petri nets, such as timed Petri nets, stochastic (timed)
Petri nets, coloured Petri nets, and predicate transition nets, allow for both
qualitative and quantitative analysis of resource utilisation, effect of failures,
and throughput rate, and so on.
• Petri net models can be used for both carrying out a systematic analysis of
complex systems and systematic construction (i.e., synthesis) of the discrete
event controllers
• Finally, Petri net models can also be used to implement real-time control
systems for flexible and agile manufacturing systems.

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


18
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

Ordinary Petri nets are not always sufficient to represent and analyse complex industrial
systems. This has prompted the development of new classes of Petri nets. For example,
when modelling complex systems, consisting of many similar interacting activities
ordinary Petri nets increase the graphical complexity of the model. In order to address
this issue, Petri nets, which allow tokens to have distinct identity, were proposed. These
nets, referred to as high-level Petri nets, include predicate-transition nets (Genrish and
Lautenbach, 1981), coloured nets (Jensen, 1981), and nets with individual tokens
(Reisig, 1985). An important development in the area of high-level Petri nets was the
introduction of object oriented Petri nets (Sibentin-Blanc, 1985). Due to the need for
representing approximate and uncertain information has led to the various types of fuzzy
Petri nets (Chen et al, 1990; Garg et al, 1991; Loony, 1988; Valette et al, 1989). The
need for the temporal analysis of the systems resulted in the introduction of temporal
Petri nets (Timed Petri nets) (Suzuki and Lu, 1989).

The purpose of this chapter is to provide a brief introduction to Petri nets. The remainder
of this chapter is arranged as follows: Firstly, some Petri net basics are introduced. This
is followed by some important Petri net extensions, such as inhibitor arc Petri nets,
weighted arc Petri nets, etc. After that, some Petri net modules are considered for
modelling of manufacturing systems. Finally, an extended Petri net formalism, called
Automation Petri nets (APN) is proposed.

2.2. SIMPLE PETRI NETS

An ordinary Petri net is a directed graph represented by a quadruple;

PN = (P, T, Pre, Post)..............................................................................................(1)

Where,
• P = { p1,.........., pn} is a finite set of places,

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


19
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

• T = { t1, .........., tm } is a finite set of transitions,


• Pre is an input mapping P × T → {0, 1} corresponding to the set of directed
arcs from P to T.
• Post is an output mapping P × T → {0, 1} corresponding to the set of directed
arcs from T to P.

Note that P and T are disjoint sets and that any element of P U T is called a node. Petri
nets are assumed to be connected. This means that there exists at least one path between
any two nodes. Generally, places are used to express the states of the systems, while
transitions correspond to control evolutions from one state to another.

Petri nets can be represented graphically, which is helpful in both describing how they
work and gaining an understanding of a particular model. A Petri net graph uses circles
and bars to represent places and transitions, respectively. The input and output functions
are represented by directed arcs between the two types of nodes. An arc directed from a
place to a transition defines the place to be an input place of the transition. Similarly, an
arc directed from a transition to a place defines the place to be an output place of the
transition.

A marked Petri net contains tokens in addition to the elements described above. Tokens
reside in places, travel along arcs, and their flow through the net is controlled by
transitions. They are represented graphically by dots. The marking M(p) of a Petri net is
a mapping of each place to a non-negative integer representing the number of tokens in
that place. A marked Petri net is defined by the quintuple:

PN = (P, T, Pre, Post, M).........................................................................................(2)

The marking M is an n-dimensional vector whose ith component M(Pi) represents the
number of tokens in the ith place Pi. The initial marking is denoted by Mo. A simple Petri
net, showing places, transitions, directed arcs and a token, is given in Fig. 2.1.

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


20
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

Token

Transition

Directed Arc

Place

Figure 2.1. A simple Petri net.

The execution of an ordinary Petri net is controlled by the number and distribution of
tokens in the net and causes the token to flow in the net. Execution is performed by
firing enabled transitions. A transition is enabled when each of its input places is marked
with at least one token. A transition fires by removing a token from each of its input
places and by placing a token in each of its output places. The firing of transitions causes
tokens to flow through the net.

2.2.1. Firing of a Simple Petri Net

The firing of a simple Petri net is shown in Fig. 2.2, where there are four places P = { p1,
p2, p3, p4 } and two transitions T = { t1, t2 }. Initially, as shown in Fig. 2.2.(a), transition
t1 is enabled, because M(p1) = 1, Pre(p1, t1) = 1 and M(p2) = 1, Pre(p2, t1) = 1, and
transition t2 is not enabled, because M(p3) = 0 and Pre(p3, t2) = 1. When transition t1
fires, it removes one token each from places p1 and p2 and deposits one token in place p2,
as shown in Fig. 2.2(b). In this case, transition t2 becomes, because M(p3) = 1 and

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


21
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

Pre(p3, t2) = 1. When transition t2 fires, it removes one token from places p3 and deposits
one token in place p4, as shown in Fig. 2.2(c).

p1 p2 p1 p2 p1 p2

t1 t1 t1

p3 p3 p3

t2 t2 t2

p4 p4 p4

(a) (b) (c)

Figure 2.2. A simple Petri net with : (a) initial marking.


(b) marking after t1 fires. (c) marking after t2 fires.

The tokens, places and transitions must be assigned a meaning for proper integration of
the model. In general, they are interpreted in the following way: Places represent
resources or possible states of the system. The existence of one or more tokens in a place
represents the availability of a particular resource or presence of a condition being met.
A transition represents changings in the system states. A firing transition may be
interpreted as an activity happening. Places and transitions together represent conditions
and precedence relations in the system’s operation. For example, a token in a place can
imply that the condition is true, and no token, that it is false.

2.2.2. Properties of Petri nets

Petri nets as graphical and mathematical tools have a lot of properties. Such properties,
when interpreted in terms of the modelled system, make it possible to identify the

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


22
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

presence or absence of functional properties of the system under design (Zurawski and
Zhou, 1994). There are two types of properties, namely, behavioural and structural. The
former depends on the initial marking of the Petri net, while the latter does not depend
on the initial marking. The structural properties are related to the net structure of a given
Petri net. In this section, some of the most important behavioural properties, from the
practical point of view, are provided. These properties are reachability, boundedness,
safeness, conservativeness, liveness and reversibility. Detailed information about the
other behavioural properties and the structural properties of a Petri net can be found in
(Murata, 1989).

Reachability: The firing of an enabled transition changes the marking, i.e., token
distribution of a Petri net. A marking Mi is said to be reachable from an initial marking
M0 if there exist a sequence of firings that can transform M0 to Mi. A firing sequence is
represented by σ = t1, t2, t3......tn. To show Mi is reachable from Mo by σ the following
representation is used: M0 [σ > Mi.

Boundedness: A Petri net is said to be k-bounded or bounded if the number of tokens in


each place does not exceed a finite number ‘k’ for every marking reachable from the
initial marking M0.

Safeness: A Petri net is said to be safe if all its places are safe. A place ‘p’ is safe if it
contains no more than one token. In other words, a Petri net is called safe if it is 1-
bounded.

Conservativeness: A Petri net is said to be conservative if the total number of tokens in


all its places for all reachable markings is constant.
Liveness: A transition is said to be live if for all markings of the Petri net there is a firing
sequence, which takes the net to a marking, in which the transition is enabled. A Petri net
is live if all its transitions are live. If a Petri net is live and the model is correct, it
indicates the absence of deadlocks in the operation of the system.

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


23
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

Reversibility: A Petri net is said to be reversible if the initial marking M0 is reachable


from each marking.

2.2.3. Analysis of Petri nets

In general, there are two techniques for the analysis of Petri nets: linear algebraic method
and graph-based method. The linear algebraic method is based on matrix equations. In
this case matrix equations represent the dynamic behaviour of Petri nets. The
fundamental to this approach is the incidence matrix, which defines all possible
interconnections between places and transitions in a Petri net. The use of the incidence
matrix representation results in a homogeneous system of linear algebraic equations. This
immediately poses some problems, since the solutions will not be unique (Koussoulas,
1994). Additionally, this method does not provide the firing sequences necessary to
reach a certain marking. Finally, the linear algebraic analysis technique can not be applied
on all Petri nets; they have to be free of self-loops. The advantages of this technique over
the graph-based analysis technique is the existence of simple linear-algebraic properties
(Desrochers and Al-Jaar, 1995).

The graph-based analysis method can be split into two parts for bounded systems: the
reachability tree analysis and the reachability graph analysis. Both methods involve
essentially the enumeration of all reachable markings and it should be able to apply to all
different types of Petri nets. However, they are limited to not very big systems, because
of the computational complexity, and the so called the state explosion problem: the
number of markings can be exponential with respect to the size of the Petri net. For a
bounded Petri net, the reachability tree contains all possible markings. The analysis
problems (i.e., properties of Petri nets), as discussed in the previous section, can be
solved by the reachability tree (Murata, 1989). For bounded systems, the reachability tree
provides all valid firing sequences together with all reachable markings, but the

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


24
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

reachability graph provides only all the reachable markings and firing of transitions
among them.

Given a Petri net, from the initial marking M0, as many “new” markings as the number of
the enabled transitions can be obtained. From each new marking, more markings can be
reached. This process results in a tree representation of the markings. Nodes represent
the markings generated from the initial marking M0 and its successors, and each arc
represents a transition firing, which transforms one marking to another. Consider the
Petri net shown in Fig. 2.3.(a), where there are three places, P = { p1, p2, p3 } and three
transitions T = { t1, t2, t3 }. The reachability tree of this Petri net is shown in Fig. 2.3.(b).
Note that the valid firing sequences of the transitions are as follows: t1t3, t1t2t1t3,
t1t2t1t2t1t3, ......

The reachability graph associated with a system is a graph, in which each node represents
a marking reachable from the initial marking M0 and each arc represents the firing of a
transition. If the marked Petri net is bounded the graph construction process finishes
when all possible firing from the reachable markings have been explored. For the Petri
net, shown in Fig. 2.3.(a), the reachability graph is shown in Fig. 2.3.(c). When the
reachability tree and the reachability graph are considered the difference between these
two techniques can be seen easily. The former simply provides all the valid firing
sequences of a Petri net together with all reachable markings, while the latter only
provides all possible markings and the firing of transitions, which go from one marking
to another. It is important to note that when carrying out reachability tree/graph analysis
only one transition is assumed to fire at a time.

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


25
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

t1

t3 p3
p1 p2
t2

(a)

1, 0, 0
t1
1, 0, 0
0, 1, 0
t2 t3 t2 t1

1, 0, 0 0, 0, 1 0, 1, 0 0, 0, 1
t3
t1

0, 1, 0 (c)
t2 t3

1, 0, 0 0, 0, 1
t1

.
.
. (b)

Figure 2.3. (a) A Petri net. (b) Its reachability tree. (c) Its reachability graph.

2.3. EXTENDED PETRI NETS

Several extensions have been made to ordinary Petri net framework in order to be able to
represent complex systems easily. In this section some of these extensions are
considered. The extensions considered in this section involves the following:

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


26
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

• Weighted arc Petri net


• Inhibitor arc Petri net
• Enabling arc Petri net
• Finite capacity Petri net
• Timed Petri net

2.3.1. Weighted arc Petri net

A weighted arc Petri net is one in which weights are associated with arcs. The Pre and
Post mappings may take values over the set of all non-negative integers. In this case,
each arc is said to have multiplicity k, where k represents the weight of arcs. Ordinary
Petri nets have a multiplicity of 1. The weight of an arc is indicated by a non-negative
integer assigned to the arc. A transition is enabled, if each of its input places is marked
with at least the number of the tokens equal to the weight of the related arc, which
connects the input place to the transition. The transition fires by removing necessary
number of tokens from input places, according to the weights of the input arcs, and by
putting sufficient number of tokens to the output places, according to the weights of the
output arcs. Such a weighted arc Petri net is shown in Fig. 2.4.(a), in which the input arc
p1 → t1 has the weight of ‘n’, i.e., Pre(p1, t1) = n, and the output arc t1 → p2 has the
weight of ‘m’, i.e., Post(t1, p2) = m. In this case, if the number of tokens in the input
place p1 is at least equal to the number ‘n’, then the transition t1 is enabled. When the
transition t1 fires, it removes ‘n’ tokens from input place p1 and deposits ‘m’ tokens to
the output place p2. Instead of using weighted arcs Peterson used the concept of ‘bag of
arcs’ (Peterson, 1981). In this case, Peterson would use ‘n’ number of arcs directed from
place p1 to transition t1 and ‘m’ number of arcs directed from transition t1 to place p2.
This is shown in Fig. 2.4.(b). When the transition is fired, every arc, directed from place
p1 to transition t1, will remove one token from place p1 -‘n’ tokens in total- and every
arc, directed from transition t1 to place p2, will deposit one token to the place p2 -‘m’
tokens in total. However, it is possible to represent the weighted arcs by using the
representation shown in Fig. 2.4.(c), where 2n+1 places are used to represent place p1

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


27
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

and the weighted arc Pre(p1, t1), and m+1 places are used to represent place p2 and the
weighted arc Post(t1, p2). In this case, number of the tokens in place p1 is equal to the
sum of the tokens in places p1i, p11, p12, ...., p1n, i.e., M(p1) = M(p1i) + M(p11) + M(p12) +
.....+ M(p1n), and the number of the tokens in place p2 is equal to sum of the tokens in
places p2o, p21, p22, ...., p2m, i.e., M(p2) = M(p2o) + M(p21) + M(p22) + .....+ M(p2m).

i
p1 4
p1 4 1 4
4 4
44 4
4
n ...................................

t1
m

p2 ...........................
2 3 44 4
24 2 34 44 4
3 n
(a) p11 p1 2 p1 p1
.................

t1

p1 ..............
4 3 3 3 3
44 4 1 2 3 m
4 p2 p2 p2 p2
1 2 3 .............. n

t1

1 2 3 .............. m

p2 2
p2 o 1
(b)
(c)

Figure 2.4. (a). A weighted arc Petri net (b). Equivalent Petri nets with ‘bag of arcs’ representing the
weights. (c). Equivalent ordinary Petri net representing the weighted arcs.

Now consider the firing of a weighted arc Petri net, shown in Fig. 2.5, where there are
four places P = { p1, p2, p3, p4 } and one transition T = { t1 }. In this Petri net, the input
arc p2 → t1 has the weight of 2, i.e., Pre(p2, t1) = 2, and the output arc t1 → p3 has the
weight of 3, i.e., Post(t1, p3) = 3. The other arcs, whose weights are not explicitly
specified, have a weight of 1. In Fig. 2.5.(a), transition t1 is not enabled, because Pre(p2,
t1) = 2 and M(p2) = 1, although Pre(p1, t1) = 1 and M(p1) = 3 and similarly, in Fig 2.5.(b),
transition t1 is not enabled, because Pre(p1, t1) = 1 and M(p1) = 0, although Pre(p2, t1) =

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


28
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

2 and M(p2) = 2. However, the Petri net, shown in Fig. 2.5.(c), is enabled, because
Pre(p1, t1) = 1 and M(p1) = 2, and, Pre(p2, t1) = 2 and M(p2) = 3. When transition t1 fires,
it removes one token from place p1 and two tokens from place p2 and at the same time it
deposits three tokens into place p3 and one token into place p4, as shown in Fig. 2.5.(d).

p1 p2 p1 p2

2 2

t1 t1
3 3

p3 p4 p3 p4

(a) (b)

p1 p2 p1 p2

2 2

t1 t1
3 3

p3 p4 p3 p4

(c) (d)

Figure 2.5. A weighted arc Petri net. (a). Not enabled. (b). Not enabled.
(c). (Enabled) before firing. (d). After firing.

2.3.2. Inhibitor arc Petri net

The modelling power of Petri nets can be increased by adding the ‘zero testing’ ability,
i.e., the ability to test whether a place has no token. This is achieved by introducing an
inhibitor arc. The inhibitor arc connects an input place to a transition and is represented
by an arc whose end is marked by a small circle. The presence of an inhibitor arc

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


29
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

connecting an input place to a transition means that the transition is only enabled if the
input place does not have any tokens. Firing of a transition does not change the marking
of a place, which is connected to the transition with an inhibitor arc. In the general case,
an inhibitor arc Petri net can not be transformed into an ordinary Petri net (David and
Alla, 1992). An inhibitor arc Petri net is shown in Fig. 2.6, where there are three places P
= { p1, p2, p3 } and one transition T = { t1 }. In the Petri net, the arc p2 → t1 is an
inhibitor arc, i.e., In(p2, t1). The Petri net is not enabled in Fig. 2.6.(a), because Pre(p1,
t1) = 1 and M(p1) = 0, although In(p2, t1) = 1 and M(p2) = 0 and similarly, in Fig 2.6.(b),
transition t1 is not enabled, because In(p2, t1) = 1 and M(p2) = 1, although Pre(p1, t1) = 1
and M(p1) = 1. However, the inhibitor arc Petri net in Fig. 2.6.(c) is enabled, because
Pre(p1, t1) = 1 and M(p1) = 1, and, In(p2, t1) = 1 and M(p2) = 0. When transition t1 fires,
it removes one token from place p1 and deposits one token into place p3, as shown in
Fig. 2.6.(d). Note that after the firing of transition t1, the marking of the place p2 remains
the same.

p1 p2 p1 p2 p1 p2 p1 p2

t1 t1 t1 t1

p3 p3 p3 p3

(a) (b) (c) (d)

Figure 2.6. A inhibitor arc Petri net : (a). Not enabled. (b). Not enabled.
(c). (Enabled) before firing. (d). After firing.

It is possible to associate weights with inhibitor arcs. In this case, an inhibitor arc is
called weighted inhibitor arc, which has the ability to test the number of tokens in a
place. If the number of tokens in an input place, connected to a transition with a
weighted inhibitor arc whose weight is ‘k’, is less than the weight value, then the
transition is enabled. If it is equal to or bigger than ‘k’ then the transition is not enabled.

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


30
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

However, in this case it is assumed that all the other input places have sufficient tokens
to enable the transition. The firing does not change the marking in the inhibitor arc
connected places. A weighted inhibitor arc Petri net is shown in Fig. 2.7, where there are
three places P = { p1, p2, p3 } and one transition T = { t1 }. In the Petri net, the arc
p2 → t1 is a weighted inhibitor arc with the weight of 3, i.e., In(p2, t1) = 3. The Petri net is
not enabled in Fig. 2.7.(a), because Pre(p1, t1) = 1 and M(p1) = 0, although In(p2, t1) = 3
and M(p2) = 1 and similarly, in Fig 2.7.(b), transition t1 is not enabled, because In(p2, t1)
= 3 and M(p2) = 4, although Pre(p1, t1) = 1 and M(p1) = 1. However, the Petri net in Fig.
2.7.(c) is enabled, because Pre(p1, t1) = 1 and M(p1) = 1, and, In(p2, t1) = 3 and M(p2) =
2. When transition t1 fires, it removes one token from place p1 and deposits one token
into place p3, as shown in Fig. 2.7.(d).

p1 p2 p1 p2 p1 p2 p1 p2

3 3 3 3
t1 t1 t1 t1

p3 p3 p3 p3

(a) (b) (c) (d)

Figure 2.7. A weighted inhibitor arc Petri net : (a). Not enabled. (b). Not enabled.
(c). (Enabled) before firing. (d). After firing.

2.3.3. Enabling arc Petri net

The modelling power of Petri nets can be increased by adding the ‘one testing’ ability,
i.e., the ability to test whether a place has a token(s). This is achieved by introducing an
‘enabling arc’. The enabling arc connects an input place to a transition and is represented
by an arc, whose end is marked by an empty arrow. The presence of an enabling arc
connecting an input place to a transition means that the transition is only enabled if the

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


31
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

input place has a token(s). The firing does not change the marking in the enabling arc
connected places. An enabling arc Petri net is shown in Fig. 2.8, where there are three
places P = { p1, p2, p3 } and one transition T = { t1 }. In the Petri net, the arc p2 → t1 is
an enabling arc, i.e., En(p2, t1). The Petri net is not enabled in Fig. 2.8.(a), because En(p2,
t1) = 1 and M(p2) = 0, although Pre(p1, t1) = 1 and M(p1) = 1, and similarly, in Fig
2.8.(b), transition t1 is not enabled, because Pre(p1, t1) = 1 and M(p1) = 0, although
En(p2, t1) = 1 and M(p2) = 1. However, the enabling arc Petri net in Fig. 2.8.(c) is
enabled, because Pre(p1, t1) = 1 and M(p1) = 1, and, En(p2, t1) = 1 and M(p2) = 1. When
transition t1 fires, it removes one token from place p1 and deposits one token into place
p3, as shown in Fig. 2.8.(d). Note that after the firing of transition t1, the marking of the
place p2 remains the same.

p1 p2 p1 p2 p1 p2 p1 p2

t1 t1 t1 t1

p3 p3 p3 p3

(a) (b) (c) (d)

Figure 2.8. An enabling arc Petri net : (a). Not enabled. (b). Not enabled.

(c). (Enabled) before firing. (d). After firing.

Although an enabling arc can be represented by two ordinary arcs, as shown in Fig. 2.9.
(a) and (b), enabling arcs are distinctively different from ordinary arcs in the sense that
they do not lead to conflicts in a Petri net. This is shown in Fig. 2.9.(c), where transition
t1 and t2 can fire at any time without any conflict. However, if the enabling arcs En(p2, t1)
and En (p2, t2) are replaced with normal arcs as shown in Fig. 2.9.(d), then it is obvious
that this is a potential conflict situation.

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


32
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

p1 p2
p1 p2

t1 t1

p3 p3

(b)
(a)

p2 p2
p1 p3 p1 p3

t1 t2 t1 t2

p4 p5 p4 p5

(c) (d)

Figure 2.9. (a) An enabling arc Petri net. (b) Its equivalent.
(c). An enabling arc, where there is no conflict. (d) An ordinary Petri net, where there is a conflict.

It is also possible to associate weights with enabling arcs. In this case an enabling arc is
called weighted enabling arc, which has the ability to test the number of tokens in a
place. If the number of tokens in an input place, connected to a transition with a
weighted enabling arc, whose weight is ‘k’, is at least equal to the weight value then the
transition is enabled. If it is less than ‘k’ then the transition is blocked, i.e., it is not
enabled. However, in this case it is assumed that all the other input places have sufficient
tokens to enable the transition. The firing does not change the marking in the weighted
enabling arc connected places. A weighted enabling arc Petri net is shown in Fig. 2.10,
where there are three places P = { p1, p2, p3 } and one transition T = { t1 }. In the Petri
net, the arc p2 → t1 is a weighted enabling arc with the weight of 3, i.e., En(p2, t1) = 3.
The Petri net is not enabled in Fig. 2.10.(a), because En(p2, t1) = 3 and M(p2) = 2,
although Pre(p1, t1) = 1 and M(p1) = 1, and similarly, in Fig 2.10.(b), transition t1 is not
enabled, because Pre(p1, t1) = 1 and M(p1) = 0, although En(p2, t1) = 3 and M(p2) = 3.
However, the Petri net in Fig. 2.10.(c) is enabled, because Pre(p1, t1) = 1 and M(p1) = 1,

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


33
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

and, En(p2, t1) = 3 and M(p2) = 3. When transition t1 fires, it removes one token from
place p1 and deposits one token into place p3, as shown in Fig. 2.10.(d).

p1 p2 p1 p2 p1 p2 p1 p2

3 3 3 3
t1 t1 t1 t1

p3 p3 p3 p3

(a) (b) (c) (d)

Figure 2.10. A weighted enabling arc Petri net : (a). Not enabled. (b). Not enabled.
(c). (Enabled) before firing. (d). After firing.

2.3.4. Finite capacity Petri net

A finite capacity Petri net is one in which capacities (positive integers) are associated
with places. Firing of an input transition of a place pi , whose capacity is CAP(pi), is only
possible, if firing of this transition does not result in a number of tokens in pi that exceeds
the capacity (David and Alla, 1992). Place p2 in Fig. 2.11 is a finite capacity place with
the capacity of 2, i.e., CAP(p2) = 2. Firing of t1 in Fig. 2.11.(a) results in the marking
shown in Fig. 2.11.(b) and similarly firing of t1 in Fig. 2.11.(b) results in the marking
shown in Fig. 2.11.(c). However, transition t1 in Fig. 2.11.(c) can not fire anymore,
because the marking of place p2 has reached its maximum capacity. It is possible to
represent the finite capacity place with two places (p2 and p2’). In this case, first place
(p2) represents the place itself and the marking of second place, i.e., M(p2’), represents
the capacity of the place. In other words, the marking invariant M(p2) + M(p2’) = 2 is
hold. This is shown in Fig. 2.12. Note that Fig. 2.12 (a), (b) and (c) is equivalent to Fig.
2.11 (a), (b) and (c), respectively. Another representation of a finite capacity place can
be done by using weighted inhibitor arc, whose weight ‘k’ equals to the capacity of the

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


34
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

place. This is shown in Fig. 2.13. Note that Fig. 2.13 (a), (b) and (c) is equivalent to Fig.
2.11 (a), (b) and (c), respectively.

p1 p1 p1

t1 t1 t1

p2 CAP(p2) = 2 p2 CAP(p2 ) = 2 p2 CAP(p2) = 2

t2 t2 t2

p3 p3 p3

(a) (b) (c)

Figure 2.11. A finite capacity Petri net : (a). Initial marking (t1 is enabled). (b). Marking after t1 fires (t1
and t2 are enabled). (c). Marking after t1 fires (only t2 is enabled).

p1 p1 p1

t1 t1 t1

p2 p2 ' p2 p2 ' p2 p2 '

t2 t2 t2

p3 p3 p3

(a) (b) (c)

Figure 2.12. A finite capacity place, represented by two places. (a). Initial marking (t1 is enabled). (b).
Marking after t1 fires (t1 and t2 are enabled). (c). Marking after t1 fires (only t2 is enabled).

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


35
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

p1 p1 p1

t1 t1 t1
2 2 2

p2 p2 p2

t2 t2 t2

p3 p3 p3

(a) (b) (c)

Figure 2.13. A finite capacity place, represented by weighted inhibitor arc. (a). Initial marking (t1 is
enabled). (b). Marking after t1 fires (t1 and t2 are enabled). (c). Marking after t1 fires (only t2 is enabled).

2.3.5. Timed Petri net

Ordinary Petri nets do not include any concept of time. With this class of nets, it is
possible only to describe the logical structure of the modelled system, but not its time
evolution. Due to the need for the temporal analysis of discrete event systems, time has
been introduced into Petri nets in variety of ways. In general, there are two types of
timed Petri nets, namely timed-place Petri nets and timed-transition Petri nets. If the
timings are associated with the places, then the Petri net is called timed-place Petri net. If
the timings are associated with the transitions, then the Petri net is called timed-transition
Petri net. In this thesis only the timed-transition Petri net is considered.

A timed-transition Petri net (TTPN) is a tuple as defined in (David and Alla, 1992);

TTPN = ( PN , τ ).....................................................................................................(3)

In (4), PN is a marked Petri net and τ is a function from the set of transitions to the set
of positive or zero rational numbers. τ (ti) = Ti = timing associated with transition ti. In
this case, a token can have two states: it can be reserved for the firing of a timed-

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


36
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

transition ti or it can be unreserved. If a timed transition is enabled, then it is ready to be


fired. When the firing condition for the transition occurs, the token of input place to this
transition is said to be reserved for a specified amount of time(Ti). When the time Ti has
elapsed, the transition is effectively fired: the reserved token is removed from the input
place and an unreserved token is put into the output place(s). This is illustrated in Fig.
2.14, where the transition t2 is a timed-transition with the time delay T2. At the
beginning, there is a token in place p1, as shown in Fig. 2.14.(a). When transition t1 is
fired a token is deposited in place p2, thereby resulting in the enabling of timed-transition
t2, as shown in Fig. 2.14.(b). Then, the firing condition for transition t2 may occur at any
moment after this. When the firing condition occurs, the token required for this firing is
reserved, as shown in Fig. 2.14.(c). When time delay T2, has elapsed, the transition is
effectively fired. The token reserved for firing is then removed from place p2 and an
unreserved token is deposited in place p3. This is shown in Fig. 2.14.(d). Note that
timed-place Petri nets and timed-transition Petri nets are equivalent and it is possible to
move from one to another (David and Alla, 1992).

p1 p1 p1 p1 : Reserved
token

t1 t1 t1 t1
: Unreserved
token
p2 p2 p2 p2

t2 T2 (time delay) t2 T2 (time delay) t2 T2 (time delay) t2 T2 (time delay)

p3 p3 p3 p3

(a) (b) (c) (d)

Figure 2.14. A timed-transition Petri net (TTPN) : (a). Initial marking (t1 is enabled). (b). After t1 is
fired, an unreserved token is deposited in place p2 for a time T2 (t2 is enabled). (c). Firing condition
occurs for t2 and then the unreserved token becomes reserved for firing transition t2, (0<t<T2). (d). After
time T2 has elapsed, transition t2 is effectively fired and a token is deposited in place p3.

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


37
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

2.4. BASIC DESIGN MODULES

In this section, some basic design modules are considered. These modules are useful in
the construction of models for both high level and low level system operations. The
advantage of these modules is obvious: they are specific and therefore easily accepted
and applied when a practical problem is encountered. In this section the following design
modules are considered:

• sequence
• concurrency and synchronisation
• conflict
• buffer
• FIFO queue
• machine
• motor and actuator

2.4.1. Sequence

A sequence in a Petri net represents a series of successive operations. It is possible to


model a sequence Petri net as shown in Fig. 2.15, where there are pn+1 places and tn
transitions. In this case, activities or operations are represented by places. Transitions
represent the end of one activity and at the same time starting of another one. Note that
each activity depends on the completion of the previous one, except for the first activity.

p1 t1 p2 t2 p3 pn tn p n+1
.........

Figure 2.15. A sequence Petri net.

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


38
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

2.4.2. Concurrency and Synchronisation

In a system some activities or operations may be happening concurrently. For example,


two machines can be running concurrently producing two different part-types. There is
no need to synchronise events unless it is required by the underlying system, which is
being modelled. When synchronisation is needed, it is easy to do so. For example, if two
part types, produced by two machines mentioned above, are required to be assembled,
then it can be done when each machine operation is complete. These examples exhibit
the characteristic of concurrency and synchronisation.

Concurrency and synchronisation are shown in Fig. 2.16. As can be seen from the Petri
net when the system starts (t1 fires) two machines, i.e., machine 1 and machine 2, start
operating concurrently in order to produce parts, part 1 and part 2, respectively. When
machine 1 finishes its operation (t2 fires), it produces a part 1. When machine 2 finishes
its operation (t3 fires), it produces a part 2. One machine could finish its operation before
the other one. However, in order to make an assembly both parts are required
(synchronisation).

In terms of Petri nets, concurrency means that two or more events are occurring at the
same time. That is, concurrency will be present when more than one transition is enabled
and firable at the same time. Synchronisation is present, when there is more than one
input place, each of which representing a different activity, to a transition.

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


39
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

p1 ready

starts t1 Concurrency

machine 1 machine 2
p2 p3
working on working on
part 1 part 2

t2 finishes t3 finishes

part 1 part 2
p4 p5
is ready is ready

makes assembly t4 Synchronisation

p6 assembled parts

Figure 2.16. Concurrency and synchronisation

2.4.3. Conflict

In a manufacturing system, when two machines share the same resource and both try to
access it at the same time, this situation leads to conflict. In a Petri net, a conflict
situation occurs when a place enables more than one transition at the same time. In
conflict, only one transition can fire. A conflict in Petri nets is shown in Fig. 2.17.(a). As
can be seen from Fig. 2.17.(a), when there is a token in place p0 all transitions are
enabled. Since only one transition can fire in the case of conflict, any conflict, arising in a
Petri net, must be solved. The conflict can be solved by assigning a priority between the
conflicting transitions. Such a priority for resolving conflict has been proposed by (Zhou
and Dicesare, 1993) as shown in Fig. 2.17.(b), where there are 2n+1 places and ‘n’

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


40
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

transitions. As can be seen from the structure of the Petri net, shown in Fig. 2.17.(b),
each token deposited into place p0 is equally shared by places p1, p2, p3......pn, one by
one. It is also possible to introduce a priority scheme, in which every place, i.e., p1, p2,
....., pn, will receive different number of tokens. Such priority can be represented as
shown in Fig. 2.17.(c), where there are 3n+1 places and 2n transitions. Initially, there are
‘r’ tokens in place p3n and r, m, k, l are non-negative integers. Note that in this case
weighted arcs used to represent different number of tokens. Upon reaching the specified
number of tokens for each output transition the Petri net structure enables the next
output transition, and so on.

p0

t1 t2 ............ tn

p1 p2 ............ pn

(a)

p0

p2n

t1 t2 t3 ............ tn

pn+1 pn+2 pn+3 p2n-1


p1 p2 p3 ............ pn

(b)

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


41
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

p0

p3n
r

p2n+1 p2n+2 p3n-1


............ r
m k l
t1 t1' t2 t 2' t3 t 3' tn t n'
r m k l

pn+1 pn+2 pn+3 p2n-1 p2n


p1 p2 p3 ............ pn

(c)
Figure 2.17. (a) Conflict. (b) Conflict free Petri net. (c) Conflict free Petri net in general case.

Fig. 2. 18 is considered to explain these two conflict resolution techniques in detail. In


Fig. 2.18.(a), there is a conflict between transitions t1 and t2. If this conflict is to be
resolved such that t1 and t2 fire one after another, then this can be done as shown in Fig.
2.18.(b) by using the Zhou and Dicesare’s approach. As can be seen from the Petri net,
firstly, transition t1 fires, then if there is a token in p1, transition t2 fires and so on. If this
conflict is to be solved such that first t1 fires twice and then t2 fires three times and so on.
This can be done this time, as shown in Fig. 2.18.(c), by using the method proposed in
this thesis. Note that initially there are two tokens in place p6. These tokens enable
transition t1. After t1 fires twice, there will be two tokens in place p3 and transition t1’ will
fire immediately by removing these two transitions from place p3 and by depositing three
tokens in place p5. When there is a token(s) in place p5, this will enable transition t2.
After t2 fires three times, there will be three tokens in place p4 and transition t2’ will fire
immediately by removing these three transitions from place p4 and by depositing two
tokens in place p6. This process carries on in a repeating fashion.

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


42
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

p0
p0 p0

p6 p5
p4
2
3
t1 t2 t1 t2 t1 t1 ' t2 t2 '
p3 2 3
p3 p4

p1 p2 p1 p2 p1 p2

(c)
(a) (b)

Figure 2.18. (a) Conflict. (b) Conflict free Petri net. (c) Conflict free Petri net in general case.

2.4.4. Buffer

Buffers, in a manufacturing context, are used to provide temporary storage of workpieces


between operations. For example, it is assumed that the buffer between machine 1 and
machine 2, shown in Fig. 2.19.(a), can hold k parts. One possible Petri net buffer model
is shown in Fig. 2. 19.(b), where the number of tokens in place p1 represents the number
of available spaces in the buffer, while the number of tokens in place p2 represents the
available parts in the buffer. Note that transition t1 represents a part entering into the
buffer and transition t2 represents a part leaving the buffer. Initially there are k tokens in
place p1, indicating that the buffer has capacity k and it is presently empty. When a part
enters the buffer (transition t1 fires) one token is removed from place p1 and one token is
deposited in place p2, indicating that the number of parts in the buffer is incremented by
one, while the number available spaces in the buffer is decremented by one. The parts can
be put into the buffer as long as there is enough space, i.e., there are tokens in place p1.
If there is no token in place p1 this means that the buffer is full. When a part leaves the
buffer (transition t2 fires) one token is removed from place p2 and one token is deposited
in place p1, indicating that the number of parts in the buffer is decremented by one, while
the number of available spaces in the buffer is incremented by one. It is also possible to
model a buffer with a place and a weighted inhibitor arc as shown in Fig. 2.19.(c), where
the number of tokens in place p1 represents the number of parts in the buffer and the

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


43
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

weight k of the inhibitor arc represents the available spaces. In this case, transition t1 can
fire as long as the number of tokens in place p1 is less than k. When the number of tokens
in place p1 equals to k, transition t1 can not fire. This means that the buffer is full.

Machine 1 Buffer Machine 2


incoming parts outgoing parts
Temporary storage
with k capacity

(a)

available spaces
p1 k

t1 t2
p2
...... ......

a part enters available a part leaves


the buffer parts the buffer

(b)

t1 k t2
p1
...... ......

a part enters available a part leaves


the buffer parts the buffer

(c)
Figure 2.19. (a). Buffer in a manufacturing system. (b). Buffer model, implemented by two places.
(c). Buffer model, implemented by a place and a weighted inhibitor arc.

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


44
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

2.4.5. FIFO queue

A First-In-First-Out (FIFO) Queue is also called First-Come-First-Serve (FCFS) Queue


in manufacturing context. A conveyor belt is an example of a FIFO part queue, where
the first part put onto the belt is the first part to come off the other end. The structure of
the FIFO queue depends on whether the queue is supposed to store only one part-type or
multiple part-types. When the single part-type case is considered, it is possible to use the
models proposed for modelling the buffer. It is also possible to introduce a ‘safe’ Petri
net model for a FIFO queue. For example, consider the conveyor belt shown in Fig.
2.20.(a). Assume that the conveyor belt can carry n parts. To model this FIFO queue
structure, it is possible to use the Petri net as shown in Fig. 2.20.(b), where tokens in
places p1, p2......pn represent the presence of parts on the 1st place, on the 2nd place, .......,
on the nth place of the conveyor belt respectively, while tokens in places p1’, p2’......pn’
represent the presence of available places on the 1st place, 2nd place......., nth place of the
conveyor belt, respectively. An alternative safe FIFO queue model is shown in Fig.
2.20.(c), where inhibitor arcs are used to specify available spaces on the conveyor belt.

1st place 2nd place 3rd place nth place

..................

(a)

p1 ' p 2' p3' pn'

t1 p1 t2 p2 t3 p3 t4 tn-1 pn tn
........ ......... ........

1st place 2nd place 3rd place nth place

(b)

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


45
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

t1 p1 t2 p2 t3 t4 tn-1 tn
p3 pn
........ ......... ........

1st place 2nd place 3rd place nth place

(c)
Figure 2.20. (a) A conveyor belt. (b). Its FIFO queue model.
(c) FIFO queue model implemented with inhibitor arcs.

The FIFO queue models considered above are simple, because it was assumed that all
tokens (parts) were the same. However, in many practical situations the FIFO queues
have more than one part-type. For example, in Fig. 2.21.(a) there are two part-types,
namely part a and part b, on a conveyor. This is an example of a FIFO queue with two
parts. It is possible to model this system with a Petri net as shown in Fig. 2.21(b), where
tokens in places p1a, p2a, p3a, ....., pna represent the presence of part a’s on the 1st place,
2nd place, 3rd place......., on the nth place of the conveyor belt respectively, while tokens in
places p1b, p2b, p3b, ....., pnb represent the presence of part b’s on the 1st place, 2nd place
3rd place, ......., on the nth place of the conveyor belt respectively. Tokens in places p1, p2,
p3, ......, pn represent the absence of part a’s or b’s on the 1st place, 2nd place, 3rd place,
......., on the nth place of the conveyor belt. An alternative safe FIFO queue for two part
types is shown in Fig. 2.21.(c), where inhibitor arcs are used to specify available spaces
on the conveyor.

1st place 2nd place 3rd place nth place

..................

part a part b

(a)

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


46
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

t1a p1a t2a p2a t3a p 3a t4a t (n-1)a pna tna


........ ......... ........

p1 p2 p3 pn

t1b p1b t2b p2b t3b p 3b t4b t (n-1)b pnb tnb


........ ......... ........

1st place 2nd place 3rd place nth place

(b)

t 1a p1a t2 p2a t 3a t 4a t (n-1)a t na


p3a pna
........ ......... ........

t 1b t 2b t 3b t 4b t (n-1)b t nb
p1b p2b p3b pnb
........ ......... ........

1st place 2nd place 3rd place nth place

(c)
Figure 2.21. (a) A conveyor belt with two part-types. (b). Its FIFO queue model.
(c) FIFO queue model for two part-types, implemented with inhibitor arcs.

Note that p1’, p2’, p3’.....pn’ of the Fig. 2.20.(b) as well as p1, p2, p3.....pn of the Fig.
2.21.(b) are called monitor places. In Fig. 2.20.(b) the place invariant M(p1) + M(p1’) = 1
is hold for places p1 and p1’. This means that the number of tokens that can be present in
places p1 and p1’ can not be more than one. Similarly, in Fig. 2.21.(b), the place invariant
M(p1a) + M(p1b) + M(p1) = 1 is hold for places p1a, p1b and p1. This means that the
number of tokens that can be present in places p1a, p1b and p1 can not be more than one.
How the place invariant method is used to represent the maximum number of tokens,
which can be present in a group of places, is considered in detail in (Moody et al 1994,
Yamalidou et al, 1996).

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


47
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

2.4.6. Machine

There are two types of machine operations, that can be considered. In the first case, a
machine is assumed to work without any breakdown. The machine in this case is called a
reliable machine. In the second case, any possible breakdown is also taken into account.
The machine in this case is called an unreliable machine. A reliable machine can be
modelled as shown in Fig. 2.22.(a), where a token in place p1 represents the machine
being idle and a token in place p2 represents the machine working. Initially, the machine
is idle. When it is started to its operation (t1 fires), it is working. When it is stopped, it is
idle again. An unreliable machine can be modelled as shown in Fig. 2.22.(b), where the
machine has three different states: idle, working and down. When the machine is working
it may either finish its operation (transition t2) or it may breakdown (transition t3). When
the machine is down it needs to be repaired (transition t4) before returning back to its
working state.

p1
p1

idle idle
t1 t2 t1 t2
p2 p2

working stops starts working stops


starts
t3 t4
breaks repaired
down
p3
down

(a) (b)

Figure 2.22. (a) Reliable machine. (b) Unreliable machine.

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


48
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

2.4.7. Motor and Actuator

Normally, if a motor’s operation involves turning in the same direction, it is possible to


describe its operation with on and off states, as shown in Fig. 2.23.(a). In this case,
initially the motor is off. When it is switched on (transition t1 fires), it is on. When it is
switched off (transition t2 fires), it is off. If a motor’s operation involves turning both
forwards and backwards, then it can be modelled as shown in Fig. 2.23.(b). In this case,
initially the motor is off. It can be switched-on-forwards (transition t4) or switched-on-
backwards (transition t3). In addition an actuator’s operation can also be modelled as
shown in Fig. 2.23.(a). This means that an actuator is either off or on. When the
actuator’s state is shown as being on in the model, it is assumed that in the real system it
is in operation and vice versa.

switch on switch off switch off

t1 t1 t2

p1 p2 p1 p12 p3

off t2 on on backwards t3 off t4 on forwards

switch off switch on backwards switch on forwards

(a) (b)

Figure 2.23. (a). A motor model, with on and off states.


(b). A motor model, with on forwards, off and on backwards states.

2.5. AUTOMATION PETRI NETS

As manufacturing systems become more complex, the need for an effective automation
tool to produce Discrete Event Control System (DECS) becomes increasingly more
important. Petri nets have appeared as the most promising tool to facilitate such design
work. In this section, Automation Petri nets (APN) are proposed as a new method for

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


49
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

the design of DECSs. Since ordinary Petri nets do not deal with sensors and actuators,
the Petri net concepts are extended, by including actions and sensor readings as formal
structures within the APN. These extensions involve extending the Petri nets to
accommodate sensor signals at transitions and to assign action to the places. A typical
discrete event control system (DECS) is shown in Fig. 2.24.(a). It consists of a discrete
event system (DES), to be controlled and a discrete event controller (DEC). Sensor
readings are regarded as inputs from the DES to the DEC, and control actions are
considered as outputs from the DEC to the DES. The main function of the DEC is to
supervise the desired DES operation and to avoid forbidden operations. To do this, the
DEC processes the sensor readings and then it forces the DES to conform to the desired
specifications through control actions. Nowadays, PLCs are the most popular
implementation tools for this type of DEC. Petri nets can be used to design such DECs.
However, ordinary Petri nets do not deal with actuators or sensors. Because of this, it is
necessary to define a Petri net-based controller (Automation Petri net, APN) which can
embrace both actuators and sensors within an extended Petri net framework. An APN is
shown in Fig. 2.24.(b). In the APN, sensor readings can be used as firing conditions at
transitions. The presence or absence of sensor readings can be used in conjunction with
the extended Petri net pre-conditions to fire transitions. In the APN, two types of
actuation can be considered, namely impulse actions and level actions. Actions are
associated with places. With these additional features, it is possible to design Discrete
Event Control Systems. Fig. 2.24.(c) shows how an APN can be used as a DEC in a
DECS.

p
1
t1 x1
2
p p p p sensor
p 2 3 5
4
sensor 1 readings
3 2
t1 t2 x t3 x3
Discrete Event readings x1 2
Controller(DEC) 2
p p p p
2 3 4 5 p Action1
6
3 2
t2 x t3 x3
2
Discrete Event
control System (DES) control Discrete Event
p Action1 actions System (DES)
actions 6

(a) (b) (c)

Figure 2.24. (a). A typical discrete event control system.


(b). Automation Petri Net (APN). (c). APN as a controller in a DECS.

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


50
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

Formally an APN can be defined as follows:

APN = (P, T, Pre, Post, In, En, χ , Q, M0 )...............................................................(4)

Where,
• P = { p1, p2, ......,pn } is a finite, nonempty set of places,
• T = { t1, t2, ......., tn } is a finite, nonempty set of transitions, P ∪ Τ ≠ ∅ and P ∩ T= ∅,
• Pre: (P×T) → Ν is an input function that defines directed ordinary arcs from places to
transitions, where N is a set of nonnegative integers,
• Post: (P×T) → Ν is an output function that defines directed ordinary arcs from
transitions to places,
• In: (P×T) → Ν is an inhibitor input function that defines inhibitor arcs from places to
transitions,
• En: (P×T) → Ν is an enabling input function that defines enabling arcs from places to
transitions,
• χ = { χ1, χ2, ........, χm } is a finite, nonempty set of firing conditions associated with

the transitions,
• Q = { q1, q2, ......., qn } is a finite set of actions that might be assigned to the places,
• M0 : P → Ν is the initial marking.

The APN consists of two types of nodes called places, represented by circles ( O ), and
transitions, represented by bars ( ). There are three types of arcs used in the APN,
namely, ordinary arcs, represented by a directed arrow ( ), inhibitor arcs, represented
by an arrow, whose end is a circle ( ), and finally enabling arcs, represented by a
directed arrow, whose end is empty ( ). Weighted and directed ordinary arcs connect
places to transitions and vice versa, while weighted enabling arcs and inhibitor arcs
connect only places to transitions. Places represent the status of the system and
transitions represent events. Each transition has a set of input and output places, which

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


51
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

represent the pre-condition and post-condition of the transition. The actions (Q),
assigned to the places, can be either impulse actions or level actions. Impulse actions are
enabled at the instant when a token is deposited into the place and level actions are
enabled when there is a token(s) at the place. More than one action may be assigned to a
place. Firing conditions in the APN are recognised as external events such as sensor
readings. A firing condition, χ, associated with a transition t, is a Boolean variable that
can be 0, in which case related transition t is not allowed to fire, or it can be 1, in which
case related transition t is allowed to fire if it is enabled. The marking of the APN is
represented by the number of tokens in each place. Tokens are represented by black dots
(•). Movement of tokens between places describes the evolution of the APN and is
accomplished by the firing of the enabled transitions. The following rules are used to
govern the flow of tokens:

Enabling Rules: In the APN, there are mainly three rules which define whether a
transition is enabled to fire.

1. If the input place of a transition t is connected to the transition with a directed


ordinary arc, then transition t is said to be enabled when the input place p contains at
least the number of tokens equal to the weight of the directed ordinary arc
connecting p to t.

2. If the input place of a transition t is connected to the transition with an enabling arc,
then transition t is said to be enabled when the input place p contains at least the
number of tokens equal to the weight of the enabling arc connecting p to t.

3. If the input place of a transition t is connected to the transition with an inhibitor arc,
then transition t is said to be enabled when the input place p contains less tokens than
the weight of the inhibitor arc connecting p to t.

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


52
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

In the case, where a transition may have the mixture of these input arcs, enabling rule for
the transition must be analysed accordingly.

Firing Rules: In the APN, an enabled transition t can or can not fire depending on the
external firing condition χ of t. These firing conditions can be, positive level or zero level
of a sensor reading. Broadly speaking, a firing condition χ may include more than one
sensor reading with ‘AND’, ‘OR’ and ‘NOT’ logical operators. When dealing with more
than one sensor readings as firing conditions, the logical operators of firing conditions
must be taken into account accordingly. In the special case, where χ = 1, transition t is
always allowed to fire when it is enabled. When an enabled transition t fires, it removes
from each input place p the number of tokens equal to the weight of the directed
ordinary arc connecting p to t. It deposits, at the same time, in each output place p the
number of tokens equal to the weight of the directed arc connecting t to p. It should be
noted that, the firing of an enabled transition t does not change the marking of the input
places, which are connected to the transition t only by enabling or inhibitor arcs. It is also
possible to consider timed APNs, as in normal Petri nets.

2.6. DISCUSSION

In this chapter, an introduction to Petri nets has been given. This has included firstly, the
definition of ordinary Petri nets and firing of a simple Petri net. After that some of the
most important behavioural properties such as reachability, boundedness, liveness, of
Petri nets have been considered. Analysis techniques for Petri nets have also been
discussed. It is necessary to note that Petri net models considered in this thesis are
bounded, live, and also reversible, safe and conservative unless otherwise stated. Since
ordinary Petri nets are not always sufficient to represent and analyse complex systems,
some new classes of Petri nets have been proposed in the literature. Therefore, some
important extended Petri nets, such as weighted arc Petri net and timed Petri nets, have
been introduced by the research community. Then, some basic design modules have been

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


53
Chapter 2 Introduction to Petri Nets and Modelling of Discrete Event Systems

considered. It is important point out that the basic Petri net modules provided can be
used as building blocks when modelling a system with Petri nets. Finally, in this thesis an
extended Petri net formalism, called Automation Petri nets, has been proposed in order
to include sensor readings and actuator operations within the Petri net formalism. APNs
make it possible to design a controller for a discrete event system.

University of Salford, UK, Ph.D. Thesis, 1998 M. Uzam


54

You might also like