You are on page 1of 25

Synthesis of Active Controller

for Resources Allocation Systems

Belhassen ZOUARI and Sajeh ZAIRI


LIP2 Laboratory - University of Tunis Manar

25/10/2005 CPN Workshop 2005, Aarhus 1


Plan

• Objective / Motivations

• Hypothesis and Methodology

• Admissible behaviours and dangerous markings

• Synthesis of Active Controller

• SACoRAS application

• Conclusion and prospects

25/10/2005 CPN Workshop 2005, Aarhus 2


General purposes

• Supervisory Control of Discrete Event Systems (DES)

• Engineer-oriented tool

• Aimed fields : Flexible Manufacturing Systems (FMS) ,


Production systems, etc.

25/10/2005 CPN Workshop 2005, Aarhus 3


Framework

• Supervisory Control Theory of Ramadge and Wonham, 1989

• Forbidden state problem

• Availability of powerful methods/tools based on CP Nets

25/10/2005 CPN Workshop 2005, Aarhus 4


Objectives

• Supervisory Control of Resources Allocation Systems (RAS)


– Controller Synthesis

• A practical Tool allowing automatic generation of controller

• SACoRAS : a CPN Tools based application


(Synthesis of Active Controller for RAS)

25/10/2005 CPN Workshop 2005, Aarhus 5


SACoRAS : aimed capabilities

editing a RAS (the plant model)

introducing control specifications

generating the
the engineer controlled model SACoRAS
CPN Tools
simulating

analysing the controlled model

25/10/2005 CPN Workshop 2005, Aarhus 6


Supervisory Control

Restricting the behaviour of a DES to a desired


behaviour

Æ ensured by an extern entity to the plant model

Æ that forbids the occurrence of events on the basis of the


current state

25/10/2005 CPN Workshop 2005, Aarhus 7


Underlying specification model

A RAS is formally defined as : <R, GP, GetR, PutR>


• R : resource types with their initial availability
• GP : collection of generic processes
- set of finite state machines (FMS)
- process instances for every generic process
• GetR : resource allocation function
- associated with FMS transitions as pre-conditions
• PutR : resource restitution function
- associated with FMS transitions as post-conditions

25/10/2005 CPN Workshop 2005, Aarhus 8


RAS Example
1`r1++1`r2

Cr 1`r1++2`r2
1`r2
1`c12++1`c11 r 1`c21
p01 C1 C2 p02

X1 X2
1`r2
t11 t21
1`r1 C1={c11,c12}
X1 X2 X2
C2={c21}
p11 C1 C2 p22
Cr={r1,r2}
X1 X1 X2
X2 X2 X1 variable
1`r1++2`r2 t12 t22 t23 defined on
2`r2
X1
X2 X2 variable
p12 C1 1`r1
defined on C2
C2 p23
X1
X2
t13
t24

25/10/2005 CPN Workshop 2005, Aarhus 9


Methodology of controller synthesis

Y Admissibility
– Computing the admissible behaviours
generating a graph Rc of admissible behaviours

– Determining dangerous markings and inadmissible markings


– Defining the set Ω of state transitions to be ‘disabled’

Y Synthesis of the active controller


– generating a sub-net (CPN) acting a controller process

25/10/2005 CPN Workshop 2005, Aarhus 10


Admissible Behaviour

Behaviour of the RAS plant model


– satisfying the control constraints
– ensuring the non-blockingness
→ Rc : Admissibility Graph
(graph of admissible markings)

An Admissible marking may be dangerous

25/10/2005 CPN Workshop 2005, Aarhus 11


Inadmissible and dangerous markings

An inadmissible marking is :
* either a forbidden marking (specified as “undesired”),
* or computed
- from which we are not able to avoid reaching an inadmissible
marking
- unreachable from initial marking

A Dangerous marking is a marking that may lead to an


inadmissible state but we are able to avoid it.

25/10/2005 CPN Workshop 2005, Aarhus 12


Forbidden state transitions

A forbidden state transition is a couple (Md, tc) where


– Md is an inadmissible marking
– tc is a controllable transition that inevitably leads
to an inadmissible state
→ Ω : set of forbidden state transitions

The set Ω contains the necessary information to the


control

25/10/2005 CPN Workshop 2005, Aarhus 13


Computing Rc and Ω
Principles :
– traversing the reachability graph

– determining new inadmissible markings (computed)

– determining dangerous markings

– eliminating the inadmissible makings (specified and computed)

– determining the forbidden state transitions


→ obtaining Rc and Ω

25/10/2005 CPN Workshop 2005, Aarhus 14


Example : Computing Rc and Ω
FIS={M9,M10}

t11,c11 M8
M9
t24,c21
M0
t11,c11 t23,c21 t22,c21

t11,c12 t21,c21 M3
M1 t13,c11
t22,c21
t22,c21 t11,c12
M2
t13,c12 t21,c21 t11,c11
t21,c21
t21,c21 t12,c11
t12,c11
t12,c12

M5 t23,c21
M7 M6 t22,c21
t23,c21 M10
M4
t11,c11
25/10/2005 CPN Workshop 2005, Aarhus 15
Example : Rc and Ω
M8
Admissibility graph Rc M0
t24,c21

t11,c11 t23,c21 t22,c21

t11,c12 t21,c21 M3
M1 t13,c11
M2
t13,c12 t21,c21 t11,c11
t21,c21 t12,c11
t12,c12

M5 t23,c21
t23,c21 M7 M6
M4
t11,c11
The set of state transitions that must be disabled is :
Ω={(M4,t22(c21)) ,(M8,t11(c11)), (M6,t22(c21)) ,(M8,t11(c12))}
25/10/2005 CPN Workshop 2005, Aarhus 16
Generating the active controller

Generating the controller allows :


* Adding four controller places
- CM represents the current marking
- AT defines the authorisations for forbidden transitions
- DM represents the dangerous states
- AS represents an Alert state

* Adding two controller transitions


- A_In represents the entering the alert state
- A_Out represents the exit from the alert state

25/10/2005 CPN Workshop 2005, Aarhus 17


Generating the active controller (2)

• Generating the controller requires :


* determining the colour domain of the controller places
k xi card(Cr)

C(CM) = ⊗⊗C
i =1 1
num ⊗ C
j=1
num

avec Cnum classe de couleur représentant un ensemble fini d’entier


with Cnum the colour class representing a finite integer set
C (AT)= CFT = ∪d∈DS FT(d )
C (DM) = C (AS)=C(CM) x CFT

* determining the initial markings of controller places

25/10/2005 CPN Workshop 2005, Aarhus 18


Generating the active controller (3)
* Determining colour functions associated with arcs connecting the controller
places to transitions of the initial system
- for CM :
∀t∈T, W-(CM,t)=<X1,1,…,Xk,xk, Y1,…,YU> =<X>
W+(CM,t)= <X'1,1, …, X'k,xk,Y'1, …,Y'u > =<X'>

X'i,j= Xi,j - c , avec c= W+(pij,t)-W-(pij,t),


and
Y'u= Yu-ξ , ξ= a'u - au

- for AT :
∀t∈CFT, W-(AT,t)= W+(AT,t)=t
25/10/2005 CPN Workshop 2005, Aarhus 19
Generating the active controller - Example
1`t22

DM Cdm p22

(X11,X12,X13,X21,X22,X23,Y1,Y2)
(X,Xt) X2

Xt X
AT A_In CM Ccm t22
Cft
X2
(X,Xt)
(X11,X12,X13,X21,X22-1,X23+1,Y1,Y2)
p23
Xt AS Cdm Y

(X,Xt) M0(CM)=<2,0,0,1,0,0,2,1>
M0(AT)= t11+t22
A_Out
M0(DM)= <<1, 1, 0, 0, 1, 0, 0,1>, t22> +
[X<>Y]
<<2, 0, 0, 0, 0, 1, 1,1>, t11>
X, Y variables defined on C(CM)
Xt variable defined on C(AT)
25/10/2005 CPN Workshop 2005, Aarhus 20
SACoRAS Architecture
•RAS specification( description of process behaviour and resources management)
User level •Control specification (set of forbidden states, set of uncontrollable transitions)

Ω: set of
Control forbidden
SACoRAS level specification Admissible state
Editor Controller
transitions
graph Synthesis
generator
O.G
Plant model
(CPN format) Controlled
CPN model

CPN Tools level


CPN Tools : State Space Tools CPN Tools : simulator

25/10/2005 CPN Workshop 2005, Aarhus 21


25/10/2005 CPN Workshop 2005, Aarhus 22
Conclusion and Prospects

CPN Tools appears as a powerful kernel for numerous environments


(specification, verification, …) in various application fields

Suggestions for CPN Tools enhancements :


• offering a better connectivity to ‘cooperating’ external modules
Æhandling priorities at the firing rule level
Æallowing to save the occurrence graph
Æa standard format exchange (PNML ?)

25/10/2005 CPN Workshop 2005, Aarhus 23


End of presentation

25/10/2005 CPN Workshop 2005, Aarhus 24


Implementing Priorities

t t'

(0,0)
(0,0) ComputingPriority(X,Y)
(Xnum,0)
(Xnum,Ynum)
A_In Priority A_Out
(Xnum-1,0)
[Xnum<>0] [Ynum<>0]
(Xnum,Ynum-1)

t : transition not involved in dangerous markings


t’ : transition involved in a dangerous marking
ComputingPriority(X,Y)
X : source state , Y : target state
(0,0) Æ Low priority
(α>0,0) Æ A_In enabled
(α, β>0) Æ A_Out enabled
25/10/2005 CPN Workshop 2005, Aarhus 25