Dynamic Behavior Modeling of Manufacturing Systems using Petri Nets

L
e
a
r
n
i
n
g
 
o
b
j
e
c
t
i
v
e
s
 
:
Introduce Petri nets
Dynamic behavior modeling of manufacturing systems using PN
Analysis of Petri net models
T
e
x
t
b
o
o
k
 
:
J.-M. Proth and X. Xie, Petri nets: a tool for design and management of
manufacturing systems, John Wiley & Sons, 1996
C. Cassandras and S. Lafortune, Introduction to Discrete Event Systems,
Springer, 2007
C
h
a
p
t
e
r
 
3
P
e
t
r
i
 
n
e
t
s
1
P
l
a
n
Introduction to Petri nets
Formal definitions
Petri net models of manufacturing system
Elementary classes of Petri nets
Properties of PN models
Analysis methods
2
2
3
3
Introduction to Petri nets
A
 
t
w
o
-
p
r
o
d
u
c
t
 
s
y
s
t
e
m
4
 
 
 
 
 
 
 
 
Two types P1 and P2 of products are produced.
The production of each product requires two operations.
The first operation is performed by a shared machine.
The second operation is performed by a dedicated machine.
There is at most one product of each type loaded in the
system at any time.
When a product finishes, a new product of the same type is
dispatched.
To be modelled using an usual process-resource
modelling approach
.
A
 
t
w
o
-
p
r
o
d
u
c
t
 
s
y
s
t
e
m
P
r
o
c
e
s
s
 
m
o
d
e
l
i
n
g
5
 
 
 
 
 
 
 
 
Goal
: model the manufacturing process of each product, i.e. all possible
states of a product including waiting
Identify all relevant operations and their precedence constraints.
Identify all possible waits for shared resources.
 
 
A
 
t
w
o
-
p
r
o
d
u
c
t
 
s
y
s
t
e
m
6
 
 
 
 
 
 
 
 
Process
 : P1, P2
Resource
 : M (shared machine)
Dedicated machines are not restrictive resources here (Why)
Process steps :
P1
P2
A
 
t
w
o
-
p
r
o
d
u
c
t
 
s
y
s
t
e
m
P
r
o
c
e
s
s
 
m
o
d
e
l
i
n
g
7
 
 
 
 
 
 
 
 
Associate each process a state-transition graph.
 
 
wait for shared machine
parts under operation 1
parts under operation 2
A
 
t
w
o
-
p
r
o
d
u
c
t
 
s
y
s
t
e
m
P
r
o
c
e
s
s
 
m
o
d
e
l
l
i
n
g
8
 
 
 
 
 
 
 
 
Goal
: model the manufacturing process of each product.
Include eventual constraints related to production control.
 
 
 
There is 
at most
one product of
each type
loaded in the
system 
at any
time
.
A
 
t
w
o
-
p
r
o
d
u
c
t
 
s
y
s
t
e
m
R
e
s
o
u
r
c
e
 
m
o
d
e
l
l
i
n
g
9
 
 
 
 
 
 
 
 
Goal
: modelling resource contraint + eventual priority constraints
 
 
 
 
Identifies
transitions after which
the resource is first
needed
transitions after which
the resource is no longer
needed
P1
P2
M
P
l
a
c
e
s
 
a
n
d
 
t
r
a
n
s
i
t
i
o
n
s
A PETRI NET
 is a bipartite graph
which consists of two types of nodes:
places
 and 
transitions 
connected by
directed arcs.
Place = circle, transition = bar or box.
An arc connects a place to a transition
or a transition to a place.
No arcs between nodes of the same
type.
Input and output places 
of a
transition
Input and output transitions 
of a
place
 
T
o
k
e
n
 
a
n
d
 
m
a
r
k
i
n
g
s
y
s
t
e
m
 
s
t
a
t
e
Each place contains a number of 
tokens
.
The distribution of tokens in the Petri net is
called the 
marking
.
Representations of a marking:
a vector M = (m
1
, m
2
, …, m
n
) where m
i
 = nb of
tokens in place pi
a multi-set such as M = p
1
 2p
3
The marking of an PN = state of the
corresponding system. 
 
The initial state of the system = the initial
marking, denoted as M
0
.
Example: M = ( ???) = ???
11
 
S
y
s
t
e
m
 
d
y
n
a
m
i
c
s
 
b
y
 
t
r
a
n
s
i
t
i
o
n
 
f
i
r
i
n
g
A 
transition
 is said 
enabled
 (firable) if each of its input
places contains at least one token. An enabled transition can
fire.
Firing a transition 
removes a token from each input place
and add one token to each ouput place.
Firing a transition leads to a new marking that enables other
transitions.
The dynamic behavior of the corresponding system =
evolution of the marking and transition firings
Convention: 
simultaneous transition firings are forbidden
.
12
13
 
S
e
q
u
e
n
c
e
 
o
f
 
t
r
a
n
s
i
t
i
o
n
s
A sequence of transitions that can be fired consecutively starting
from the initial marking is said enabled or firable.
The sequence of firable transitions is not unique.
The set of all firable sequences of transitions = PN language
Example: sequence 
t1t2t1t3
14
 
Formal definitions
15
 
P
e
t
r
i
 
N
e
t
s
A Petri net is a five-tuple
 PN = (P, T, A, W, M
0
) where:
 
P = { p
1
, p
2
, ..., p
n
} is a finite set of places
 
T = { t
1
, t
2
, ..., t
m
 } is a finite set of transitions
 
 A 
(P×T) 
 (T×P) is a set of arcs
 
W : A 
 { 1, 2, ... } is a weight function
 
M
0
 : P 
 { 0, 1, 2, ... } is the initial marking
 
P 
T = 
 and P 
 T = 
PN without the initial marking is denoted by N:
 
N = (P, T, A, W)
 
PN = (N, M
0
)
A Petri net is said 
ordinary 
if w(a) = 1, 
a 
 A.
16
G
r
a
p
h
i
c
 
r
e
p
r
e
s
e
n
t
a
t
i
o
n
 
Similar to that of ordinary PN but with default weight of 1 when
not explicitly represented.
17
 
T
r
a
n
s
i
t
i
o
n
 
f
i
r
i
n
g
Rule 1: A 
transition
 t is 
enabled
 at a marking M if 
M (p) ≥ w(p, t)
for any p 
 
o
t where
 
o
t is the set of input places of t
Rule 2: An enabled transition may or may not fire.
Rule 3: 
Firing transition
 t results in:
removing w(p, t) tokens from each p 
 
o
t
adding w(t, p) tokens to each p 
 t
o
 where t
o
 is the set of output
places of t
M(t> M' 
denotes firing t at marking M with
 
T
r
a
n
s
i
t
i
o
n
 
f
i
r
i
n
g
19
 
B
a
s
i
c
 
c
o
n
c
e
p
t
s
Source transition
: transition without input places, i.e. 
o
t = 
.
Sink transition
: transition without output places, i.e. t
o
 = 
.
Source place
: place without input transitions, i.e. 
o
p = 
.
Sink place
: place without output transitions, i.e. p
o
 = 
.
Self-loop
: a couple (p, t) such that t is both input and output
transition of p
Path
: a sequence of nodes 
s
1
s
2
…s
n
 such that 
s
i+1
 is an output
node of 
s
i
.
Circuit
: a path such that 
s
n
 
= s
1
.
Online illustration
B
a
s
i
c
 
c
o
n
c
e
p
t
s
Source transition t5
Sink transition t10
Source place p1
Sink place p5
Self-loop
Path
Circuit
5
p1
p2
p3
p4
p5
p6
p7
p8
p9
p10
t1
t2
t3
t4
t5
t6
t7
t8
t9
t10
r1
r2
p0
I
n
c
i
d
e
n
c
e
 
m
a
t
r
i
c
e
s
Pre incidence matrix
:
Post incidence matrix
:
Incidence matrix : C = Post – Pre.
C(., t) = Token flow balance after firing t
Pre and Post define the Petri net
For Petri nets without self-loops, i.e. 
o
t
 t
o
 = 
, C defines the Petri net with
Pre(p,t) = max{0, C(p,t)} and Post(p,t) = max{0, C(p,t)}
I
n
c
i
d
e
n
c
e
 
m
a
t
r
i
c
e
s
Example
:
Pre = ???, Post = ???, C = ???
 
I
n
c
i
d
e
n
c
e
 
m
a
t
r
i
c
e
s
Enabled transition
: A transition t is enabled at a marking M if
M ≥ Pre(●, t)
Transition firing
: Firing a transition t at marking M leads to
M’ = M + C(●, t)
Sequence of transitions
: Firing a sequence 
 = t
1
t
2
…t
n
 of
transition starting from marking M leads to:
where   is the counting vector of the sequence 
. (proof) Equation
(1) is also called «
 state equation
 ».
Question
: can this equation be used to checked the feasibility of
a sequence and the reachability of a marking?
 
I
n
c
i
d
e
n
c
e
 
m
a
t
r
i
c
e
s
Example
:
Markings after 
 = t1t5t2t3t5
Observe the state equation of  
’ = t5t5t1t2t3. What conclusion?
 
Petri net models of manufacturing
systems
 
P
N
 
m
o
d
e
l
s
 
o
f
 
k
e
y
 
c
h
a
r
a
c
t
e
r
i
s
t
i
c
s
Precedence relation
:
27
 
 
Alternative processes
:
Parallel processes
:
 
Synchronization
:
P
N
 
m
o
d
e
l
s
 
o
f
 
k
e
y
 
c
h
a
r
a
c
t
e
r
i
s
t
i
c
s
Buffer of finite capacity (4)
:
28
 
 
FIFO system
:
 
 
 
 
 
P
N
 
m
o
d
e
l
s
 
o
f
 
k
e
y
 
c
h
a
r
a
c
t
e
r
i
s
t
i
c
s
29
 
 
Shared resources
:
 
 
 
 
P
N
 
m
o
d
e
l
s
 
o
f
 
k
e
y
 
c
h
a
r
a
c
t
e
r
i
s
t
i
c
s
30
 
 
Dedicated machine
:
 
 
 
 
 
 
Shared machine
:
P
N
 
m
o
d
e
l
s
 
o
f
 
k
e
y
 
c
h
a
r
a
c
t
e
r
i
s
t
i
c
s
31
 
 
Assembly operation
:
 
 
 
 
 
 
Unreliable machines
:
 
 
A
 
r
o
b
o
t
i
c
 
c
e
l
l
32
 
 
 
 
 
 
 
 
A
 
t
w
o
-
p
r
o
d
u
c
t
 
s
y
s
t
e
m
33
 
 
 
 
 
 
 
 
Two types P1 and P2 of products are produced.
The production of each product requires two operations.
The first operation is performed by a shared machine.
The second operation is performed by a dedicated machine.
There is at most one product of each type loaded in the
system at any time.
When a product finishes, a new product of the same type is
dispatched.
To be modelled using an usual process-resource
modelling approach
.
P
r
o
c
e
s
s
 
m
o
d
e
l
i
n
g
34
 
 
 
 
 
 
 
 
Goal
: model the manufacturing process of each product.
Identify all relevant operations and their precedence constraints.
Identify all possible waits for shared resources.
 
 
wait for shared machine
parts under operation 1
parts under operation 2
P
r
o
c
e
s
s
 
m
o
d
e
l
l
i
n
g
35
 
 
 
 
 
 
 
 
Goal
: model the manufacturing process of each product.
Include eventual constraints related to production control.
 
 
 
R
e
s
o
u
r
c
e
 
m
o
d
e
l
l
i
n
g
36
 
 
 
 
 
 
 
 
Goal
: modelling resource contraint.
 
 
 
 
Identifies
transitions after which
the resource is first
needed
transitions after which
the resource is no longer
needed
Elementary classes of Petri nets
37
P
u
r
e
 
P
e
t
r
i
 
n
e
t
s
Definition
: A Petri net free of self loop is said pure, i.e. 
o
t
 t
o
= 
.
Theorem : 
All impure Petri nets can be transformed into pure Petri nets.
38
 
 
Sequential
firing
O
r
d
i
n
a
r
y
 
P
e
t
r
i
 
n
e
t
s
EVENT GRAPHS (OR
MARKED GRAPHS)
Each place has exactly one input
and one output transition.
Property:
 The total number of
tokens in each elementary circuit
is constant
39
 
 
 
 
STATE MACHINES
Each transition has exactly
one input place and one
output place.
Property:
 The total number
of token is constant.
choice
synchronization
O
r
d
i
n
a
r
y
 
P
e
t
r
i
 
n
e
t
s
FREE-CHOICE NETS
card(p°) > 1 
 °(p°) = {p}, 
 p 
 P
40
 
 
 
 
 
 
 
 
EXTENDED FREE-CHOICE NETS
p1°
p2° ≠ 
 
 p1° = p2°, 
p1, p2 
 P
Can be transformed into a free-choice net.
Property: 
Conflicting transitions are either all enabled or all not enabled
.
O
r
d
i
n
a
r
y
 
P
e
t
r
i
 
n
e
t
s
ASYMMETRIC CHOICE NETS
p1°
p2° ≠ 
 
   p1° 
  p2°  or  p2° 
  p1° , 
 p1, p2 
 P
Property :
 The set {p1, p2, …, pk} of input places of any transition can be
renumbered such that p1
°
 
 p2
°
pk
°
.
41
 
 
 
 
 
 
 
 
 
p3 vs r
r used by more transitions
R
e
l
a
t
i
o
n
s
 
b
e
t
w
e
e
n
 
d
i
f
f
e
r
e
n
t
 
c
l
a
s
s
e
s
42
 
 
 
 
 
 
 
 
 
 
PN = Petri Net
AC = Assymmetric choice
EFC = Extended Free Choice
FC = Free Choice
SM = State Machine
EG = Event Graph
 
Modeling
power
Properties of PN models
43
R
e
a
c
h
a
b
i
l
i
t
y
Reachable marking
: A marking M is said reachable from another marking M’
if there exists a seqence 
 of transitions such that M’(

>M.
Reachable set
: R(M
0
) = set of markings reachable from the initial marking
M0.
Reachability is important for verification of the reachability of some desired
(proper termination) or undesired markings (deadlock).
Example: R(M0) = {(1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1)}
but (1, 0, 1, 0) not reachable.
Reachability = Petri net language
44
 
R
e
a
c
h
a
b
i
l
i
t
y
Theorem1
 (monotonicity) : Any sequence 
 of transitions firable starting
from a marking M0 is also firable starting from M0’ such that M0' ≥ M
0
.
Theorem2
 (necessary condition) : The equation system 
CY = M - M
0
with Y ≥ 0 has a solution for all reachable marking M.
Theorem3
 (Acyclic PN) : For any PN free of cycles, a marking M is
reachable iff the equation system C Y = M - M
0
 with Y ≥ 0 has a solution.
Ex: Find a PN and a marking that is not reachable but for which condition
of Theorem 2 holds.
45
 
B
o
u
n
d
e
d
n
e
s
s
A place p is said 
k-bounded
 if the number of tokens in p never exceed k,
i.e. M(p) ≤ k, 
M Œ
 R(M0).
A Petri net is said k-bounded if all places are k-bounded, i.e. M(p) ≤ k,
p and 
M Œ
 R(M0).
A Petri net is said 
bounded
 if it is k-bounded for some k > 0.
A Petri net is said 
safe
 if it is 1-bounded, M(p) ≤ 1, 
p and 
M Œ
 R(M0).
Boundedness is often needed for a well-designed system as, without this
property, goods could accumulated without limit, which is often a design
error.
46
 
B
o
u
n
d
e
d
n
e
s
s
47
 
 
 
 
B
o
u
n
d
e
d
n
e
s
s
Theorem
 (monotonicity) : If (N, M0) is bounded, then (N, M0’) such that
M0' ≤ M0  is bounded.
Theorem
 (sufficient condition) : A Petri net (N, M0) is k-bounded if
M(p) ≤ k, 
p and 
M such that M = M0 + CY for some Y ≥ 0.
48
 
L
i
v
e
n
e
s
s
A 
transition t is said live
 if it can always be made enabled starting from
any reachable marking, i.e. 
M Œ
 R(M0),  
M' Œ
 R(M) such that M‘(t>.
A 
Petri net is said live 
if all transitions are live.
A 
transition is said quasi live 
if it can be fired at least once, i.e.  
M Œ
R(M0) such that M(t>.
A 
Petri net is said quasi live
 if all transitions are quasi live.
A 
marking M is said a deadlock 
or dead marking if  no transition is
enabled at M.
A 
Petri net is said deadlock-free 
if it does not contain any deadlock.
49
 
L
i
v
e
n
e
s
s
Liveness implies the absence of total or partial deadlock 
and is
often required for well-designed systems. But the reverse is not true.
Deadlock often results from resource sharing and synchronization of
parallel processes.
No monotonicity of liveness 
as the Petri net below is not live if
M0(R1) = 0, live if M0(R1) = 1, and not live if M0(R1) = 2.
50
 
 
 
PN1
PN2
R
e
v
e
r
s
i
b
i
l
i
t
y
A Petri net (N, M0) is said 
reversible
 if the initial marking remains
reachable from any reachable marking, i.e. M0 
Œ R(M), 
M 
Œ R(M0)
A marking M* is said a 
home state 
if it is reachable from all reachable
markings, i.e. M* 
Œ R(M), 
M 
Œ R(M0) .
Existence of the reversibility ensures that the system can always recover
the normal behavior and is important for systems subject to failures.
Existence of home state is important for systems requiring proper
termination.
Reversiblity implies existence of home states but the reverse is not true.
51
 
 
 
R
e
v
e
r
s
i
b
i
l
i
t
y
52
 
 
 
 
 
Reversibility, liveness and boundedness are independent
Analysis methods
53
R
e
a
c
h
a
b
i
l
i
t
y
 
t
r
e
e
Definition
:  The reachability tree, also called marking graph, of a Petri
net (N, M0) is a graph in which
nodes corresponds to reachable markings
arcs correpond to feasible transitions.
Remark
: the reachability tree of an unbounded PN is unlimited.
 
 
 
C
o
v
e
r
a
b
i
l
i
t
y
 
t
r
e
e
Symbol "
"
 implying « as great as possible » with the following properties:
 > n, 
 ± n = 
, for all integer n and 
.
55
 
 
 
 
M1 covers M0
Repeat t1 leads  to 
 tokens in p2.
Replace M1 by [0, 
]
Step1
Step2
Step3
C
o
v
e
r
a
b
i
l
i
t
y
 
t
r
e
e
Algorithm of coverability tree 
(Self-reading)
1. Initiate the tree by a root node labeled M0 and marked as "new".
2. While there exists "new" nodes :
2.1. Select a "new" node A. Let M be its marking.
2.2. If there exists a node B with marking M on the path from the root to A,
then mark A as "old" and go to 2.
2.3. If M is a dead marking, then mark A"dead-end" and go to 2.
2.4. Otherwise, for each transition t enabled at M,
2.4.1. Add a node C, an arc from A to C with label t, mark C "new".
2.4.2. Determine the marking M’ of node C.
2.4.3. 
If, on the path from the root to node C, there exists a node D with
marking M" such that M' ≥ M"
 & M'(p) > M"(p) for some p, then M'(p) =
 for all p such that M'(p) > M"(p).
2.5. Go to 2.
56
 
 
C
o
v
e
r
a
b
i
l
i
t
y
 
t
r
e
e
Theorem
 (boundedness) :
A Petri net (N, M0) is bounded iff the symbol 

does not appear in the
coverability tree.
Theorem
 (bounded PN) : For a bounded Petri net,
it is deadlock-free iff any node of the reachability tree has a successor.
It is reversible iff the reachability tree is strongly connected.
A transition t is live iff it appears a all strongly connected components
that do not have arcs going out.
Remark
:
Liveness and reversibility of unbounded PN cannot be checked with
coverability trees.
57
 
 
 
p
-
i
n
v
a
r
i
a
n
t
s
Definition: 
A integer vector X≥0 of dimension n = |P| is a p-invariant if  X
t
 C = 0.
The set of places pi with Xi > 0 is called the support of the p-invariant and is
denoted ||X||.
A p-invariant X is said minimal if there does not exist another p-invariant X’
such that X' ≠ X and X' ≤ X.
Exampel:
58
 
 
 
 
p
-
i
n
v
a
r
i
a
n
t
s
Theorem
: X is a p-invariant iff, for all M0, X
t
 M = X
t
 M0, 
M Œ
 R(M0).
Theorem 
: Any linear combination of p-invariants is a p-invariant.
Theorem 
: All p-invariant is a non negative linear combination of minimal p-
invariants.
Remark :
 For PN models of real systems, a minimal p-invariant has clear
physical significance (resource, production control strategies, ...) and can be
derived by inspection of resources and processes.
Exampe:
59
 
 
 
 
Identification of
p-invariants by
inspection 
by
resource-oriented
decomposition
t
-
i
n
v
a
r
i
a
n
t
s
Definition: 
A integer vector Y≥0 of dimension m = |T| is a t-invariant if  CY = 0.
The set of transitions ti with Yi > 0 is called the support of the t-invariant
and is denoted ||Y||.
A t-invariant Y is said minimal if there does not exist another t-invariant Y’
such that Y' ≠ Y and Y' ≤ Y.
Exampel:
60
 
 
 
 
t
-
i
n
v
a
r
i
a
n
t
s
Theorem
: Let s be a sequence of transitions tranforming M0 into M and Y its
counting vector. Then M = M0 iffY is an t-invariant.
Theorem 
: Any linear combination of t-invariants is a t-invariant.
Theorem 
: All t-invariant is a non negative linear combination of minimal t-
invariants.
Remark :
 In general, a minimal t-invariant corresponds to a process that can
be repeat for ever. They can be identified by neglecting resources.
Exampe:
61
 
 
 
 
Identification of p-
invariants by
inspection 
by
removing resource
constraints
D
e
t
e
r
m
i
n
a
t
i
o
n
 
o
f
 
p
-
 
a
n
d
 
t
-
i
n
v
a
r
i
a
n
t
s
(
o
p
t
i
o
n
a
l
)
62
 
 
 
 
 
Algorithm of minimal p-invariants
1. Set A = I
n×n
 with n = |P| and B = C (incidence matrix). Construct matrix [A | B].
2. For each transition tj:
2.1. Add to [A | B] non negative linear combination of any two lines that zeros
the entry of column tj
2.2. Remove in the matrix [A | B] all lines i such that the entry (i, j) is not zero.
3. p-invariants correspond to lines of matrix A.
The algorithm of t-invariants is similar with C replaced by C
T
.
 
S
i
p
h
o
n
s
 
a
n
d
 
t
r
a
p
s
A siphon
 is a subset of places such that any input transition of a place is
an output transition of some other place.
A trap
 is a subset of places such that any ouput transition of a place is an
input transition of some other place.
63
 
 
 
S
i
p
h
o
n
s
 
a
n
d
 
t
r
a
p
s
Theorem: 
For any ordinary PN,
A siphon free of tokens at a marking remains token-free
A trap marked by a marking remains marked
The empty places of a dead marking form a siphon for any marking such
that no transition is enabled.
A Petri net is deadlock-free if no siphon eventually becomes empty.
64
 
 
 
S
i
p
h
o
n
s
 
a
n
d
 
t
r
a
p
s
Theorem
: 
A connected event graph 
(N, M0) is live iff every circuit contains a
token. A live event graph is reversible. A connex event graph is bounded iff it is
strongly connected.
Theorem
: 
A connected state machine 
is always bounded. It is live and reversible
iff it is strongly connected.
Theorem 
: 
A free-choice (extended or not) (N, M0) 
is live iff all siphon contains
a trap marked at M0.
Theorem 
: 
An assymetric net (N, M0) is live 
iff no siphon can become unmarked.
Remarks
:
Whether all siphons remain marked can be checked by integer programming.
For usual manufacturing systems, both liveness and reversibility are ensured if no
siphon can become unmarked
65
 
 
 
S
i
p
h
o
n
s
 
a
n
d
 
t
r
a
p
s
Without R2, a live event graph -> R2 is involved in all
deadlocks
Siphons :
R2 p3 p1 *** (contains a p-invariant & cannot ne unmarked)
R2 p3 R3 (all other problematic siphons contain this siphon
66
 
 
 
p1
p2
t1
t2
t3
t4
S
i
p
h
o
n
s
 
a
n
d
 
t
r
a
p
s
Live as it is an AC net and
any siphon contain a trap
marked at M0
67
 
 
 
 
 
 
{R2, R3, p3} = siphon that can be
unmarked
The AC net is life iff n
1
 < n
2
+n
3
.
Siphons to care:
Minimal
siphons that are
not traps
S
i
p
h
o
n
s
 
a
n
d
 
t
r
a
p
s
o
p
t
i
o
n
a
l
Theorem
: A Petri net (N, M
0
) is deadlock-free if  G = 0 where
 
G = max  ∑
p
ŒP
 u
p
such that
- S is a siphon, i.e.
 
z
t
 ≤ ∑
p
Υt
 u
p
, 
t Œ
 T
 
u
p
 ≤ z
t
, 
 t, p / t 
Œ •p
 
u
p
 , z
t
 Œ 
{0, 1}
- S can become unmarked:
 
1{M(p)} + u
p
  ≤ 1
 , 
p
 Œ
 P 
 
(NL)
 
M = M
0
 + CY 
 
M ≥ 0, Y ≥ 0.
The nonlinear constraint (NL) can be replaced by
(NL)   <=>   M(p) / SB(p) + u
p
  ≤ 1
where SB(p) is the upper bound of the marking of place p.
 
 
 
 
S
t
r
u
c
t
u
r
a
l
 
p
r
o
p
e
r
t
i
e
s
 STRUCTURAL BOUNDEDNESS
A Petri net N is 
structurally bounded
 if it is bounded starting from any M0.
Criterion :
 N is structurally bounded 
 
 
X
 > 0, 
X
T
C
 ≤ 0.
Theorem: (N, M0) is bounded if it is structurally bounded.
CONSERVATIVENESS
A Petri net N is 
conservative
 if there exists a vector 
X
 > 0 associated with
places such that 
X
T
M
 = 
X
T
M0
, 
M0, 
M 
R(M0).
Criterion :
 N is conservative 
 
 
X
 > 0, 
X
T
C
 = 0.
 
Theorem:
(N, M0) is bounded if it is conservative.
A Petri net is conservative if all places are covered by some p-invariant.
69
 
 
 
 
S
t
r
u
c
t
u
r
a
l
 
p
r
o
p
e
r
t
i
e
s
 
REPETITIVENESS
A Petri net N is 
repetitive
 if there exists M0 and a feasible firing sequence
such that each transition appears infinitely often. 
Criterion :
 N is repetitive 
 
 
Y
 > 0, 
CY
 ≥ 0.
Theorem: A live Petri net (N, M0) is repetitive.
CONSISTENCY
A Petri net N is 
consistent
 if there exist an initial marking M0 and a firing
sequence 
 such that > 0 and M0 [
 >M0.
Criterion :
 N is consistent 
 
 
Y
 > 0, 
CY
 = 0.
Theorem :
A live Petri net (N, M0) with a home state is consistent.
A live and bounded Petri net (N, M0) is consistent. It is also conservative if
it is live and structurally bounded.
70
 
 
 
 
S
t
r
u
c
t
u
r
a
l
 
p
r
o
p
e
r
t
i
e
s
71
 
 
 
 
 
In practice, boundedness reduces to
conservativeness.
Consistency and conservativeness
provide necessary conditions for
liveness and resersibility.
Unfortunately, liveness and
resersibility remain difficult to
check.
T
o
p
i
c
s
 
n
o
t
 
a
d
d
r
e
s
s
e
d
 
i
n
 
C
h
a
p
t
e
r
s
 
2
-
3
72
 
 
 
 
 
Supervisory control with automata theory
Timed Petri nets
Color Petri nets
Petri net controls
Petri net models synthesis
Slide Note
Embed
Share

Introduction to Petri nets and their application in modeling manufacturing systems. Covers formal definitions, elementary classes, properties, and analysis methods of Petri net models. Explores a two-product system example and its process modeling with shared and dedicated resources.

  • Petri Nets
  • Manufacturing Systems
  • Process Modeling
  • Dynamic Behavior
  • Shared Resources

Uploaded on Aug 25, 2024 | 1 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Chapter 3 Petri nets Learning objectives : Introduce Petri nets Dynamic behavior modeling of manufacturing systems using PN Analysis of Petri net models Textbook : J.-M. Proth and X. Xie, Petri nets: a tool for design and management of manufacturing systems, John Wiley & Sons, 1996 C. Cassandras and S. Lafortune, Introduction to Discrete Event Systems, Springer, 2007 1

  2. Plan Introduction to Petri nets Formal definitions Petri net models of manufacturing system Elementary classes of Petri nets Properties of PN models Analysis methods 2 2

  3. Introduction to Petri nets 3 3

  4. A two-product system Two types P1 and P2 of products are produced. The production of each product requires two operations. The first operation is performed by a shared machine. The second operation is performed by a dedicated machine. There is at most one product of each type loaded in the system at any time. When a product finishes, a new product of the same type is dispatched. To be modelled using an usual process-resource modelling approach. 4

  5. A two-product system Process modeling Goal: model the manufacturing process of each product, i.e. all possible states of a product including waiting Identify all relevant operations and their precedence constraints. Identify all possible waits for shared resources. 5

  6. A two-product system Process : P1, P2 Resource : M (shared machine) Dedicated machines are not restrictive resources here (Why) Process steps : Step 0 1 2 Meaning Ready and wait for M Operation on M Operation on dedicated machine 1 Res. Requirement P1 M - Step 0 1 2 Meaning Ready and wait for M Operation on M Operation on dedicated machine 2 Res. Requirement P2 M - 6

  7. A two-product system Process modeling Associate each process a state-transition graph. wait for shared machine p1 p4 t1 t4 parts under operation 1 p2 p5 t2 t5 parts under operation 2 p3 p6 t3 t6 7

  8. A two-product system Process modelling Goal: model the manufacturing process of each product. Include eventual constraints related to production control. There is at most one product of each type loaded in the system at any time. p1 p4 t1 t4 p2 p5 t2 t5 p3 p6 t3 t6 8

  9. A two-product system Resource modelling Goal: modelling resource contraint + eventual priority constraints Identifies p1 p4 t1 t4 p7 transitions after which the resource is first needed p2 p5 M t2 t5 p3 p6 transitions after which the resource is no longer needed t3 t6 P2 P1 9

  10. Places and transitions A PETRI NET is a bipartite graph which consists of two types of nodes: places and transitions connected by directed arcs. Place = circle, transition = bar or box. t4 p2 t2 p4 An arc connects a place to a transition or a transition to a place. p1 p3 t1 t3 No arcs between nodes of the same type. p5 t5 Input and output places of a transition Input and output transitions of a place

  11. Token and marking system state Each place contains a number of tokens. The distribution of tokens in the Petri net is called the marking. Representations of a marking: a vector M = (m1, m2, , mn) where mi = nb of tokens in place pi a multi-set such as M = p1 2p3 The marking of an PN = state of the corresponding system. t4 p2 t2 p4 p1 The initial state of the system = the initial marking, denoted as M0. p3 t1 t3 p5 t5 Example: M = ( ???) = ??? 11

  12. System dynamics by transition firing A transition is said enabled (firable) if each of its input places contains at least one token. An enabled transition can fire. Firing a transition removes a token from each input place and add one token to each ouput place. Firing a transition leads to a new marking that enables other transitions. The dynamic behavior of the corresponding system = evolution of the marking and transition firings Convention: simultaneous transition firings are forbidden. 12

  13. 13

  14. Sequence of transitions A sequence of transitions that can be fired consecutively starting from the initial marking is said enabled or firable. The sequence of firable transitions is not unique. The set of all firable sequences of transitions = PN language Example: sequence t1t2t1t3 t4 p2 t2 p4 p1 p3 t1 t3 p5 t5 14

  15. Formal definitions 15

  16. Petri Nets A Petri net is a five-tuple PN = (P, T, A, W, M0) where: P = { p1, p2, ..., pn} is a finite set of places T = { t1, t2, ..., tm } is a finite set of transitions A (P T) (T P) is a set of arcs W : A { 1, 2, ... } is a weight function M0 : P { 0, 1, 2, ... } is the initial marking P T = and P T = PN without the initial marking is denoted by N: N = (P, T, A, W) PN = (N, M0) A Petri net is said ordinary if w(a) = 1, a A. 16

  17. Graphic representation Similar to that of ordinary PN but with default weight of 1 when not explicitly represented. t4 p2 t2 p4 p1 2 p3 t1 t3 p5 t5 17

  18. Transition firing Rule 1: A transition t is enabled at a marking M if M (p) w(p, t) for any p ot whereot is the set of input places of t Rule 2: An enabled transition may or may not fire. Rule 3: Firing transition t results in: removing w(p, t) tokens from each p ot adding w(t, p) tokens to each p to where to is the set of output places of t M(t> M' denotes firing t at marking M with M p ( ), M p ( )+ W t,p M p ( ) W p,t M p ( )+ W t,p si (p,t) A et (t,p) A, si (p,t) A et (t,p) A, si (p,t) A et (t,p) A, si (p,t) A et (t,p) A, ( ( ( ), ), ) W p,t M' p ( )= ( ),

  19. Transition firing 2 2 2 2 2 2 2 2 19

  20. Basic concepts Source transition: transition without input places, i.e. ot = . Sink transition: transition without output places, i.e. to= . Source place: place without input transitions, i.e. op = . Sink place: place without output transitions, i.e. po= . Self-loop: a couple (p, t) such that t is both input and output transition of p Path: a sequence of nodes s1s2 snsuch that si+1is an output node of si. Circuit: a path such that sn= s1. Online illustration

  21. Basic concepts t5 p1 5 Source transition t5 p6 p0 Sink transition t10 t1 t6 Source place p1 p2 p7 Sink place p5 t2 t7 r2 r1 p3 p8 Self-loop t3 t8 Path p4 p9 Circuit t4 t9 p5 p10 t10

  22. Incidence matrices Pre incidence matrix: ( ) , , if w p t p t ( ) = Pre , p t 0, otherwise Post incidence matrix: ( ) , , if w t p p t ( ) = Post , p t 0, otherwise Incidence matrix : C = Post Pre. C(., t) = Token flow balance after firing t Pre and Post define the Petri net For Petri nets without self-loops, i.e. ot to= , C defines the Petri net with Pre(p,t) = max{0, C(p,t)} and Post(p,t) = max{0, C(p,t)}

  23. Incidence matrices Example: Pre = ???, Post = ???, C = ??? t4 p2 t2 p4 p1 2 p3 t1 t3 p5 t5

  24. Incidence matrices Enabled transition: A transition t is enabled at a marking M if M Pre( , t) Transition firing: Firing a transition t at marking M leads to M = M + C( , t) Sequence of transitions: Firing a sequence = t1t2 tn of transition starting from marking M leads to: ' M M C = + (1) where is the counting vector of the sequence . (proof) Equation (1) is also called state equation . Question: can this equation be used to checked the feasibility of a sequence and the reachability of a marking?

  25. Incidence matrices Example: Markings after = t1t5t2t3t5 t4 p2 t2 p4 p1 2 p3 t1 t3 p5 t5 Observe the state equation of = t5t5t1t2t3. What conclusion?

  26. Petri net models of manufacturing systems

  27. PN models of key characteristics Parallel processes: Precedence relation: parallel process End Start start Activity2 End Activity1 Alternative processes: Synchronization: Alternattive process Waiting Sync Start End 27

  28. PN models of key characteristics Buffer of finite capacity (4): pv Part arrival Part request pb FIFO system: 28

  29. PN models of key characteristics Shared resources: Process with Resource Other Activities Waiting for Resource p1 r p2 29

  30. PN models of key characteristics Shared machine: Dedicated machine: 30

  31. PN models of key characteristics Unreliable machines: Assembly operation: pf output buffer capacity n1 Input buffer pw n2 pb pr 31

  32. A robotic cell I Z1 M1 t1 M1 P1 S t2 Robot Unload M2 T Stock R n Q load t3 P2 t4 M2 Z2 32 O

  33. A two-product system Two types P1 and P2 of products are produced. The production of each product requires two operations. The first operation is performed by a shared machine. The second operation is performed by a dedicated machine. There is at most one product of each type loaded in the system at any time. When a product finishes, a new product of the same type is dispatched. To be modelled using an usual process-resource modelling approach. 33

  34. Process modeling Goal: model the manufacturing process of each product. Identify all relevant operations and their precedence constraints. Identify all possible waits for shared resources. wait for shared machine p1 p4 t1 t4 parts under operation 1 p2 p5 t2 t5 parts under operation 2 p3 p6 t3 t6 34

  35. Process modelling Goal: model the manufacturing process of each product. Include eventual constraints related to production control. p1 p4 t1 t4 p2 p5 t2 t5 p3 p6 t3 t6 35

  36. Resource modelling Goal: modelling resource contraint. Identifies p1 p4 t1 t4 p7 transitions after which the resource is first needed p2 p5 t2 t5 p3 p6 transitions after which the resource is no longer needed t3 t6 36

  37. Elementary classes of Petri nets 37

  38. Pure Petri nets Definition: A Petri net free of self loop is said pure, i.e. ot to = . Theorem : All impure Petri nets can be transformed into pure Petri nets. p1 p1 b1 t1 e1 Sequential firing p0 p2 p2 b2 t2 e2 38

  39. Ordinary Petri nets EVENT GRAPHS (OR MARKED GRAPHS) Each place has exactly one input and one output transition. STATE MACHINES Each transition has exactly one input place and one output place. Property: The total number of tokens in each elementary circuit is constant Property: The total number of token is constant. choice p1 t2 t1 synchronization t3 p3 t4 p2 39

  40. Ordinary Petri nets FREE-CHOICE NETS card(p ) > 1 (p ) = {p}, p P EXTENDED FREE-CHOICE NETS p1 p2 p1 = p2 , p1, p2 P Can be transformed into a free-choice net. Property: Conflicting transitions are either all enabled or all not enabled. 40

  41. Ordinary Petri nets ASYMMETRIC CHOICE NETS p1 p2 p1 p2 or p2 p1 , p1, p2 P Property : The set {p1, p2, , pk} of input places of any transition can be renumbered such that p1 p2 pk . p1 p3 p3 vs r r used by more transitions r p2 41

  42. Relations between different classes PN = Petri Net AC = Assymmetric choice EFC = Extended Free Choice FC = Free Choice SM = State Machine EG = Event Graph FC PN EG SM AC EFC Ord. PN Conflict asym. choice SM AC Modeling power noEG noEFC sync. para. Confusion EG PN noSM Symmet. Choice noAC EFC 42 noFC

  43. Properties of PN models 43

  44. Reachability Reachable marking: A marking M is said reachable from another marking M if there exists a seqence of transitions such that M ( >M. Reachable set: R(M0) = set of markings reachable from the initial marking M0. Reachability is important for verification of the reachability of some desired (proper termination) or undesired markings (deadlock). Example: R(M0) = {(1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1)} but (1, 0, 1, 0) not reachable. p1 : t1 p2 t3 Reachability = Petri net language t2 p3 t4 t5 44 p4

  45. Reachability Theorem1 (monotonicity) : Any sequence of transitions firable starting from a marking M0 is also firable starting from M0 such that M0' M0. Theorem2 (necessary condition) : The equation system CY = M - M0 with Y 0 has a solution for all reachable marking M. Theorem3 (Acyclic PN) : For any PN free of cycles, a marking M is reachable iff the equation system C Y = M - M0with Y 0 has a solution. Ex: Find a PN and a marking that is not reachable but for which condition of Theorem 2 holds. 45

  46. Boundedness A place p is said k-bounded if the number of tokens in p never exceed k, i.e. M(p) k, M R(M0). A Petri net is said k-bounded if all places are k-bounded, i.e. M(p) k, p and M R(M0). A Petri net is said bounded if it is k-bounded for some k > 0. A Petri net is said safe if it is 1-bounded, M(p) 1, p and M R(M0). Boundedness is often needed for a well-designed system as, without this property, goods could accumulated without limit, which is often a design error. 46

  47. Boundedness p p p' 47

  48. Boundedness Theorem (monotonicity) : If (N, M0) is bounded, then (N, M0 ) such that M0' M0 is bounded. Theorem (sufficient condition) : A Petri net (N, M0) is k-bounded if M(p) k, p and M such that M = M0 + CY for some Y 0. 48

  49. Liveness A transition t is said live if it can always be made enabled starting from any reachable marking, i.e. M R(M0), M' R(M) such that M (t>. A Petri net is said live if all transitions are live. A transition is said quasi live if it can be fired at least once, i.e. M R(M0) such that M(t>. A Petri net is said quasi live if all transitions are quasi live. A marking M is said a deadlock or dead marking if no transition is enabled at M. A Petri net is said deadlock-free if it does not contain any deadlock. 49

  50. Liveness Liveness implies the absence of total or partial deadlock and is often required for well-designed systems. But the reverse is not true. Deadlock often results from resource sharing and synchronization of parallel processes. No monotonicity of liveness as the Petri net below is not live if M0(R1) = 0, live if M0(R1) = 1, and not live if M0(R1) = 2. S1 S2 R1 S1 S2 R1 PN1 R3 PN2 R3 R2 R2 50

Related


More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#