Академический Документы
Профессиональный Документы
Культура Документы
TGS-AAU- Modeling of
ManufSystems
Petri Nets-Introduction
Petri Nets: Graphical and Mathematical
modeling tools
◦ graphical tool
visual communication aid
◦ mathematical tool
state equations, algebraic equations, etc
concurrent, asynchronous, distributed,
parallel, nondeterministic and/or stochastic
systems
TGS-AAU- Modeling of
ManufSystems
Petri Nets- Informal Definition
• The graphical presentation of a Petri net is a
bipartite graph
• There are two kinds of nodes
– Places: usually model resources or partial
state of the system
– Transitions: model state transition and
synchronization
• Arcs are directed and always connect
nodes of different types
TGS-AAU- Modeling of
ManufSystems
Petri Nets-History
1962: Adams. Petri’s dissertation (U. Darmstadt, W. Germany)
1970: Conf. on Concurrent Systems and Parallel Computation
(MIT, USA)
1975: Conf. on Petri Nets and related Methods (MIT, USA)
1979: Course on General Net Theory of Processes and
Systems (Hamburg, W. Germany)
1980: First European Workshop on Applications and Theory of
Petri Nets (Strasbourg, France)
1985: First International Workshop on Timed Petri Nets
(Torino, Italy)
TGS-AAU- Modeling of
ManufSystems
Petri Nets- State
In order to represent the dynamic behavior of the
modeled system, each place may hold either none
or a positive number of tokens, pictured by small
solid dots
A token in a place can indicate whether a condition
associated with this place is true or false, therefore
the state of the system is modeled by marking the
places with tokens
The distribution of tokens on places called PN
marking, defines the current state of the modeled
system. A PN containing tokens is called a marked
TGS-AAU- Modeling of
ManufSystems
Petri Nets - Basics
•Basics of Petri Nets
•Petri net consist two types of nodes:
p1 p2
TGS-AAU- Modeling of
ManufSystems
Petri Nets - Basics
The graphical representation of a Place-Transition net comprises
the following components:
TGS-AAU- Modeling of
ManufSystems
Petri Nets -Definitions
A black-and-white Petri net or ordinary PN can be formally
defined as a four-tuple1: PN = (P, T, I, O) where:
TGS-AAU- Modeling of
ManufSystems
Petri Nets -Definitions
Places (p):
◦ a place is an input to a transition if there is a directed arc connecting this
place to a transition.
◦ Input places may represent the availability of resources, the transition
may represent their utilization,
◦ A place is an output to a transition if there is a directed arc connecting the
transition to the place
◦ Output places may represent the release of resources
Transitions (t):
Directed arcs connecting places to transitions and transitions
to places
TGS-AAU- Modeling of
ManufSystems
Petri Nets -Definitions
TGS-AAU- Modeling of
ManufSystems
An example
.
TGS-AAU- Modeling of
ManufSystems
Multiple arcs
.
TGS-AAU- Modeling of
ManufSystems
Enabling and Firing rule
• A transition t is called enabled in a certain
marking, if:
– For every arc from a place p to t, there exists a
distinct token in the marking
• An enabled transition can fire and result in a
new marking
• Firing of a transition tin a marking is an
atomic operation
TGS-AAU- Modeling of
ManufSystems
•
• p1 p2
•state transition of form (1, 0) (0, 1)
•p
1 : input place p2: output place
TGS-AAU- Modeling of
ManufSystems
Enabling and Firing rule (cont.)
• Firing a transition results in two things:
1. Subtracting one token from the marking of any
place p for every arc connecting p to t
2. Adding one token to the marking of any place p
for every arc connecting t to p
TGS-AAU- Modeling of
ManufSystems
Enabling and firing rules (example)
The enabling and firing rule are illustrated further in the
figure below. In Fig a, transition t1 is enabled as the input
place p1 of transition t1 contains two tokens, and I
(p1,t1)=2.
The firing of the enabled transition t1 removes from the input
place p1 two tokens as I (p1,t1)=2, and deposits one token in
the output place p3, O(p3,t1)=1, and two tokens in the
output place p2, O(p2,t1)=2.
TGS-AAU- Modeling of
ManufSystems
Enabling and firing rules (example)
The following rules are used to govern the flow of tokens in a
Petri net:
Enabling Rule: A transition, t, is enabled if and only if all
the input places of transition t contains at least one
token.
Firing Rule: An enabled transition t may fire at marking
Mo. Firing an enabled transition t removes one token from
each input place of t and adds one token to each output
place of t.
TGS-AAU- Modeling of
ManufSystems
Enabling and firing rules (example)
Using this notation, Petri nets can model discrete event systems
and can capture important system characteristics that occurs
in a sequence, actions that occur concurrently, actions that
compete for resources, actions that must be synchronized,
actions that occur in cycles, and actions that cannot occur
simultaneously.
TGS-AAU- Modeling of
ManufSystems
example
.
TGS-AAU- Modeling of
ManufSystems
More about Petri Nets
p
. 1
.
1
t p t p
t
2 1 1 1
1 p t
2
TGS-AAU- Modeling of
ManufSystems
System State: Tokens and Net Marking
p
1
1
t p t p
t
2 1 1 1
1 p t
2
TGS-AAU- Modeling of
ManufSystems
Initial State: (1,1,2,1)
p
1
1
t p t p
t
2 1 1 1
1 p t
2
t2 is enabled
TGS-AAU- Modeling of
ManufSystems
Fire t2, New State: (1,0,3,2)
p
1
1
t p t p
t
2 1 1 1
1 p t
2
TGS-AAU- Modeling of
ManufSystems
Fire t3, New State: (2,0,2,2)
p
1
1
t p t p
t
2 1 1 1
1 p t
2
TGS-AAU- Modeling of
ManufSystems
Fire t1, New State: (1,2,2,2)
p
1
1
t p t p
t
2 1 1 1
1 p t
2
TGS-AAU- Modeling of
ManufSystems
Fire t4, New State: (1,3,2,0)
p
1
1
t p t p
t
2 1 1 1
1 p t
2
TGS-AAU- Modeling of
ManufSystems
In the context of DES
TGS-AAU- Modeling of
ManufSystems
Notation…
A Petri net is a 5-tuple , where
S is a set of places
T is a set of transitions
F is a set of arcs s.t.
M0 is an initial marking
TGS-AAU- Modeling of
ManufSystems
…allows for many things
The state of a net is an M vector so
TGS-AAU- Modeling of
ManufSystems
p
. 1
t p t p t
1
2 1 1 1
1 p t
2
W S={p1,p2,p3,p4}
T={t1,t2,t3,t4}
F={(p1,t1) (p2,t2) (p3,t3)
(p4,t4) (t1,p2)(t2,p3)(t2 p4)
(t3,p1) (t4,p2)}
M0 Initial state (1,1,2,1)
σ Firing sequence (t2 t3 t1 t4)
Mn Final state (1,3,2,0)
TGS-AAU- Modeling of
ManufSystems
Enabling and firing rules -Inhibitor arc
The modeling 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 transition, and is
pictorially represented by an arc terminated with a small
circle.
TGS-AAU- Modeling of
ManufSystems
Properties of Petri nets
Representational Power of Petri nets
PNs exhibited suitable for modeling activities such as
concurrency, decision making, synchronization and
priorities are modeled very effectively with Petri nets.
TGS-AAU- Modeling of
ManufSystems
•Properties of Petri Nets
•Sequential Execution
Transition t1 will be
enabled only when a token
there are at least one
token at each of its input
places.
Merging
•
Concurrency
•
•
TGS-AAU- Modeling of
ManufSystems
• Properties of Petri Nets -continued
•
• Conflict
t1 and t2 are both ready to
fire but the firing of any
leads to the disabling of the
other transitions.
TGS-AAU- Modeling of
ManufSystems
• Properties of Petri Nets -continued
•
• Conflict - continued
t t
1 2
TGS-AAU- Modeling of
t t ManufSystems
Sequential actions, Dependency
TGS-AAU- Modeling of
ManufSystems
Conflict resolution, concurrency
TGS-AAU- Modeling of
ManufSystems
Cycles
TGS-AAU- Modeling of
ManufSystems
synchronization
TGS-AAU- Modeling of
ManufSystems
Buffer (Queue)
TGS-AAU- Modeling of
ManufSystems
Communication
TGS-AAU- Modeling of
ManufSystems
Behavioral Properties of PN
State Machines
A state machine is a PN in which each transition has
exactly one input and one output place. This can be
concisely expressed as ;
TGS-AAU- Modeling of
ManufSystems
Behavioral Properties of PN
Properties of Petri Nets
Reachability.
From the model point of view, this property determines whether a
given (vector) marking is reachable from the initial marking. From
the real system point of view, this property indicates whether a
system state is reachable from the initial configuration.
TGS-AAU- Modeling of
ManufSystems
Behavioral Properties of PN
Reachability
Reacahability is a fundamental basis for studying the dynamic
properties of any system. The firing of an enabled transition will
change the token distribution (marking).
A sequence of firing will result in a sequence of markings. A
marking Mn is said to be reachable from a marking Mo if
there exists a sequence of firings that transforms Mo to
Mn.
TGS-AAU- Modeling of
ManufSystems
Behavioral Properties of PN
Boundedness
A PN (n, Mo) is said to be k-bounded or simply boundedif
the number of tokens in each place does not exceed a finite
number k for any marking reachable from Mo, i.e., M(P)≤k for
every place p and every marking M Є(Mo).
A PN (N, Mo) is said to be safe if is 1-bounded.
TGS-AAU- Modeling of
ManufSystems
Petri Nets-Properties
Reversibility
TGS-AAU- Modeling of
ManufSystems
Petri Nets – Properties
Thus deadlock-freeness cannot be strong enough for highly
automated systems; liveness is a stronger property. A
Petri net system is said to be live if for each reachable
marking it is always possible to fire any transition.
Thus the processing of the part can be finished. This also means
that if there are always new raw materials, their
processing can be carried out.
TGS-AAU- Modeling of
ManufSystems
Behavioral Properties of PN
Liveness
The concept of liveness is closely related to the
complete absence of deadlocks in operating systems.
A PN (N,Mo) is said to be live (or equivalently Mo is said
to be a live marking for N), if no matter what marking
has been reached from Mo, it is possible to ultimately
fire any transition of the net by progressing through
some further firing sequence.
This means that a live PN guarantees deadlock-free operation,
no matter what firing sequence is chosen(eg figure 6)
TGS-AAU- Modeling of
ManufSystems
Petri Nets-Properties
TGS-AAU- Modeling of
ManufSystems
Timed Petri Nets
Original model of Petri Net was timeless. Time was not
explicitly considered since
TGS-AAU- Modeling of
ManufSystems
Time in Petri Net -continued
Even though there are arguments against the
introduction of time, there are several applications
that require notion of time.
TGS-AAU- Modeling of
ManufSystems
Timed Petri Net - Overview
General approach:
◦ Transition is associated with a time for
which no event/firing of a token can occur
until this delay time has elapsed.
TGS-AAU- Modeling of
ManufSystems
Petri Nets - SPN
Due to this nature of transition firing, Timed Petri Nets are
grouped into
TGS-AAU- Modeling of
ManufSystems
Petri Nets - SPN
Deterministic Timed Petri Nets (DTPNs)
When a choice is involved in such a system and the system is
allowed to make a choice freely, and then its behavior
becomes non-deterministic.
TGS-AAU- Modeling of
ManufSystems
Petri Nets - SPN
Deterministic Timed Petri nets are a class of timed Petri nets
where a constant delay is augmented to the transitions of
the net. Then a DTPN is defined as,
N = (P, T, E, W, H, D) where,
TGS-AAU- Modeling of
ManufSystems
Petri Nets - SPN
Stochastic Petri Nets
Classical Petri nets are useful in investigating qualitative or
logical properties of concurrent systems, such as mutual
exclusion, existence and absence of deadlocks, boundedness and
fairness. However for quantitative evaluation the concept of
time needs to be incorporated in to the definition.
TGS-AAU- Modeling of
ManufSystems
Petri Nets - SPN
A stochastic Petri net (SPN) is essentially a high level model
that generates a stochastic process.
TGS-AAU- Modeling of
ManufSystems
Petri Nets
As a modeling tool SPNs offer several advantages:
TGS-AAU- Modeling of
ManufSystems
Petri Nets - SPN
As a method of representation SPNs are very powerful, on a par
with Markov chain models. They suffer on the other hand on
the computational front as they suffer from state space
explosions.
Definition:
A Stochastic Petri Net is a six-tuple (P, T, I, O, M, F)
where (P, T, I, O, M) is a petri net and F is a function, which
associates with each transition in each reachable
marking, a random variable. This is a very general definition
of a stochastic Petri net.
TGS-AAU- Modeling of
ManufSystems
Petri Nets-CPN
Colored Petri nets
TGS-AAU- Modeling of
ManufSystems
Petri Nets-CPN
Programming languages can be used to define data
types and manipulation of data.
TGS-AAU- Modeling of
ManufSystems
Petri Nets application in Manufacturing
Systems
Petri net model is a network of interconnecting resources and
actions representing a real system.
By modelling manufacturing systems, performance analysis
can be performed to help the operations manager to
plan resources, schedule jobs and predict overall
throughput rate and system capacity.
The resulting parameters can be recorded and compared to
form measures of the operations’ efficiency and
effectiveness.
This assists managers to quantify system performance,
as opposed to pure judgement, which is subjective
and difficult to compare.
Petri net also serves as a communication aid to both
higher management and people on the shop floor, showing
the abstract aspects of work cells coordination and resource
cycles graphically.
TGS-AAU- Modeling of
ManufSystems
Petri Nets application in Manufacturing
Systems
The hierarchical nature of Petri net enables it to manage,
display and analyse large and small models in
different scales and levels of detail.
TGS-AAU- Modeling of
ManufSystems
Petri Nets application in Manufacturing
Systems
Petri net is one of various analytical tools to solve these
issues.
TGS-AAU- Modeling of
ManufSystems
Petri Nets application in Manufacturing
Systems
Manufacturing processes often occur in parallel, such as
multiple assembly lines and these concurrent
operations can be modelled by drawing separate
chains of place and transition in the graph.
TGS-AAU- Modeling of
ManufSystems
Petri Nets -example
Input Places Transition Output Places
Preconditions Event Post conditions
Input data Computation Step Output data
Input signals Signal Processor Output Signals
Resources needed Task or Job Resources released
Conditions Clause in Logic Conclusions
Buffers Processor Buffers
TGS-AAU- Modeling of
ManufSystems
Petri Nets –example-1
Places/Transitions Description
P1 Raw material available
p2 Robot Available
p3 Milling machine (WS1) is available
p4 WS1 loaded with raw material by robot
P5 Milling operation performed on raw material
p6 Semi-finished part loaded on WS2 by robot
p7 Drilling operation performed on the part
p8 Drilling machine (WS2) available
p9 Out going conveyor loaded by robot
t1 Starting to load WS1
t2 Initiation of milling operation
t3 Termination of milling operation
t4 Initiation of drilling operation
t5 Termination of drilling operation
t6 Completion of action in p9
TGS-AAU- Modeling of
ManufSystems
Petri Nets –example-1
.
TGS-AAU- Modeling of
ManufSystems
Petri Nets –example-1
.
TGS-AAU- Modeling of
ManufSystems
Petri Nets –example-2
TGS-AAU- Modeling of
ManufSystems
Petri Nets –example-2
TGS-AAU- Modeling of
ManufSystems
Petri Nets –example-3 (FMC)
A Flexible Assembly cell
Consider the assembly cell shown in the figure below . A
conveyor and two neighborhooding robots are needed to carry
out an assembly task. Each conveyor (C) requests the left robot
(R) first, and after acquiring it, requests the right one. Then the
assembly operation starts. When the task is completed, the
conveyor releases both robots.
Robot Robot
1 Conveyor 2
1
Conveyor
Conveyor 2 3
Robot
3
A flexible assembly
TGS-AAU- Modeling of
cell ManufSystems
Petri Nets –example-3 (FMC)
Requesting and releasing a robot are two events that can occur
concurrently and asynchronously. For eg, the three conveyors could
simultaneously request their left robots (concurrently). Also there is
a release of two allocated robots occur when the assembly task is
over but the time of this event cannot be accurately predicted due
to possible delays or errors (asynchronously). The petrinet model
must capture the concurrent and asynchronous behavior of the
system. For the above shown assembly cell;
TGS-AAU- Modeling of
ManufSystems
Petri Nets –example-3 (FMC)
P10 the robot R1
P11 the robot R2
P12 the robot R3
TGS-AAU- Modeling of
ManufSystems
Petri Nets –example-3 (FMC)
At the start of the assembly task, all conveyors and robots are
free, and the three conveyors are concurrently requesting their
left robots,. This produces the initial marking
Mo =(1 0 0 1 0 0 1 0 1 1 1)T
The initial marking has enabled transitions t1, t2 and t7. If these
transtions are allowed to fire concurrently, the new marking will
be
M’ = (o 1 0 0 1 0 0 1 0 0 0 0 ) T
TGS-AAU- Modeling of
ManufSystems