Escolar Documentos
Profissional Documentos
Cultura Documentos
MEEC 2007-2008
Industrial Automation
(Automao de Processos Industriais)
MEEC 2007-2008
Syllabus:
Chap. 5 CAD/CAM and CNC [1 week] ... Chap. 6 Discrete Event Systems [2 weeks] Discrete event systems modeling. Automata. Petri Nets: state, dynamics, and modeling. Extended and strict models. Subclasses of Petri nets. Chap. 7 Analysis of Discrete Event Systems [2 weeks]
API P. Oliveira Page 2
Bibliography:
* Cassandras, Christos G., "Discrete Event Systems - Modeling and Performance Analysis", Aksen Associates, 1993. * Peterson, James L., "Petri Net Theory and the Modeling of Systems", Prentice-Hall,1981. * Petri Nets and GRAFCET: Tools for Modelling Discrete Event Systems R. DAVID, H. ALLA, New York : PRENTICE HALL Editions, 1992
P. Oliveira Page 3
API
API
P. Oliveira
Page 4
API
P. Oliveira
Page 6
API
P. Oliveira
Page 7
Characteristics of systems with continuous variables 1. State space is continuous 2. The state transition mechanism is time-driven Characteristics of systems with discrete events 1. State space p is discrete 2. The state transition mechanism is event-driven Polling is avoided!
API P. Oliveira Page 8
Taxonomy of Systems
API
P. Oliveira
Page 9
API
P. Oliveira
Page 10
API
P. Oliveira
Page 11
CPU
API
P. Oliveira
Page 12
Automata
GRAFCET
Petri nets
API P. Oliveira Page 14
Properties of languages Kleene-closure E*: set of all strings of finite length of E, including the null element .
Concatenation:
La Lb := s E * : s = sa sb , sa La , sb Lb
Prefix-closure:
L := s E * : tE * st L
API
}
Page 16
P. Oliveira
(E, X, f, x0 ,F)
onde: E X f x0 F - finite alphabet (or possible events) - finite set of states - state transition function - initial state f: X x E ->X x0 X
API
P. Oliveira
Page 17
API
P. Oliveira
Page 19
Given a language
G=(E, X, f, x0 ,F)
Generated language
Lm(G) := {s : f(x0,s) F}
API P. Oliveira Page 20
10
API
P. Oliveira
Page 21
11
Example of an automata:
Objective: To validate a sequence of events
API
P. Oliveira
Page 23
Deadlocks (inter-blocagem) Example: 1 a 0 g 2 The state 5 is a deadlock. The states 3 and 4 constitutes a livelock.
API
g a 3 a b
How to find the deadlocks and the livelocks? Methodologies g for the analysis Of Discrete Event Systems
P. Oliveira Page 24
12
Lm (G ) Lm (G ) L(G )
An automata G has a deadlock if and is not blocked when
Lm (G ) L(G )
Lm (G ) = L(G )
API
P. Oliveira
Page 25
Deadlock: Example: 1 a 0 g 2 The state 5 is a deadlock. The states 3 and 4 constitutes a livelock.
API
g a 3 a b
Lm (G ) = {ab, ag , abgab, abgabgab,...} , a, ab, ag , aa, aab, L(G ) = abg , aaba, abga,...
5
(Lm (G ) L(G ))
Lm (G ) L(G )
P. Oliveira Page 26
13
Alternative way to detect deadlocks: Example: 1 a 0 g 2 The state 5 is a deadlock. The states 3 and 4 constitutes a livelock.
API
g a 3 a b
5 0
0 g 5
a 1 a b 3 b 4 a 3
P. Oliveira Page 27
2 0
API
P. Oliveira
Page 28
14
Petri nets
Developed by Carl Adam Petri in his PhD thesis in 1962. Definition: A marked Petri net is a 5-tuple
(P, T, A, w, x0)
where: P T A w x0
API
- set of places - set of transitions - set of arcs - weight function - initial marking A (P x T) (T x P) w: A x0 : P
P. Oliveira Page 29
API
P. Oliveira
Page 30
15
API
P. Oliveira
Page 31
API
P. Oliveira
Page 32
16
where: P T I O
(P, T, I, O, 0)
- set of places - set of transitions - transition input function - transition output function - initial marking I: P T O: T P
0
API
0 : P
P. Oliveira Page 33
p1
(P, T, I, O, 0)
P={p1, p2, p3, p4, p5} T={t1, t2, t3, t4} I(t1)={p1} I(t2)={p2} I(t3)={p3, p3} I(t4)={p4, p4, p4, p5} O(t1)={p2 , p3} O(t2)={p4} O(t3)={p5} O(t4)={p1}
t1 p2 t2 p4 3 t4 2 p3 t3 p5
0 = {1, 0, 0, 2, 0}
API
P. Oliveira
Page 34
17
Petri nets The state of a Petri net is characterized h i d by b the h marking ki of all places.
p2
p1 t1 p3 3 t2
The set of all possible markings of a Petri net corresponds to its state space space.
API
P. Oliveira
Page 35
pi P : ( pi ) # ( pi , I (t j ))
A transition tj is enabled to fire, resulting in a new marking given by
( pi ) = ( pi ) # ( pi , I ( t j )) + # ( pi ,O( t j ))
API
P. Oliveira
Page 36
18
Petri nets
Example of evolution of a P i net Petri Initial marking: 0 = {1, 0, 1, 2, 0}
.
p2 t2 p4
p1 t1
. . ..
3
. .. p
2
t3
5
.p
t4
P. Oliveira
API
Page 37
a,b c d
19
Pre-conditions a,b c d
Start of processing
Job is complete
Petri nets
Modeling mechanisms
Concurrence Conflict
t1
t1
t2
t2
API
P. Oliveira
Page 40
20
Petri nets
Modeling mechanisms
Mutual Exclusion Producer / Consumer
t1
Critical Section
t2
Critical Section
to produce
to consume
API
P. Oliveira
Page 41
Petri nets
Modeling mechanisms
Producer / Consumer with finite capacity Readers / Writers
s
to produce
t n
B
n n
to consume
to read
n n
to write
B'
API
P. Oliveira
Page 42
21
An automatic soda selling machine accepts 50 c and $1 coins and sells 2 types of products: SODA A, that costs $1.50 and SODA B, that costs $2.00. Assume that the money return operation is omitted.
t1
p2
t4 p4
t5 p1 t2 t6 p3 t3
t7
p5
t8
p1: machine with $0.00; t1: coin of 50 c introduced; t8: SODA B sold. P. Oliveira Page 43
API
API
P. Oliveira
Page 44
22
Can be implemented with restricted Petri nets? Zero tests... Infinity tests...
API P. Oliveira Page 45
Job arrival
Start of processing
End of processing
Job is delivered
Job is complete
Server is idle
API
P. Oliveira
Page 46
23
Job arrival
Start of processing
End of processing
Job is delivered
Job is complete
Server is idle
API
P. Oliveira
Page 47
Stochastic switches
Transitions with stochastic timmings described by a stochastic variable with known pdf
q0
q1
q2
q0+q1+ q2 =1
API
P. Oliveira
Page 48
24
API
P. Oliveira
Page 49
M1
M2
25
API
P. Oliveira
Page 51
- loads part in M1 - ends part processing in M1 - loads manipulator - unloads manipulator p and loads M2 - ends part processing in M2 - manipulator at base
P. Oliveira Page 52
R M1 M2
26
x2
B I
r3 d2
x3
R C I
1
API
P. Oliveira
Page 53
pea nova
M1
M2
Idle
Idle r1
Idle r2 Busy d2
Carrying
M1
Returning
R
r3
API
P. Oliveira
Page 54
27