Deadlock-free scheduling for flexible manufacturing systems using untimed Petri nets and model predictive control

Deadlock-free scheduling for flexible manufacturing systems using untimed Petri nets and model predictive control

IFAC Conference Manufacturing Modelling, Management and on Control Management and on Control June Conference 28-30, 2016. Troyes, France Modelling, IF...

792KB Sizes 0 Downloads 55 Views

IFAC Conference Manufacturing Modelling, Management and on Control Management and on Control June Conference 28-30, 2016. Troyes, France Modelling, IFAC Manufacturing Available online at www.sciencedirect.com June 28-30, 2016. Troyes, France Management and Control June 28-30, 2016. Troyes, France

ScienceDirect

384–389 manufacturing systems Deadlock-freeIFAC-PapersOnLine scheduling49-12 for(2016) flexible Deadlock-free scheduling for flexible manufacturing systems using untimed Petri nets and model predictive control Deadlock-free scheduling for flexible manufacturing systems using untimed Petri nets and model predictive control using untimed PetriDimitri nets Lefebvre and model predictive control

Dimitri Lefebvre Lefebvre GREAH – Normandie Univ,Dimitri UNIHAVRE, 75 rue Bellot, FR 76600 Le Havre GREAH – Normandie Univ, UNIHAVRE, 75 rue Bellot, FR 76600 Le Havre e-mail: [email protected] GREAH – Normandie Univ, UNIHAVRE, 75 rue Bellot, FR 76600 Le Havre e-mail: [email protected] e-mail: [email protected] Abstract: This paper proposes algorithms that incrementally compute control sequences that drive the marking of Abstract: Thisnets paper proposes algorithms incrementally compute control sequences drive or theduration markingthat of untimed Petri from an initial value to athat reference one, avoiding forbidden states withthat a length untimed Petri from an initial value to athat reference one, avoiding forbidden states with a length or duration that Abstract: This paper proposes algorithms incrementally compute that drive thesystems marking of approaches thenets minimal value. The proposed algorithms are applicable tocontrol a largesequences class of discrete event with approaches thenets minimal value. Thein proposed are applicable to a largestates class of discrete event systems with untimed Petri from an initial value to a algorithms reference one, avoiding with a length or and duration that or without temporal specifications particular in the domain of flexibleforbidden manufacturing, communication computer or without specifications particular in the the domain ofburdensome flexible to manufacturing, communication and computer approaches the minimal value. Theinproposed algorithms are applicable a large class discrete eventthe systems with science or temporal transportation and traffic. To overcome most part of theof computations, sequences science or transportation traffic. To overcome the most part of the communication computations, sequences or without specifications in particular theworked domain ofburdensome flexible manufacturing, and computer encoded intemporal a small area of and the reachability graphinare out. The main contribution is to propose anthe estimation of encoded in transportation alength small or area of and the reachability graphsequences are worked out. The mainbased contribution is to proposeofan estimation of science or traffic. To overcome the most burdensome parton ofthe thecomputation computations, the sequences the minimal duration of the remaining to the reference the firing count the minimal or duration of theforremaining to the on the computation ofan the firing count encoded in alength small area of suitable the reachability graphsequences are worked out.reference The mainbased contribution iswith to propose estimation of vectors. The approach is deadlock-free scheduling problems encountered flexible manufacturing vectors. Thelength approach is suitable deadlock-free scheduling problemsbased encountered with flexible manufacturing the minimal or duration of theforremaining sequences to the reference on the computation of the firing count systems. systems. The approach is suitable for deadlock-free scheduling problems encountered with flexible manufacturing vectors. Keywords: Discrete event systems, Petri nets scheduling problems, model Ltd. predictive control. © 2016, IFAC (International Federation of deadlock-free Automatic Control) Hosting by Elsevier All rights reserved. systems. Keywords: Discrete event systems, Petri nets deadlock-free scheduling problems, model predictive control. Keywords: Discrete event systems, Petri nets deadlock-free scheduling problems, model predictive control. 1. Introduction 1. Introduction Petri nets (PNs) are commonly used for control issues of discrete 1. Introduction Petri (PNs) are commonly used for control discrete event nets systems (DESs) (Cassandras, 1993; David &issues Alla, of 1992) The event systems (DESs) (Cassandras, 1993; Davidstate &issues Alla, 1992) Thea Petri (PNs) are commonly used control discrete designnets of firing sequences that reach afor specific and of optimize design ofcost firing sequences that the reach a specific andobjective optimize event systems (DESs) (Cassandras, 1993; David Alla, 1992) The specific function (usually makespan) isstate a&basic ina specific function (usually the makespan) isstate a basic design ofcost firing sequences reach a specific andobjective optimizeina many control problems, inthat particular in deadlock-free scheduling many control problems, in particular in deadlock-free scheduling specific cost function (usually the makespan) a basic in problems because this objective leads directly toisthe designobjective of optimal problems because thisshop objective leads The directly to the design of optimal many control problems, in particular in difficulty deadlock-free cycle of tasks in job problems. is thatscheduling deadlockcycle of tasks inproblems job problems. is that deadlockproblems because thisshop objective leadstoThe directly to thedue design of optimal free scheduling are known be difficulty NP-hard to multi-layer free scheduling are known toThe be of NP-hard due to multi-layer cycle of tasks inproblems job problems. difficulty is that deadlockresource sharing andshop routing flexibility the jobs. Thus, a large resource sharing and routing flexibility the injobs. a large free scheduling problems are to be of NP-hard due Thus, to multi-layer literature has been devoted to known such optimization, particular with PN literature hasthe been devoted to main such optimization, particular with PN resource sharing routing flexibility of the in jobs. a large models. On oneand hand, the contributions to that Thus, problem have models. On one hand, the contributions toand thatA* problem literature hasthe been devoted to main such optimization, in particular withhave PN been provided by some adaptations of the Dijkstra algorithms been some adaptations of the Dijkstra A* algorithms models. theby one hand, theLee main toand that problem have to theprovided PNOn (Chretienne, 1986; &contributions DiCesare, 1994). Such to the PN (Chretienne, Leethe & DiCesare, 1994). Such algorithms been provided by some1986; adaptations of the Dijkstra and A* are suitable to partially explores reachability graph of the net, and are suitable to partially explores reachability graph of the net, and to the PNefficient (Chretienne, 1986; Leethe &respect DiCesare, Such algorithms generate schedules with to a 1994). heuristic cost function. generate efficient schedules with respect a heuristic cost are to partially explores reachability graph of thefunction. net, and Thesuitable performance basically lies the in how to good the cost function is. The performance basicallyhave lies in howdeveloped: good the pruning costcost function is. generate efficient schedules with respect to a heuristic function. Numerous improvements been of nonNumerous improvements been nonThe performance basically howdeveloped: good the pruning costet function is. promising branches (Sun have etlies al.,in 1994; Reyes-Moro al.,of2002), promising branches (Sun(Xiong et al.,been Reyes-Moro et al.,of2002), Numerous improvements have developed: pruning nonbacktracking limitation &1994; Zhou, 1998), determination of backtracking limitation &1994; Zhou, 1998), of promising branches (Sun(Xiong et al., Reyes-Moro et first al., 2002), lower bounds for the makespan (Jeng & Chen, 1998),determination best search lowerbacktracking bounds for theand makespan & Chen, bestor first search backtracking limitation (Xiong(Jeng & Zhou, determination of with heuristic (Wang Q 1998), & 1998), Z, 2012) dynamic with heuristic (Wang Q &the Z, other 2012) or dynamic lowerbacktracking bounds for theand makespan & Chen, 1998), besthand, first search programming (Zhang et al., (Jeng 2005). On some programming (Zhang etfrom al., the 2005). On other hand, some with backtracking and heuristic (Wang Q &theZ, 2012)methods or dynamic contributions are issued supervisory control that contributions are issued(Ramadge supervisory methods that programming (Zhang etfrom al., the 2005). On thecontrol other Basile hand, etsome have been developed & Wonham, 1987; al., have been developed Wonham,incontrol 1987; Basile et that al., contributions are from the & supervisory methods 2013) in order to issued avoid(Ramadge forbidden markings, particular deadlock 2013) in order to avoid(Ramadge forbidden markings, in 1987; particular deadlock have been developed Wonham, et al., markings. Supervisory control is & mainly based on theBasile addition of markings. Supervisory control is mainly based on addition of 2013) in order to avoidexclusion forbidden markings, in particular deadlock generalized mutual constraints overthe the initial generalized mutual exclusion constraints overtheare the initial markings. Supervisory controland is mainly based on addition of unconstrained PN model these constraints usually unconstrained PN monitor model and these constraints are usually generalized exclusion constraints over also thecombine initial implemented mutual with places. A few results implemented places. results also combine unconstrained PN monitor model control and these constraints are search usually scheduling andwith supervisory inAthefew same approach: in scheduling andwith supervisory thefew same approach: search in implemented monitor places. results alsoalgorithms combine the partial reachability graphcontrol (Lei etinA al., 2014), genetic the partial et reachability (Lei etin al., genetic scheduling and the 2014), same approach: search in (Abdallah al.,supervisory 2002) graph and control heuristic functions based onalgorithms the firing (Abdallah et al., 2002) graph and heuristic functions based the firing the partial reachability (Lei al., 2014), genetic vector (Jeng & Chen, 1998) haveetbeen studied. Butonaalgorithms common vector (Jeng & have been studied. Butona the common (Abdallah et 2002) and heuristic based drawback of al., all Chen, these 1998) approaches isfunctions that they require a firing large drawback of & all these approaches is that they a large vector (Jeng Chen, have been studied. But a common computational effort and1998) are time consuming. Theyrequire are definitively computational effort andcontrol are time Theyrequire are definitively drawback approaches is that they a large not suitableofforall realthese time or consuming. reconfiguration. not suitable foreffort real time or consuming. reconfiguration. computational andcontrol are time They are definitively not suitable for real time control or reconfiguration.

This work takes place in this context. It proposes a method for This work takes in this context. It deadlock-free proposes a method for untimed PNs that place incrementally computes schedules untimed PNs that place incrementally computes schedules This work takes in this It deadlock-free proposes a method for with control sequences that reachcontext. the reference state from the initial with avoiding control that reach the reference state from schedules the that initial untimed PNssequences that incrementally deadlock-free one, the forbidden statescomputes with a length or duration is one, avoiding the forbidden statesthe with a or length or duration with control sequences thatminimal reach reference state from the that initial minimal or approaches the length duration. The method is minimal or approaches the minimal length duration. The method one, avoiding the forbidden states control with a or length orapproach. duration that inspired from model predictive (MPC) As isa inspired from predictive control approach. As of minimal or approaches the minimal length or(MPC) duration. isa consequence, it model is robust to perturbations induced byThe themethod firing consequence, is robust to perturbations induced by the firing ofa inspired fromittransitions model predictive control (MPC) approach. Asare uncontrollable because the control actions to apply uncontrollable because the control toexploration apply consequence, ittransitions is robust to perturbations induced by the firingare of updated at each step. The approach is based on actions a partial updated at each step. Thegraph approach islimits based on actions aexploration partialtoexploration uncontrollable transitions because control apply are of the PN reachability butthe this to the of the PN reachability graph but islimits exploration to the updated at each approach based on apurpose partial exploration neighborhood ofstep. the The current marking. For this that a criterion neighborhood of the current that or purpose a criterion of theonPN but limits this exploration to the based thereachability evaluation ofgraph the marking. number ofFor firings duration required based onthe thereference evaluation of the number ofFor firings duration required neighborhood of the current purpose criterion to reach from themarking. final nodes ofthat theor graph isacombined to reach the from thenumber final nodes of theorgraph is combined based thereference evaluation of the ofthe firings duration required with aon criterion that computes exactly number of firings or the with a criterion that exactly the number or The the to reach the reference from finalfrom nodes the graph isgraph. combined duration to reach thecomputes final the nodes theof root ofofthefirings duration to reach thecomputes finalour nodes fromthe the root ofofthefirings graph. with a criterion that exactly number or The the present work improves previous contributions in untimed present improves our previous contributions in untimed duration work to&reach the final nodes from the rootpath of to thethe graph. The (Lefebvre Leclercq, 2015) context, where the reference (Lefebvre & Leclercq, 2015) where the path to the present work improves previous contributions in reference untimed was computed according toour ancontext, Euclidean distance. was according to an Euclidean distance. (Lefebvre 2015) context, where the path to the reference The computed paper&isLeclercq, organized as follows. In Section 2, PN systems and The paper is organized as follows. In Section 2, PN was computed according to an Euclidean distance. control problems are introduced. Section 3 presents an systems algorithmand to control problems are introduced. Section 3 presents an algorithm to The paper is organized asfiring follows. In Section 2, PN systems approach minimal length sequences. Section 4 sums up and the approach minimal length firing sequences. Section an 4 sums up the control problems are introduced. Section 3 presents algorithm to conclusions and perspectives. conclusions and perspectives. approach minimal length firing sequences. Section 4 sums up the conclusions and perspectives. 2. Petri net systems 2. Petri net systems 2. Petri systems 2.1. Petrinet nets 2.1. Petri nets 2.1. nets is defined as G = , where P = {P1,…, A PNPetri structure >, where P = {P1,…, A defined asTG=={T , P = and {P1,…, A defined asnq are is a the PN system W = W{1,...,q}, PO – I integer n non-negative WPRM isI the PN is a marking PN system with W = Wmarking incidence matrices (N isMtheset numbers), and PO – I integer andincidence (N)ofmatrix. represents vector. initial n represents the PN marking vector. and M  (N)matrix. initial M isI the Misisagiven PN system with W Wmarking PO – WPR The= enabling degree ofincidence transition Tj at marking by nj(M): The enabling of M transition is given by nvector. j at marking j(M):  (N) n Trepresents theMPN marking initial markingdegree MI and PR The enabling degree of transition nj(M) = min{mk / w kj : Pk  °TTj}j at marking M is given by nj(M): (1) nj(M) = min{mk / wPRkj : Pk  °Tj} (1) nj(M) =°Tmin{m wPRthe : PkofT°T (1) places, mk is the marking where k /for kj set j} j stands j upstream theentry set ofofTmatrix marking where j upstream k is the , wPRkj for is the WPR places, in row kmand column j. A of place°TPj kstands , wPRkj for is the WPR places, in row kmand column j. A of place°TPj kstands theentry set ofofTmatrix marking where j upstream k is the of place Pk, wPRkj is the entry of matrix WPR in row k and column j. A

Copyright © 2016, 2016 IFAC 384Hosting by Elsevier Ltd. All rights reserved. 2405-8963 © IFAC (International Federation of Automatic Control) Copyright 2016 responsibility IFAC 384Control. Peer review©under of International Federation of Automatic Copyright © 2016 IFAC 384 10.1016/j.ifacol.2016.07.635

IFAC MIM 2016 June 28-30, 2016. Troyes, France

Dimitri Lefebvre / IFAC-PapersOnLine 49-12 (2016) 384–389

transition Tj is enabled at marking M if and only if (iff) nj(M) > 0, this is denoted as M [Tj >. The amount in which Tj fires is an integer  that satisfies 0 <   nj(M) and the marking varies according to M = M’ – M = .W(:, j), where W(:, j) is the column j of incidence matrix. This is denoted by M [Tj > M’ or by M’ = M +.W.Xj where Xj is the firing count vector of transition Tj (David & Alla, 1992). An untimed firing sequence  fired at marking MI is defined as  = T(j1)T(j2)…T(jh) where j1,... jh are the labels of the transitions. X() is the firing count vector associated to , || = ||X()||1 = h is the length of  (|| . ||1 stand for the 1-norm), and  =  stands for the empty sequence. When  and ’ are two sequences,  ’ stands for the concatenation of  and ’. The untimed firing sequence  fired at M leads to the untimed marking trajectory (,M): (,M) = M [T(j1) > M(1)…. M(h-1) [T(jh) > Mref.

385

combined with a model predictive control (MPC) approach based on the minimization of the cost function JEucl: JEucl(M,Mref) = (M - Mref)T.In.(M - Mref)

(4)

that corresponds to the Euclidean distance from the marking M to the reference Mref in marking space (In stands for the identity matrix of dimension n x n). Sufficient conditions have been stated so that the proposed method converges to the reference (Lefebvre & Leclercq, 2015) but, in comparison with the exhaustive search, optimality cannot be ensured and near minimal length sequences are obtained (instead of minimal ones). One reason that explains sub-optimality is that the Euclidean distance in marking space does not always explain how “far” two markings are in terms of firing sequences. Moreover with criterion (4), the marking may be attracted by local minima that are due to hill-climbing phases (i.e. phases during which the distance to reference necessarily increases before it decreases). In the next section, a more efficient cost function is proposed.

(2)

where M(1),...,M(h-1) are the intermediate markings and Mref is the final marking. A marking M is said reachable from initial marking MI if there exists a firing sequence  such that (s.t.) MI [ >M and  is said feasible at MI. R(G, MI) is the set of all reachable markings from MI.

3.2. Cost function based on the remaining firing count vector In this section, the criterion (4) is replaced by an estimation of the number of firings required to reach the reference Mref from the marking M. This estimation is based on the computation of the firing count vector X that satisfies Mref – M = W.X according to an integer optimization problem. For that purpose let us first detail a transformation of the incidence matrix with Proposition 1:

2.3. Control design for PNs and TPNs For control issues, the set of transitions T is divided into 2 disjoint subsets TC, and TNC such that T = TC  TNC. TC is the subset of qC controllable transitions, and TNC the subset of qNC uncontrollable transitions. The firing of controllable transitions that are enabled can be enforced or avoided by the controller whereas the firing of uncontrollable transitions cannot be driven by the controller. R(GC, MI)  R(G, MI) is the set of all reachable markings from initial marking MI by firing only controllable transitions and GC = where WPR_C, WPO_C are extracted from matrices WPR and WPO by considering only the controllable transitions. Depending on the control application, some forbidden markings may be also specified. For this purpose, the function LEGAL is defined for any marking M  R(GC, MI) as LEGAL(M) = 0 if the marking is forbidden else LEGAL(M) = 1 and RL(GC, MI)  R(GC, MI) is the set of markings that are legal. The objective of the proposed control design is to reach a reference marking Mref  RL(GC, MI) starting from initial marking MI with a trajectory of minimal length (for PNs) or minimal duration (for TPNs) that has no uncontrollable transition and that visits no forbidden marking.

Proposition 1: Let consider a PN structure G = with W = WPO – WPR  (Z) nq (Z is the set of positive and negative integer numbers) of rank r. There exists a regular matrix PL  (Z) nn and a regular permutation matrix PR  {0,1} qq such that: 𝑊𝑊 𝑊𝑊 ′ = 𝑃𝑃𝐿𝐿 . 𝑊𝑊. 𝑃𝑃𝑅𝑅 = ( 11 𝑊𝑊21

𝑊𝑊12 ) 𝑊𝑊22

(5)

where W11 =  (Z) rr is an integer regular (i.e. of rank r) upper triangular matrix, W21 = 0(n-r)r and W22 = 0(n-r)(q-r) (i.e. zero matrices of appropriate dimensions). Proof: the proof consists in the iterative construction of the regular matrices PL  (Z) nn and PR  {0,1}qq. Let w1min = wi*j* such that |wi*j*| = min (|wij| : i = 1,…,n, j = 1,…,q). There exists two permutation matrices Pleft1  {0,1} nn and Pright1  {0,1} qq such that w1min is placed in the upper left corner of matrix Pleft1.W.Pright1. There also exists a regular diagonal matrix Dleft1: 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠(𝑤𝑤 1 𝑚𝑚𝑚𝑚𝑚𝑚 ) 0 ) 𝐷𝐷𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙1 = ( 0 𝐼𝐼𝑛𝑛−1

3. Model predictive control for untimed Petri nets The basic idea of MPC is to anticipate the evolution of the system in order to achieve the control objective. At each step, a cost function is minimized, possibly under some constraints. A sequence of control actions is obtained. The first action of this sequence is applied and the prediction starts again from the new state reached by the system (Richalet et al., 1978; Camacho & Bordons, 2007).

with sign(x) = 1 if x > 0, sign(x) = 0 if x = 0 and sign(x) = -1 if x < 0. Finally there exists a lower triangular regular matrix Cleft1:

3.1. Cost function based on Euclidean distance

𝛼𝛼 𝐶𝐶𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙1 = ( 1 𝑋𝑋

0 ) 𝐼𝐼𝑛𝑛−1

𝑊𝑊 1 𝑊𝑊1 = ( 111 𝑊𝑊 21

𝑊𝑊 112 ) 𝑊𝑊 1 22

with 1 > 0, such that W1 = Cleft1.Dleft1.Pleft1.W.Pright1 = PL1.W.PR1 with:

In our previous works, an adaptation of the Dijkstra algorithm has been used to compute the set of legal marking trajectories with minimal length H* from MI to Mref when only controllable transitions are fired. This algorithm was based on a partial exploration of the PN reachability graph so that this subgraph rooted in MI includes only legal markings, reaches Mref and has the smallest depth (Lefebvre & Leclercq, 2015). The main difficulty with this algorithm is the exponential complexity with respect to (wrt) the depth of the exploration: the method is time consuming and not acceptable when the markings MI and Mref are far from each other. In order to overcome this difficulty the partial exploration of reachability graphs has been

and W111 = w1min  (Z)11 of rank 1, W112 =  (Z) 1(n-1), W121 is a zero matrix of dimensions (n-1)x1 and W122  (Z) (n-1)x(q-1) is of rank r-1. The matrix PL1  (Z) nn is regular and PR1  {0,1} qq is a permutation matrix. The same transformation is repeated r times so that finally (5) holds with:

385

IFAC MIM 2016 386 June 28-30, 2016. Troyes, France

𝑊𝑊11 = 𝑊𝑊

𝑟𝑟

11

1 𝑤𝑤𝑚𝑚𝑚𝑚𝑚𝑚 =( 0 0

𝑋𝑋 ⋱ 0

Dimitri Lefebvre / IFAC-PapersOnLine 49-12 (2016) 384–389

𝑋𝑋 𝑋𝑋 )

Note that J(M,Mref) includes the constraints to avoid the forbidden markings but J(M,Mref) is not a distance ( J(M,Mref) ≠ J(Mref,M)). Note also that (8) is a lower bound of the remaining number of firings because it may encode some spurious solutions (i.e. non feasible or non legal marking trajectories).

𝑟𝑟 𝑤𝑤𝑚𝑚𝑚𝑚𝑚𝑚

of rank r, W21 and W22 are zero matrices of appropriate dimensions. The transformation introduced with Proposition 1 is then applied to the structure GC of the controllable part of any PN systems and is used to reformulate the integer optimization problem (6) with qC variables as a reduced integer optimization problem (7) with qC-r variables. Proposition 2: Let consider a PN system with a set TC of qC controllable transitions so that GC = with WC = WPO_C – WPR_C  (Z) nqc of rank r. The integer optimization problem (6) with variable X of dimension qC: Min {||X||1: X =  (Z) qc} such that: X  0 and W.X = (Mref – MI)

(6)

is equivalent to the reduced integer optimization problem (7) with variable X2 of dimension qC-r: Min {f.X2 : X2 =  (Z) qc-r} such that:

(𝑊𝑊 )−1 . 𝑊𝑊12 (𝑊𝑊 )−1 . 𝛥𝛥𝛥𝛥1 ( 11 ) . 𝑋𝑋2 ≤ ( 11 ) −𝐼𝐼𝑞𝑞𝑞𝑞−𝑟𝑟 0𝑞𝑞𝑞𝑞−𝑟𝑟

(7)

with f = (1qc)T.(Pd2 – Pd1.(W11)-1.W12), Pd = (Pd1 | Pd2), Pg = ((Pg1)T | (Pg2)T)T and M1 = Pg1. (Mref – MI).

3.3. Optimization algorithm for PN The basic idea is to use the performance criterion (8) that evaluates how “far” from the reference the current marking is to drive the search in reachability graph. For any integer H ≥ 0 and any marking M  RL(GC, MI), the following notations are introduced:  (M,H) is the set of untimed control sequences  issued from M s.t. (,M) visits no forbidden marking and || ≤ H.  For all   (M,H), J(,M,Mref) = J(M’,Mref) with M [ > M’ *(M,H)  (M,H) is the subset of firing sequences  issued from  M s.t. J(,M,Mref) = min{ J(’,M,Mref) : ’  (M,H)} Algorithm 1 explores a local area of the reachability graph rooted at M. Such an area is limited by the length of the sequences that are encoded to limit the computational effort. It is not required that the whole sequence that drives the marking from MI to Mref belongs to this local area but the algorithm searches a sequence * that minimizes the criterion J(,M,Mref) in order to move the marking near to Mref. The next transition T* to fire is the first transitions of *. When *(M,H) contains several sequences, * will be preferred as the shortest one. Algorithm 1 also returns the output converge that indicates that a solution exists:  converge = -1 if the selected sequence satisfies  = ,  converge = 1 if the selected sequence satisfies M [ > Mref,  converge = 0 elsewhere.

Proof: let us apply Proposition 1 to the structure GC of the controllable part of the consider PN and compute the matrices PL  (Z) nn , PR  {0,1} qcqc and W’ =  (Z) nqc. Let then introduce M’ = PL.(Mref – MI) = (M1T M2T)T with M1  (Z)r, M2  (Z)n-r and X’ = (PR)-1.X = (X1T X2T)T with X1  (Z)r, X2  (Z)qc-r. Note that the constraint W.X = (Mref – MI) is equivalent to:

Algorithm 1: computation of the next transition to fire for PN (Inputs: M,Mref,TC,LEGAL,H; Output: converge, T*) (M,H)  , converge  0, T*   1. 2. for h from 0 to H 3. for all   (M,H) s.t. ||=h 4. compute M' s.t. M [ > M' 5. for each controllable transition T enabled at M’ 6. compute '   T and M" s.t. M’ [T > M” 7. if (LEGAL(M”) = 1) and (|’|  H) (M,H)  (M,H)  {’} 8. 9. end if 10. end for 11. end for 12. end for 13. *(M,H){  (M,H) s.t. (,M,Mref) = min{ J(’,M,Mref) : ’  (M,H)}} 14. **(M,H)  argmin{|| s.t.   *(M,H)} 15. if {} = **(M,H), 16. converge  -1, T*   17. else 18. select T* as the first transition in the sequences * in **(M,H) 19. end if 20.if M [* > Mref 21. converge  1 22.end if

X1 = (W11)-1.M1 - (W11)-1. W12.X2 with X2  (Z)qc-r The constraint X  0 is equivalent to X’  0 (PR is a permutation matrix) that leads to the constraints in (7). Additionally, the cost function in (7) is also equivalent to the cost function in (6). Thus, as long as Pd1.(W11)-1.M1 is constant: Min {(1qc)T.(Pd1.(W11)-1.M1 + Pd2.X2 - Pd1.(W11)-1.W12.X2) with X2  (Z) qc-r} is equivalent to min {f.X2 : X2 =  (Z) qc-r} with f = (1qc)T.(Pd2 – Pd1.(W11)-1.W12).  Proposition 3: The linear multivariable optimization problem (7) has a solution with integer values if Mref  R(GC, MI). Proof: the proof is a trivial consequence of Proposition 2 (optimization problems (6) and (7) are equivalent) and (6) admit necessarily an integer solution as long as Mref is reachable by firing only controllable transitions. Thus (7) admits also an integer solution.

Note that several sequences may also exist in **(M,H) and several candidates also exist for T*. In that case, T* is chosen among the set of candidates.

From Propositions 1 to 3, an approximation of the number of firings required to reach Mref from M is obtained as: J(M,Mref) = (1qc)T.(Pd1.(W11)-1.M1 + Pd2.X2 - Pd1.(W11)-1.W12.X2) where X2 is the solution of (7) (8) 386

IFAC MIM 2016 June 28-30, 2016. Troyes, France

Dimitri Lefebvre / IFAC-PapersOnLine 49-12 (2016) 384–389

387

T3 T5 T5 T6 T2 T2 T4 is found. Necessary and sufficient conditions on parameter 𝐻𝐻 that ensure the convergence from MI to Mref are given by proposition 4.

3.4. Discussion about the depth H of the search Algorithm 1 is iteratively used to reach Mref from MI. Its most important parameter is the maximal length H of the firing sequences that are considered. If at a given step k, H is too small, Algorithm 1 may result in **(M,H) = {}. Such a situation occurs due to hill climbing phases in the variations of criterion (8) because the resolution of the problem (7) includes also spurious solutions in terms of vector X. In that case, the parameter H should be enlarged. Consider PN1 with TC = T, all reachable markings are assumed to be legal, MI = (1 0 0 0)T and Mref = (1 0 0 3)T in Fig. 1 as an example:

Proposition 4: Let us consider a PN structure G = , a set TC of controllable transitions, a function LEGAL that defines the forbidden markings, an initial marking MI  (N) n and a reference marking Mref  RL(GC, MI). If no uncontrollable transition fires and (7) has no spurious solution (i.e. the solution corresponds to a feasible sequence), then the iterative use of Algorithm 1 drives the marking from MI to Mref with a sequence of minimal length |X*| where X* is the solution of (7). Proof: if Mref  RL(GC, MI) and no uncontrollable transition fires, there exist K  0 and a firing sequence  = T(1)T(2)…T(K) such that the marking trajectory (, MI) ends with Mref. If in addition (7) has no spurious solution, then the resolution of (7) leads to X() and J(MI,Mref) = ||X()||1 = K. Starting Algorithm 1 with initial marking MI and depth H, there exists a marking M’ encoded in partial reachability graph and two sequences ’ and ” such that MI [’ > M’ and M’ [” > M” with |’| = H and J(M’,Mref) = ||X(”)||1 = K-H. The first transition T(j1) of sequence ’ fires, MI [T(j1) > M(1) and the algorithm starts again from M(1). The resulting trajectory MI [T(j1) > M(1)…. M(K-1) [T(jK) > Mref reaches the reference and is of minimal size. 

Fig. 1: PN1 with MI = (1 0 0 0)T J(MI, Mref) = 1 because W.(0 0 0 0 1)T = (0 0 0 3)T = Mref – MI but T5 is not enabled at MI due to the weight wPR15 = 2 and so  = T5 is not encoded in the partial graph (i.e. (0 0 0 0 1)T is a spurious solution) . For H = 1, the set *(M,H) remains empty and H must increases until the solution * = T1 T3 T3 T5 T2 T2 T4 is found. On the contrary, if H is too large, then the iterative use of Algorithm 1 certainly reaches Mref but the computational effort is uselessly high. For these reasons it is important to adapt the parameter H at each step in range [𝐻𝐻 ∶ 𝐻𝐻] where 𝐻𝐻 and 𝐻𝐻 are input parameters, so that H is just large enough to find the next transition to fire. The complete adaptation of H is obtained with an algorithm detailed in our previous work (Lefebvre & Leclercq, 2015). At each step k  1, Algorithm 1 starts with M(k1) (as defined in equation (2)) and H(k) = max(𝐻𝐻,H(k-1)-1). Then parameter H(k) increases as long as converge(k) = -1. When converge(k) = 0, T*(jk) is selected, the new marking M(k) is computed with M(k-1) [T*(jk) > M(k) and Algorithm 1 starts again with M(k). When an uncontrollable transition fires, the execution is interrupted and Algorithm 1 starts again with the new initial marking Mnext resulting from the firing of the uncontrollable transition. Mref should satisfy Mref  RL(GC, Mnext) to ensure convergence. A backtracking procedure that restarts the search from MI is also included to enlarge 𝐻𝐻 when a deadlock is reached that is not a priori detected as a forbidden marking (i.e. converge(k) = -2). Consider PN2 with TC = T, all reachable markings are assumed to be legal, MI = (1 0 0 0 0)T and Mref = (0 0 0 1 3)T in Fig. 2 as an example:

Moreover, if no uncontrollable transition fires and (7) has no spurious solution, the criterion J(M(k),Mref), k = 1,…,K is monotonic strictly decreasing over the marking trajectory from MI to Mref. In that case H = 1 is enough to reach Mref with a sequence of minimal length. 3.5. Examples PN3 of Fig 3 with TC = T is a controlled unbounded PN with weighted arcs. The cycle in the left side is marking producer and the cycle in the right side is marking consumer. P1

T1

T2

P2

P3

T3

T4

2

2

Fig. 3: Example PN3 Consider the initial marking MI = (1 0 0)T, and the cycle that increases the marking m1 up to 10 and then decreases to 1. The sequence of reference markings is {Mref1, Mref2} with Mref1 = (10 0 0)T and Mref2 = (1 0 0)T = MI is applied. All reachable marking are assumed to be legal. Minimal length firing sequences of size H*1 = 18 and H*2 = 27 are required to reach consecutively Mref1, then Mref2 from Mref1. The proposed MPC approach with parameters 𝐻𝐻= 1 and 𝐻𝐻= 10 and cost functions (8) and (4) are applied and compared in Fig. 4 and 5. One can notice the importance to define an appropriate marking criteria and the improvement obtained by replacing the Euclidean distance (Fig. 4) by the criterion (8) based on the number of firings (Fig. 5). In both cases, the two criteria JEucl(M,Mref) and J(M,Mref) are computed and reported in the same figure. In both cases, the convergence is obtained but only the cost function (8) leads to a minimal size control sequence. In particular, one can notice that the sequence required to reach Mref2 from Mref1 is suboptimal with Euclidean distance (4). The reason is that only the firing of transition T3 increases the marking of place P1 but the firings of both transitions T1 and T2 decrease the marking of place P1. Thus for small values of

Fig. 2: PN2 with MI = (1 0 0 0 0)T J(MI, Mref) = 2 because W.(0 0 0 0 1 1)T = (-1 0 0 1 3)T = Mref – MI and so *(MI,1) = {T5} but  = T5 T6 is a spurious solution. Algorithm deadlocks at (0 0 0 1 0)T for H = 1. The backtracking phase is necessary to increase H at initial marking until the solution * = T1 T3 387

IFAC MIM 2016 388 June 28-30, 2016. Troyes, France

Dimitri Lefebvre / IFAC-PapersOnLine 49-12 (2016) 384–389

𝐻𝐻, the proposed method selects not only T2 but also T1 as a potential transition to fire and the size and the duration of control sequences uselessly increase. Moreover, one can notice that the cost function (8) is monotonic decreasing (Fig. 5), whereas (4) is not (Fig. 4). For the considered example, the depth of the search does never exceed H = 1 with (8) (the conditions of Proposition 4 are satisfied) and the maximal size of the partial reachability graph explored at each step does not exceed 4.

reference unreachable until the second perturbation occurs at step 10 and leads to Mnext 2 that satisfies Mref  R(GC, Mnext 2).

First perturbation

Second perturbation

Fig.6: MPC for PN3 and TC = {T1, T3, T4} with cost function (8): Marking of the places P1 (up) to P3 (bottom) PN4 with TC = T is the model of a manufacturing system (Fig. 7). The system is similar to the one studied in (Hu & Li, 2009). The five resources P22 to P26 have limited capacities: m(P22) = m(P23) = m(P24) = m(P26) = 2 and m(P25) = 3. The system produces three types of parts according to three jobs. With initial marking MI = (2 0 0 0 0 0 2 0 0 0 0 0 0 0 0 3 0 0 0 0 0 2 2 2 3 2)T (i.e. MI = 2P1 + 2P7 + 3P16 + 2P22 + 2P23 + 2P24 + 3P25 + 2P26), PN4 has 1212 states, no forbidden marking but is deadlock susceptible due to the circular-wait that occurs among relative operations and resources. It can be verified that 26 different deadlock markings exist.

Fig.4: MPC for PN3 and TC = T with cost function (4): Marking of the place P1 (up); Marking criteria JEucl(M,Mref) (bottom , full line) and J(M,Mref) (bottom , dashed line)

Fig.5: MPC for PN3 and TC = T with cost function (8): Marking of the place P1 (up); Marking criteria J(M,Mref) (bottom , full line) and JEucl(M,Mref) (bottom , dashed line) An advantage of the proposed approach is that the optimization process starts again for each step k. Any disturbance (i.e. any firing of uncontrollable transition) that occurs at step k changes the future predictions and the control actions computed at step k+1, k+2,... reject the perturbations as long as the marking Mnext resulting from the firing of an uncontrollable transition satisfies Mref  R(GC, Mnext). To illustrate the perturbation rejection, PN3 is considered again with initial marking MI = (1 0 0)T and reference marking Mref = (10 0 0)T. The controllable transitions are TC = {T1, T3, T4} and T2 is assumed to be uncontrollable and to fire randomly according to a fixed ratio equal to 0.1. As illustrated in Fig. 6, Mref is successfully reached with a firing sequences of size H = 23. Note that in the present case, the first perturbations occurs at step 4 and leads to Mnext 1 that makes the

Fig. 7: PN4 model of a manufacturing system (Hu & Li, 2009) In order to compare the performance of the MPC approach with the two marking criteria in a systematic way, a set of 800 reference markings is considered and Algorithm 1 is applied with increasing values of parameter 𝐻𝐻. For each value of 𝐻𝐻, the success rate (i.e. the percentage of reference markings for which convergence is obtained over the set of 800 reference markings), the mean computational time, and the mean oversize error (i.e. the control sequences length minus the length of minimal control sequences) are detailed in Tables 1 and 388

IFAC MIM 2016 June 28-30, 2016. Troyes, France

Dimitri Lefebvre / IFAC-PapersOnLine 49-12 (2016) 384–389

2. From these tables, it appears obviously that the criterion (8) has better performances than (4). The success rate is significantly higher for (8) than for (4). In addition, the mean oversize error more or less equals zero with (8). This means that the control sequences found by Algorithm 1 are almost always of minimal length. But the computation time also increases with (8) due to the resolution of the integer optimization problems at each steps. The two tables also illustrate that the larger 𝐻𝐻 the bigger the success rate.

TABLE 1: Performance evaluation of marking criterion (4) 1 2 3 4 5 𝐻𝐻 Success rate 3.2% 9.9% 22% 38% 55% Mean comp. time 0.01 0.02 0.06 0.19 0.89 Mean oversize err. 0 0.10 0.31 0.50 0.74

6 67% 3.39 0.88

TABLE 2: Performance evaluation of marking criterion (8) 1 2 3 4 5 𝐻𝐻 Success rate 38% 59% 69% 77% 84% Mean comp. time 0.8 2.37 16.2 4.67 10.3 Mean oversize err. 0 0 0 0 0

6 93% 25.1 1.12

389

P. Chretienne, Timed Petri nets: A solution to the minimum-timereachability problem between two states of a timed-event-graph, Journ. Systems and Software, vol. 1, no. 2, pp.95–101, 1986. R. David and H. Alla, Petri nets and grafcet – tools for modelling discrete events systems, London: Prentice Hall, 1992 H. Hu and Z. Li, Local and global deadlock prevention policies for resource allocation systems using partially generated reachability graphs, Computers & Industrial Engineering, 57: 1168–1181, 2009. M.D. Jeng, S.C. Chen, Heuristic search approach using approximate solutions to Petri net state equations for scheduling flexible manufacturing systems. Int J FMS, vol. 10, no. 2, pp. 139–162, 1998. D.Y. Lee, F. DiCesare, Scheduling flexible manufacturing systems using Petri nets and heuristic search, IEEE Trans. Robot. Autom. vol. 10, no. 2, pp.123–133, 1994. D. Lefebvre, Approaching minimal time control sequences for timed Petri nets, to appear IEEE Trans. Aut. and Science Eng., 2015. H. Lei, K. Xing, L. Han, F. Xiong, Z. Ge, Deadlock-free scheduling for flexible manufacturing systems using Petri nets and heuristic search, Computers & Industrial Engineering, vol. 72, pp. 297–305, 2014. P. Ramadge and W. Wonham, Supervisory control of a class of discrete event processes, SIAM J. Cont. and Opt., 25(1): 206-230, 1987. C. Ramchandani, Analysis of asynchronous concurrent systems by timed Petri nets, Ph. D, MIT, USA, 1973. A. Reyes-Moro, H. Hu G. Kelleher, Hybrid Heuristic Search for the Scheduling of Flexible Manufacturing Systems Using Petri Nets, IEEE Trans. Robotic and Autom., vol. 18, no. 2, pp. 240-245, 2002. J. Richalet, A. Rault, J. Testud and J. Papon, Model predictive heuristic control: Applications to industrial processes, Automatica, 14: 413-428, 1978. T.H. Sun, C.W. Cheng, L.C. Fu, Petri net based approach to modeling and scheduling for an FMS and a case study. IEEE Trans. Ind. Electron., vol. 41, no. 6, pp. 593–601, 1994. Q. Wang, Z. Wang, Hybrid Heuristic Search Based on Petri Net for FMS Scheduling, Energy Procedia, vol. 17 pp. 506 – 512, 2012 H.H. Xiong, M.C. Zhou, Scheduling of semiconductor test facility via Petri nets and hybrid heuristic search. IEEE Trans. Semicond. Manuf. vol. 11, no. 3, pp. 384–393, 1998. W. Zhang, T. Freiheit, H. Yang, Dynamic scheduling in flexible assembly system based on timed Petri nets model, Robotics and Computer-Integrated Manufacturing, vol. 21, pp. 550–558, 2005.

4. Conclusion A method that incrementally computes control sequences that approach the minimal length for untimed PNs and minimal duration for timed PNs has been proposed. This method is based on a partial exploration of the reachability graph combined with a performance criterion that evaluates the remaining firing count vector to the reference. This method has some advantages in comparison with numerous existing approaches. The method limits the part of the reachability graph that is expanded even if the initial and reference markings are far one from each other. It also updates the control actions when uncontrollable transitions fire and avoids forbidden markings and deadlocks without adding any monitor place. Compared to our preceding works based on the Euclidean distance to the reference, it decreases significantly the size and duration of the control sequences. In our next works, the selection of transition T* among the acceptable candidates will be refined at first. Then, the backtracking part of the algorithms will be improved by searching on-line the deadlocks and including some restart points on the trajectory. From a methodological point of view, it will be interesting to study the compromise between the classical Euclidean distance and the proposed criteria in terms of neighborhood in the reachability graph. The proposed approach will also be extended to timed Petri nets. For that purpose, time criteria will be studied to evaluate the remaining time to reference. An open question concerns the extension to timed systems with non-deterministic durations associated with some transitions. Finally, continuous and discrete time MPC will be combined for hybrid system control applications. References B. Abdallah, H.A. ElMaraghy, T. ElMekkawy, Deadlock-free scheduling in flexible manufacturing systems. Int J. Prod. Res. vol. 40, no. 12, pp. 2733–2756, 2002. F.Basile, R. Cordone and L. Piroddi, Integrated design of optimal supervisors for the enforcement of static and behavioral specifications in Petri net models, Automatica, 49: 3432-3439, 2013. E. Camacho and A. Bordons, Model predictive control, London: Springer Verlag, 2007. C. Cassandras, Discrete Event Systems: Modeling and Performances Analysis, Aksen Ass. Inc. Pub., 1993.

389