Title: Petri Net
1Lecture 9
- Petri Net
- Reaction tank an application example
2Petri Net
- 9.1 Petri Net - introduction
- 9.2 Petri Net - history
- 9.3 Petri Net and state diagram
- 9.4 Petri Net and PLC in Industrial Control
- 9.5 Petri Net - terminology
- 9.6 Petri Net - formal definition
- 9.7 Petri Net - types
- 9.8 Petri Net - primitive structures
- 9.9 Petri Net - properties
- 9.10 Petri Net - interpretation for Industrial
Control
3Reaction tank -scheme
Raw material
Water for cooling
Steam for heating
Product
4Reaction tank an application example
- Reaction tank problem
- Reaction tank - scheme
- Technological conditions
- Variables list
- Petri net for reaction tank control places and
transitions - Petri net for reaction tank control
5Reaction tank control - Petri net
P1
T1
P2
T5
T2
T7
P3
P4
P6
T3
T6
P5
T4
6Reaction tank control - Petri net
- P1,.P5 places
(circle) - T1,.T6 transitions
(rectangle) - oriented connection - edge (line,arc)
- token, mark
(filled point) - Static character structure of the net
- Dynamic charecter movement of the mark through
the net
79.1 Petri Net - introduction
- Mathematical tool suitable for analysis and
modelling of discrete events systems - Grafical tool (comprehensive)
- Very helpful and favourite tool both for
- theoretical research
- and for practical design of control systems
8Petri Net - introduction - 2
- PN Petri Net
- SIPN Steuerung Interpretierte Petri
- Netz (Germany)
- It is possible to simply express and model
- Parallel behaviour
- Resource sharing
- Real time relationships
9Petri Net introduction - 3
- This introduction deals with the graphical aspect
of Petri Net for system description, not the
algebra of Petri Net. - While the mathematical properties of Petri Net
are interesting and useful, the beginner will
find that a good approach is to learn to model
systems by constructing them graphically, aided
in construction and analysis by computer software
for simulation and analysis of Petri Nets.
1010.2 Petri Net - history
- Author Carl Adam Petri Ph.D. dissertation
thesis in 1962 on the topic Formal methods in
dicrete events modelling (communication betweeen
sequential machines - automatons) - See Ref. 1
- Further development at MIT Massachusets
Institute of Technology (seventies of the
previous century)
11Petri Net - history - 2
- Since then, Petri Nets and their concepts have
been extended and developed, and applied in a
variety of areas - Office automation, work-flows, flexible
manufacturing, programming languages, protocols
and networks, hardware structures, real-time
systems, performance evaluation, operations
research, embedded systems, defence systems,
telecommunications, Internet, e-commerce and
trading, railway networks, biological systems !
129.3 Petri Net and state diagram
- State diagram suitable for typical sequential
systems (one event following another event in
clear order, only a few alternative pathes, no
paralell pathes) - Petri nets suitable for parallel processes and
communications - SW for Petri net applications makes possible to
create and run model in modular way
139.4 Petri Net and PLC in Industrial Control
- There are very efficient graphical tools
(languages) at disposal today for PLC programming
which are very similar to the Petri Nets
formalism (they are based on it) - Two terms directly onnected with Petri Nets
- GRAFCET (Graphe Fonctionenel de Connexion Etapes
Transitions - France, origin 1975-1977) since
1987 International standard (IEC 848) - SFC (Sequential Function Chart)
- according to the international standard
- IEC 1131-3 (standard for PLC programming)
149.5 Petri Net - terminology
- A Petri Net is a collection of directed arcs
connecting places and transitions. Places may
hold tokens. - The state or marking of a net is its assignment
of tokens to places. - Here is a simple net containing all components of
a Petri Net
15Petri Net - terminology - 2
Simple net
weight
16Petri Net - terminology - 3
- Arcs have capacity (weight) 1 by default if
other than 1, the capacity is marked on the arc. - Places have infinite capacity by default.
- Transitions have no capacity, and cannot store
tokens at all. - With the rule that arcs can only connect places
to transitions and vice versa, we have all we
need to begin using Petri Nets. - A few other features and considerations will be
added as we need them.
17Petri Net terminology - 4
- Petri net models consist of two parts
- 1. the net structure that represents the static
part of the system - 2. a marking that represents the overall state
on the structure. State can change - this
represents dynamic behavior of the system.
18Petri Net - terminology - 5
- The token distribution among the places of a
Petri net is called its marking. - When one or more tokens reside in a place, the
place is said to be marked, otherwise it is
unmarked. - The number of tokens at a place represents the
local state of the place. - The marking of the net represents the overall
state of the system.
19Petri Net - terminology - 6
- A transition is enabled when the number of tokens
in each of its input places is at least equal to
the arc weight going from the place to the
transition. - An enabled transition may fire at any time. When
fired, the tokens in the input places are moved
to output places, according to arc weights and
place capacities. This results in a new marking
of the net, a state description of all places.
20Petri Net - terminology - 7
- Example
- This Petri net has
- 2 places p1, p2
- 1 transition t1
- p1 has one token f(p1) 1
- p2 has 0 tokens f(p2) 0
21Petri Net - terminology - 8
- Firing a Transition
- When a transition tj fires
- Each pi that has an edge from pi to tj removes a
token from pi - Each pj that has an edge from tj to pj adds a
token to pj
22Petri Net - terminology - 9
Petri net after t1 fires
Petri net before t1 fires
23Petri Net - terminology - 10
- A transition must be enabled before it fires
- There is a token in each pi that has an edge
- to the transition
- An enabled transition may or may not fire
- (it can be another condition asociated with
the transition)
24Petri Net terminology - 11
Petri net after t1 fires
Petri net before t1 fires
25Petri Net - terminology - 12
- A place can contain non-negative whole number of
marks - At the moment of transition firing (activation,
skipping) the marks are withdrawn from input
places and added to the output places of the
transition - Oriented edges connect places and transitions
26Petri Net - terminology - 13
- initial marking (marks displacement in the
places before the first skip) describes the
initial state of the system - system development is represented by transfer of
the marks in the net on the basis of activating
of the transitions (skip) - every new marking of the system represents a new
state of the system
27Petri Net - terminology - 14 Transition enabling
- example
- weight of the P9 - T3 edge is 4
- place P9 contains only 3 3 tokens
- transition T3 is not enabled (for one car we
need four wheels) - transition T3 cannot be fired
wheels
motor
P9
car body
P10
P8
4
T3
P11
car
289.6 Petri Net - formal definition
A Petri Net is a 5 tuple PN (P,T,F,W,M0), where
299.7 Petri Net - types
- Original Petri Nets
- Only 1 token can be removed/added from a place
when a transition fires - (i.e., the weight is always 1)
- Weighted Petri Nets
- Generalized the original Petri net to allow
multiple tokens to be added/removed when a
transition fires. - The edges are labeled with the weight (i.e.,
number of tokens) - If there is no label, then the default value is 1
30Petri Net - types - 2
Weighted Petri net after t1 fires
Weighted Petri net before t1 fires
31Petri Net - types - 3
- Other Types of Petri Net
- Petri nets have been extended over the years in
many directions including time,data, and
hierarchy. - Time Extended Petri Nets
- Coloured Petri Nets
- Hierarchical Petri Nets
32Time Extended Petri Net
- First developed in the mid 1970s
- For real systems it is often important to
describe the temporal behavior of the system,
i.e., we need to model durations and delays. - There are 3 basic ways to introduce time into the
Petri net. Time can be associated with - tokens
- places
- transitions
- The first introduction of time in Petri nets is
in the Timed Petri net model - C. Ramchandani, Analysis of Asynchronous
concurrent systems by timed petri nets, MIT
MAC-TR-120, 1974. In this model, a time duration
is associated with each transition.
33Time Extended Petri Net - 2
- The firing rules in this model are that the
transition must fire as soon as it is enabled,
and firing a transition takes a fixed, finite
amount of time. - The notion of instantaneous firing of transitions
is not preserved in the Timed Petri net model. - When a transition becomes enabled, the tokens are
immediately removed from its input places. - After the time delay, tokens are deposited in
the output places. - The result is that the state of the system is not
always clearly represented during the process. - // Note. There are many other extensions to Petri
Nets that consider time.
34Coloured Petri Net
- Developed in the Late 1970s ( K. Jensen,
Colored Petri nets and the invariant method,
Theoretical Computer Science, volume 14, 1981,
pp. 317-336.) - Tokens often represent objects (e.g. resources,
goods, humans) in the modeled system - To represent attributes of these objects, the
Petri net model is extended with coloured or
typed tokens. - each token has a value often referred to as
colour'. - Transitions use the values of the consumed tokens
to determine the values of the produced tokens - a transition describes the relation between the
values of the input tokens and the values of
the output tokens' - It is also possible to specify preconditions'
which take the colours of tokens to be consumed
into account.
35Hierarchical Petri Nets -1
- Developed in the Late 1980s
- Specifications for real systems have a tendency
to become large and complex - An abstraction mechanism, hierarchical
structuring, is used to make constructing,
reviewing, and modifying the model easier - The hierarchy construct is called a subnet
36Hierarchical Petri Net - 2
- A subnet is an aggregate of a number of places,
transitions, and subsystems - Such a construct can be used to structure large
processes - At one level we want to give a simple
description of the process (without having to
consider all the details). - At another level we want to specify a more
detailed behavior. - Each subnet is represented with a rectangular box
that encapsulates part of the Petri Net model
37Hierarchical Petri Net - 3
- Each subnet is represented with a rectangular
box that encapsulates part of the Petri Net model
389.8 Petri Net - Primitive structures
39Primitive structures - 2
- Sequence is obvious - several things happen in
order. - Conflict is not so obvious. The token in P4
enables three transitions but when one of them
fires, the token is removed, leaving the
remaining two disabled. Unless we can control the
timing of firing, we don't know how this net is
resolved.
40Primitive structures - 3
- Concurrency, again, is obvious many systems
operate with concurrent activities, and this
models it well. - Synchronization is also modeled well using Petri
Nets when the processes leading into P8, P9 and
P10 are finished, all three are synchronized by
starting P11.
41Primitive structures - 4
- Confusion is another not so obvious construct. It
is a combination of conflict and concurrency. P12
enables both T11 and T12, but if T11 fires, T12
is no longer enabled. - Merging is not quite the same as synchronization,
since there is nothing requiring that the three
transitions fire at the same time, or that all
three fire before T17 this simply merges three
parallel processes. - The priority/inhibit construct uses the inhibit
arc to control T19 as long as P16 has a token,
T19 cannot fire.
42Primitive structures - 5
Example Enabling and activation - effective
conflict between transitions T1a T2
hungry human B
hungry human A
dinner
P2
P1
P3
T1
T2
P4
P5
P6
full human B
full human A
dirty dishes
hladový strávník A
43Primitive structures - 6
Conflict development between transitions T1 and
T2 version A
hungry human B
hungry human A
dinner
P2
P1
P3
T1
T2
P4
P5
P6
filling human B
filling human A
dirty dishes
44Primitive structures - 7
Conflict development between transitions T1 and
T2 version B
hungry human B
hungry human A
dinner
P2
P1
P3
T1
T2
P4
P5
P6
filling human B
filling human A
dirty dishes
45 10.9 Petri Net- properties
- We can ask some interesting questions about the
Petri Nets (i.e., we can ask interesting
questions about the models of a particular
system) - Some properties of interest include
- Terminate
- Does the Petri Net terminate?
- Immediately Reachable
- Is a state reachable when a transition fires?
- Reachable
- Is a state eventually reachable?
46 Petri Net- properties -2
- Live
- In all states, is there at least one transition
that can fire? - Partial deadlock
- Is there a state in which at least one
transition that can never fire? - Deadlock
- Is there a state in which none of the
transitions can fire?
47Petri Net- properties -3
- Safe
- In all states, does each place contain at most
one token? - Bounded
- In all states, is there a limit to the number
of tokens that can be in one place? - Conservative
- Is the total number of tokens in the Petri Net
constant?
489.10 Petri Net - interpretation for Industrial
Control
- Petri net can expres the desired control system
behaviour (SIPN) - Another condition must be fulfilled before
transition firing, e.g. some event asociated
with the transition must occure - Places actions of the control system (outputs
of PLC) - Transitions conditions (e.g. from sensors,
inputs of PLC)
49Reaction tank - problem
- typical partial task from food industry or
chemical industry - analogue variables, e.g. temperature, level,
pressure, are monitored via binary sensors (only
limit values of this analogue variables - it is
cheaper - concurency of activities in technological process
- SIPN application
50Reaction tank -scheme
Raw material
Water for cooling
Steam for heating
Product
51Technological conditions for control system
(e.g. PLC)
- Specific reaction is to be run in the reaction
tank at the temperature hold between ltT1,T2gt.
Steam is used for heating (double cover of the
tank). Cold water is used for cooling (radiator
tube inside of the tank). The liquid is mixed
with the mixer during the reaction. - In the initial state all valves are closed,
both heating, cooling and mixing do not work.
52Technological conditions - 2
- Start of the process via Start button
- The tank is filled up to the high level sensor
and the mixer is started - The mixer is running until the reaction is
fulfilled - According to the comming raw material temperature
steam heating or water coolling is starting up
53Technological conditions - 3
- If the comming raw material temperature matches
the desired interval ltT1,T2gt, neither heating nor
cooling is started - If the desired temperature is reached when
heating or cooling, the heating or cooling is
shut down. The reaction is completed. - The liquid from the tank is drained (low level
sensor)
54Variables list inputs (of PLC)
- STA.Starting button (the reaction is to start
má zacít STA1) - H_LS.. High level of the raw material sensor
(the level is above the high sensor H_LS1) - L_TS.. Low temperature of the raw material
(Tltlow limit T1 L_TS1) - H_TS.. High temperature of the raw material
(Tgthigh limit T2 H_TS1) - L_LS.. Low level of the raw material sensor (the
level is under the low sensor L_LS1)
55Variables list outpus (of PLC)
- V1_S.. Valve for raw material input
(V1_S1 open the valve) - M... Mixer motor
- (M1 start the mixer)
- V2_TP valve for heating steam input (V2_TP1
open the valve) - V3_P.. Valve for product output (V3_P1
open the valve) - V3_CHV..Valve for cooling water input
(V3_CHV1 open the valve)
56Limit values identification
- Analogue variables are often monitored via binary
sensors (cheaper) - There are two types of limit values in industrial
processes control operating and critical - operatingH - High
- L- Low
- critical HH - High High
- LL - LowLow
- These limits are highlighted on the operator
panel (for better overview )
57Petri Net (PN) for reaction tank control -
places - and output variables values
- P1 (standstill) V1_S0, V2_TP0, V2_TP0,
V3_P 0, V3_CHV 0, M0 - P2 (filling) V1_S1
- P3 (coolling) V3_CHV1
- P4 (heating) V2_TP1
- P5 (draining) V3_P1
- P6 (mixing) M1
58Petri Net for reaction tank control -
transitions - and input variables values
- STA, (start) T1
- H_LS.NotL_TS , (filled, cool) T2
- L_TS, (low temperature of the raw material)
T3 - L_LP, (low level of the product )
T4 - H_LS.H_TS, (filled, warm) T5
- NotH_TS, (not enough high temperature of the raw
material T6 - H_LS.NotH_TS.L_TS, (filled, temperature between
ltT1,T2gt T7
59PN for reaction tank control -1
P1
T1
P2
T5
T2
T7
P3
P4
P6
T3
T6
P5
T4
60PN for reaction tank control -2
P1
T1
P2
T5
T2
T7
P3
P4
P6
T3
T6
P5
T4
61PN for reaction tank control - 3
P1
T1
P2
T5
T2
T7
P3
P4
P6
T3
T6
P5
T4
62PN for reaction tank control - 4
P1
T1
P2
T5
T2
T7
P3
P4
P6
T3
T6
P5
T4
63PN for reaction tank control - 5
P1
T1
P2
T5
T2
T7
P3
P4
P6
T3
T6
P5
T4
64PN for reaction tank control - 6
P1
T1
P2
T5
T2
T7
P3
P4
P6
T3
T6
P5
T4
65PN for reaction tank control -7
P1
T1
P2
T5
T2
T7
P3
P4
P6
T3
T6
P5
T4
66PN for reaction tank control - 8
P1
T1
P2
T5
T2
T7
P3
P4
P6
T3
T6
P5
T4
67PN for reaction tank control - 9
P1
T1
P2
T5
T2
T7
P3
P4
P6
T3
T6
P5
T4
68PN for reaction tank control -10
P1
T1
P2
T5
T2
T7
P3
P4
P6
T3
T6
P5
T4
69PN for reaction tank control - 11
P1
T1
P2
T5
T2
T7
P3
P4
P6
T3
T6
P5
T4
70PN for reaction tank control -12
P1
T1
P2
T5
T2
T7
P3
P4
P6
T3
T6
P5
T4
71Reference
- 1 Petri, C.A., Kommunikation mit Automaten.
Petri, C.A., Bonn Institut für Instrumentelle
Mathematik, Schriften des IIM Nr. 2, 1962, Second
Edition, New York Griffiss Air Force Base,
Technical Report RADC-TR-65--377, Vol.1, 1966,
Pages Suppl. 1, English translation
72Reference - 2
- http//robotica.pardini.net/Documentos/Petri01.pdf
- www.hait.ac.il/staff/leonidm/1F99L15.htm
- http//www.ite.his.se/ite/utbildning/kurser/auc111
/pdf/pn_informal.pdf - http//www.techfak.uni-bielefeld.de/mchen/BioPNML
/Intro/pnfaq.html - A Petri Net Tool DNAnet (Free software for
students)
73(No Transcript)