**1. Introduction**

While competing for a finite number of resources in a flexible manufacturing system (FMS), e.g., robots and machines, each part has a particular operational flow that determines the order in which such resources are needed. However, such competition for shared resources by concurrent job processes can lead to a system deadlock. It occurs when parts are blocked waiting for shared resources held by others that will never be granted. Its related blocking phenomena often incur unnecessary overhead cost, e.g., a long downtime and low utilization rate of some critical and expensive resources, possibly leading to a catastrophic outcome in some highly automated FMS. Therefore, an efficient deadlock control policy must be developed to ensure that deadlocks do not occur. Having received considerable attention in literature, deadlock is normally prevented by using an offline computational mechanism to control the resource requests in order to avert deadlocks. Fanti and Zhou1 introduce three fundamental methods (i.e. prevention, detection and avoidance) to solve the deadlock problems. Deadlock prevention aims to impose system constraints to prevent a deadlock. Importantly, deadlock prevention algorithms do not require run-time costs since the problems are solved in system design and planning stages. This study belongs to the deadlock prevention field.

Petri nets (PN)2 have been recognized as one of the most powerful formal methods for modeling FMS. The reason is that they are well suited to represent such FMS characteristics as precedence relations, concurrence, conflict and synchronization. Their analysis methods used for deadlock prevention in FMS include structural analysis and reachability graphs. Deadlock prevention and avoidance schemes have been developed for controlling FMS3-8 by using the former. In particular, deadlock prevention problems are solved using the concept

© 2012 Pan, licensee InTech. This is an open access chapter distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. © 2012 Pan, licensee InTech. This is a paper distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### 52 Petri Nets – Manufacturing and Computer Science

of siphons3-6. Li & Zhou propose an elementary siphon control policy (ESCP) to reduce the redundant siphons to obtain structurally simpler controllers9-10. However, they cannot obtain optimal ones. Reachability graph methods are used to obtain the live system behavior11-14. Without confining to a certain class of FMS, they can provide an optimal deadlock controller by adopting the theory of regions15. The theory is originally developed for a transition system (TS). A state-based representation with arcs labeled with symbols from an alphabet of events in a TS can be mapped into a PN model. For an elementary TS (ETS) there exists a PN with minimum transition count (one transition for each label) with a reachability graph isomorphic to the original TS.

A Computationally Improved Optimal Solution

for Deadlocked Problems of Flexible Manufacturing Systems Using Theory of Regions 53

A Petri net (*PN*) is a 5-tuple *N =* (*P, T, F, W, M*0) where *P* is a finite set of places; *T* is a finite set of transitions, with *P T* ≠ and *P T* = ; *F*  (*P*×*T*) (*T*×*P*) is the set of all directed arcs, *W*: (*P*×*T*) (*T*×*P*) → is the weight function where = { 0, 1, 2, …}, and *M*0: *P* → is the initial marking. A *PN* is said to be ordinary, denoted as (*P, T, F*), if *f F*, *W*(*f*) = 1. [*N*]*+*(*p, t*) *= W*(*p, t*) is the input function that means the multiplicity of a directed arc from *p* to

arc from *t* to *p* if (*t*, *p*)*F*. The set of input (resp., output) transitions of a place *p* is denoted by •*p* (resp., *p*•). Similarly, the set of input (resp., output) places of a transition *t* is denoted by •*t* (resp., *t*•). A PN structure *(P, T, F, W)* is denoted by *N*. A PN with a given initial

A PN is said to be pure if no place is both input and output places of the same transition. The so-called incidence matrix [*N*] of a pure Petri nets is defined as [*N*] = [*N*]- [*N*]+. A

at least *W*(*p*, *t*) tokens, as denoted by *M*[*t*>. A transition may fire if it is enabled. In an ordinary net, it is enabled iff *p* •*t*, *M*(*p*) 1. Firing *t* at *M* gives a new marking *M*such that *p P*, *M*(*p*) = *M*(*p*) – *W*(*p*, *t*) + *W*(*t*, *p*). It is denoted as *M*[*t*>*M*. *M* indicates the number of tokens in each place, which means the current state of the modeled system. When *Mn* can be reached from *M*<sup>0</sup> by firing a sequence of transitions σ, this process is denoted by *M* [σ >

. The set of all reachable markings for a PN given *M*<sup>0</sup> is denoted by *R*(*N*, *M*0). Additionally, a definition of linearized reachability set (using the state equation) is defined as ( *R N*,

equation into a set of linear constraints. The markings in ( *R N*, *M*0) - *R*(*N*, *M*0) are called *spurious ones* (with respect to the state equation)20*.* They may also be the solutions of the state equation but not reachable markings. In this work, ones just focus on the reachable

A transition *t* is said to be *live* if for any *M R*(*N*, *M*0), there exists a sequence of transitions whose firing leads to *M'* that enables *t*. A PN is said to be *live* if all the transitions are live. A PN contains a *deadlock* if there is a marking *M R*(*N*, *M*0) at which no transition is enabled. Such a marking is called a dead marking. Deadlock situations are as a result of inappropriate resource allocation policies or exhaustive use of some or all resources. Liveness of a PN means that for each marking *M R*(*N*, *M*0) reachable from *M*0, it is finally possible to fire *t*, *t T* through some firing sequence. (*N, M*0) is said to be *reversible*, if *M R*(*N*, *M*0), *M*<sup>0</sup> *R*(*N*, *M*). Thus, in a reversible net it is always possible to go back to initial

is reachable from *M*. Reversibility is a special case of the home state property, i.e. if

. Here,

transition *t* is said to be enabled at marking *M*, if *p* •*t, M*(*p*)

= *M*0, then the net is reversible.

*Mn* and satisfies the *state equation Mn* = *M* + [*N*]

(*p, t*) *= W*(*t, p*) is the output function that means the multiplicity of a directed

)}. This definition is suitable for the incorporation of the state

( )*<sup>t</sup>* indicates the algebraic sum of all occurrences of *t* in

is said to be a *home state*, if for each marking *M R*(*N*,

 *W*(*p, t*)*, or p* is marked with

is a vector of non-negative

**2. Preliminaries** 

**2.1. Petri nets2**

*t* if (*p*, *t*)*F*. [*N*]*-*

marking is denoted by (*N, M*0).

integers, called a *firing vector*, and

marking (state) *M*0. A marking *M*

*M*0)={*M*: *M* = *M*0 +[*N*](•

markings.

*M*0), *M*

the home state *M*

Uzam12 follows the theory of regions15 to define a deadlock-zone (DZ) and deadlock-free zone (DFZ) for preventing deadlocks. Hence, the concept of DZ and DFZ is used to solve ESSPs. An optimal controller can be obtained but suffers from many redundant control places. Ghaffari *et al.*13 propose a unique interpretation of the theory of regions and define *MF* (*forbidden marking*), *MD* (*dangerous marking*), *ML* (*legal marking*), and (the set of *marking*/*transition-separation instances* or MTSI). An optimal PN controller synthesis method for FMS is proposed based on both MTSI and the theory of regions. Unfortunately, redundant MTSIs cannot be entirely avoided for large FMS cases.

To reduce redundant control places, Li *et al.*16 adopt a combined algorithm based on siphon control and the theory of regions15. Its advantage is that the number of separation instances is significantly reduced after some sets of elementary siphons of a system are controlled. However, it fails to determine all sets of MTSIs and its application seems limited to some special nets only.

Uzam and Zhou propose an iterative control policy of liveness enforcement for PNs based on the theory of regions17. Less computation is required to obtain a controller. However, as indicated by Li et al18, it requires the repeated calculation of reachability graphs. Piroddi *et al.* propose a combined selective siphons and critical markings in a reachability graph algorithm to obtain optimal controllers via iterations19. They successfully identify the critical uncontrolled siphons and control them to make a deadlock-prone PN live. However, their algorithm also requires the repeated calculation of reachability graphs. Eventually, the controllers are not ordinary (i.e. they contain weighted arcs).

This work in this chapter aims to develop a computationally more efficient optimal deadlock control policy by using the theory of regions. It focuses on dead markings in a reachability graph. The concept of a crucial MTSI (CMTSI) is proposed to synthesize optimal controllers. The proposed method can reduce the computational burden of the MTSI method13 and redundant control places12-13. The experimental results indicate that it is the most efficient policy among all known ones12-13, 16 that can design optimal controllers.

Section 2 presents the basic definitions and properties of PNs and the theory of regions. Section 3 describes the proposed policy. Section 4 presents the experimental results. Section 5 gives the comparisons. Conclusions are made in Section 6.
