Mathematical Problems in Engineering

Volume 2015, Article ID 537893, 19 pages

http://dx.doi.org/10.1155/2015/537893

## Comparison and Evaluation of Deadlock Prevention Methods for Different Size Automated Manufacturing Systems

^{1}Industrial Engineering Department, College of Engineering, King Saud University, Riyadh 11421, Saudi Arabia^{2}Mechanical Engineering Department, Helwan University, Cairo 11792, Egypt

Received 13 January 2015; Revised 26 June 2015; Accepted 3 August 2015

Academic Editor: Yan-Jun Liu

Copyright © 2015 Emad Abouel Nasr et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

In automated manufacturing systems (AMSs), deadlocks problems can arise due to limited shared resources. Petri nets are an effective tool to prevent deadlocks in AMSs. In this paper, a simulation based on existing deadlock prevention policies and different Petri net models are considered to explore whether a permissive liveness-enforcing Petri net supervisor can provide better time performance. The work of simulation is implemented as follows. (1) Assign the time to the controlled Petri net models, which leads to timed Petri nets. (2) Build the Petri net model using MATLAB software. (3) Run and simulate the model, and simulation results are analyzed to determine which existing policies are suitable for different systems. Siphons and iterative methods are used for deadlocks prevention. Finally, the computational results show that the selected deadlock policies may not imply high resource utilization and plant productivity, which have been shown theoretically in previous publications. However, for all selected AMSs, the iterative methods always lead to structurally and computationally complex liveness-enforcing net supervisors compared to the siphons methods. Moreover, they can provide better behavioral permissiveness than siphons methods for small systems. For large systems, a strict minimal siphon method leads to better behavioral permissiveness than the other methods.

#### 1. Introduction

Effectively designing and operating an automated manufacturing system can be of assistance to manufacturers to adapt the variety in the market in order to maintain and confirm competitiveness. Different types of parts in AMS enter the system at discrete points of time and are produced concurrently; these parts have to share some common resources, such as robots, machine tools, buffers, automated guided vehicles, and fixtures. The deadlocks can occur in an AMS during its operation by shared resources competition, which are highly unwanted phenomena that often cause low use of some expensive and critical resources and long downtime and can lead to calamitous results in automated manufacturing systems. Therefore, it is required to develop a successful AMS control policy to prevent deadlocks occurrence in AMS.

There are several mathematical tools to solve deadlock problems in AMSs including automata, graph theory, and Petri nets. Recently, Petri nets have been known as one of the most robust mathematical tools for modelling, analyzing, and controlling deadlocks in resource allocation systems including AMS [1]. To overcome the deadlocks in AMS, there are methods which have been derived from a Petri net tool either to forbid the deadlock occurrences by preventing some necessary condition or to detect and resolve a deadlock when it occurs. In general, these methods can be classified into three strategies: deadlock detection and recovery, deadlock avoidance, and deadlock prevention [1, 2].

The researchers proposed three criteria for designing and evaluating a supervisor for a manufacturing system to be controlled. These criteria include behavioral permissiveness, which leads to increase in the resources utilization of system, structural complexity that leads to design supervisor with a few number of monitors to decrease the software and hardware costs, and computational complexity that means a deadlock control policy can be implemented in huge systems [1]. Therefore, the objectives of many researchers are to develop deadlock prevention policies which can provide liveness-enforcing supervisors with maximal permissiveness, a structural complexity, and computational complexity [1].

From previous studies, there are mainly two techniques of analysis for deadlock prevention in AMSs using Petri net: structural analysis [3, 4] and reachability graph analysis [5–7]. Oftentimes structural analysis is applied for structural objects of Petri nets, such as resource transition circuits and siphons. In this case, control steps are simple, and each empty minimal siphon requires a monitor to be added to prevent itself from being not emptied, but the disadvantages of this technique are the fact that the resulting controlled system can be suboptimal and linearly the number of control places is dependent on the size of a net [8].

The reachability graph analysis suffers from a state explosion problem because it requires listing of all or a part of reachable markings. The reachability graph of a Petri net has been classified into two zones: live zone (LZ) and deadlock zone (DZ). In DZ, there is first-met bad markings (FBMs) which are extracted from it; the FBMs are representing the very first entry from LZ to DZ. In this case, a control place is designed and added to forbid the FBM from being reached. This process requires iterations to forbid all FBMs and single out each FBM. The process is terminated if the resulting net is a live [9]. There are several methods and algorithms used for deadlocks prevention; some of them are siphon control methods, a theory of region, and iterative methods [4, 6, 9–11].

Most of the researchers have used structural analysis and reachability graph analysis to design deadlocks prevention policies for different scales of AMSs under three criteria that are maximal permissiveness, structural complexity, and computational complexity. The comparison between these policies has been done according to the three aforementioned criteria. It is taken for granted in the literature that a maximally permissive supervisor in the logical level usually leads to the better time performance in an AMS such as productivity and resource utilization, which looks intuitive, as an optimal supervisor will permit more permissive behavior. However, there is a shortage in the quantitative evaluation of time performance of these policies in terms of maximal permissiveness and productivity. Simulation is a powerful tool for performance analysis of complex manufacturing systems.

The contribution of this paper is using a simulation tool based on existing deadlock prevention policies and different types of Petri net models to explore whether a permissive liveness-enforcing Petri net supervisor can provide better time performance (maximal permissiveness).

The work of simulation is implemented in the following steps. (1) Assign the time to the controlled Petri net models, which leads to timed Petri nets. (2) Build the Petri net model using MATLAB software (Petri Net Toolbox (PN Toolbox)). (3) Run and simulate the model to obtain the system time performance. (4) Finally, the simulation results will be analyzed to determine which existing deadlock prevention policies are convenient for different types of manufacturing systems. Different control methods (siphon control methods and iterative methods) are used for deadlocks prevention. Moreover, this paper aims to evaluate the performance of the selected methods such as utilization of resources, plant throughput, the number of monitors, the number of arcs, and the number of reachable states. This paper focuses on the performance evaluation of automated manufacturing systems by using Petri nets under different deadlock prevention policies. The considered Petri net models belong to -nets [12] that are a general class of manufacturing-oriented net models in the literature. In an -net, there are a number of structural properties thanks to its definition [12].

Including this introductory section, the paper is organized as follows. Section 2 provides a literature review of previous researchers works related to deadlock prevention. The basics of Petri nets are discussed in Section 3. The deadlock prevention methods and policies are presented in Section 4. Sections 5 and 6 show the analysis of the selected methods for four different automated manufacturing systems. Finally, Section 7 presents the conclusion and future work.

#### 2. Literature Review

Deadlock prevention policies have been widely achieved for AMS and led to a huge number of results [1, 11]. In this section, deadlock prevention strategies are reviewed by using Petri nets and developed based on different techniques such as structural analysis and reachability graph analysis.

##### 2.1. Structural-Analysis Methods

Ezpeleta et al. [13] used a class of Petri nets, called System of Simple Sequential Processes with Resources (S^{3}PR) and proposed an algorithm for resource allocation in flexible manufacturing systems (FMSs). The proposed algorithm added new places to the net to impose certain restrictions that forbid the presence of unmarked siphons. The works of Huang et al. [14] and Huang et al. [15] present a new deadlock prevention policy for the class of Petri nets, where deadlocks are related to unmarked siphons. Two types of control places are added to the original model for flexible manufacturing system called ordinary control place and weighted control place to prevent siphons from being unmarked.

The study by Li and Zhou [11] presents a Petri net model which consists of 26 places, 20 transitions, and 18 strict minimal siphons. In [16], elementary siphons concept is introduced to design a liveness-enforcing Petri net supervisor for the same Petri net model, and six elementary siphons are obtained; therefore, only six monitors are added to control the 18 strict minimal siphons. Nevertheless, the proposed algorithm by Ezpeleta et al. [13] adds monitors for all 18 strict minimal siphons.

A new methodology is proposed by Huang [17] to synthesize supervisors for resource allocation in FMSs; the class of Petri net, namely, S^{3}PR, is considered, where deadlocks are related to unmarked minimal siphons; all minimal siphons should be controlled by adding control places. In this study, the number of control places is reduced by using the concept of the elementary siphon. Based on elementary siphons and -invariants concepts in Petri nets, a deadlock prevention algorithm is introduced by Li and Wei for a specific class of Petri nets which can properly model several FMSs [16], siphons in a Petri net model are classified into dependent and elementary siphons, and control places are added for all elementary siphons, so that the siphons are invariant-controlled. Therefore, the controllability of dependent siphons is guaranteed by adjusting the control requirements of its related elementary siphons. A novel deadlock prevention algorithm is presented by Chen et al. [1], and the concept of siphon extraction is used to compute unmarked siphons for the Petri net model. First, a siphon extraction algorithm obtains a maximal unmarked siphon, divides the places in it, and determines a necessary siphon from the divided places; this process is carried out for all unmarked siphons. Then, the proposed deadlock prevention algorithm designs a convenient monitor for each necessary siphon to be marked until the controlled Petri net model is a live.

Most of the deadlock control algorithms have been developed for reliable automated manufacturing systems (AMSs). Liu et al. [18] proposed a variety of deadlock control algorithms for AMSs with unreliable resources, monitors and recovery subnets are designed for strict minimal siphons (emptied siphon) and unreliable resources, respectively, and two types of arcs which are normal and inhibitor are used to connect monitors with recovery subnets. In order to obtain a supervisor with structural complexity, elementary siphons extracted from all strict minimal siphons are obviously controlled. The problems of structural complexity, behavioral permissiveness, and computational complexity are considered in the study of Wang et al. [19] to design liveness-enforcing supervisors for a class of Petri nets, namely, S^{3}PR, without -resources. They used two steps to obtain a supervisor for the model. In the first step, an algorithm is proposed to extract unmarked strict minimal siphons from a given unmarked siphon by using loop resource subsets. In the second step, a siphon-based deadlock prevention algorithm is introduced to provide a maximally permissive liveness-enforcing supervisor with small numbers and no weighted monitors.

##### 2.2. Reachability Graph-Based Approaches

Viswanadham et al. [20] presented static resource allocation methods for eliminating deadlocks; in this study, a reachability graph of the Petri net (PN) model is used to reach static resource allocation method. A deadlock prevention algorithm is implemented for a small size manufacturing system consisting of a machine and an automated guided vehicle (AGV). The authors observed that the proposed algorithm can be applied effectively only for small size manufacturing systems. The forbidden state problem of Petri nets (PN) with uncontrollable transitions and liveness requirement is addressed by Ghaffari et al. [5]. An approach is presented to compute a maximally permissive Petri net controller that consists of two steps. In the first step, an ordinary Petri net is used to build the system model. In the second step, control places are designed and added to the original model by using a theory of regions method. The work of Uzam [7, 9] proposes and improves method based on a theory of regions to design an optimal Petri net supervisor. The size of the reachability graph of Petri net model is a major problem to apply the deadlock prevention policy to very large Petri net model. Therefore, they proposed a reduction algorithm to simplify very large Petri nets models in order to make necessary computation easily. Based on the theory of regions, Uzam and Zhou [6] developed an iterative deadlock prevention policy for FMS. In their study, the reachability graph of a Petri net model is divided into two parts: deadlock-free zone (live zone, LZ) and the deadlock zone (DZ). The live zone is developed since the maximal strongly connected component contains the initial marking. The deadlock zone contains markings from which the initial marking is unreachable. FBM is defined as a marking in the deadlock zone. The deadlocks can be eliminated by forbidding the firing of the enabled transitions at FBM. In their work, the presented approach has two problems. First, an optimal supervisor cannot be guaranteed in general even if such an optimal supervisor exists. Second, at each iteration full reachability graph computation is required to check whether the markings in the deadlock zone are reachable. This approach is easy to use and simple if the reachable graph of a system is small but cannot ensure the supervisor behavioral optimality. The redundant monitors in Petri net supervisor may exist when the supervisor is designed by an iterative siphon control approach. Therefore, Uzam et al. [21] introduced an approach to identify and eliminate the redundant monitors by computing the reachability graph of a controlled Petri net model. If the controlled Petri net model does not lose liveness when removing redundant monitors, then the redundant monitors can be eliminated from the supervisor. The reachability graph and liveness check are the major problems in designing liveness-enforcing supervisor. To overcome a full state enumeration, Li and Hu [22] proposed two approaches to eliminating control places from a Petri net supervisor. The first approach is based on the concept of implicit places [23, 24]. The implicity of a monitor is computed by solving a linear programming problem (LPP) that can be implemented in polynomial time. The second approach is extracted from the Mixed Integer Programming- (MIP-) based deadlock detection approach. If the optimal solution to an MIP problem does not lose optimality when removing control place, then the control place is implicit and may provide permissive behavior while liveness is guaranteed. Chen et al. [1] developed a novel and computationally effective approach to design optimal monitors and an iterative approach that can compute the reachability graph to get an optimal supervisor of the flexible manufacturing system, which is demonstrated by a set of control places. The vector covering approach is used to compute the minimal sets of FBMs and legal markings. Iteratively, an FBM is selected from the minimal set of FBMs, an integer linear programming problem (ILPP) is used to design a place invariant (PI) that prevents the FBM from being reached, and all minimal sets of legal markings are not forbidden. The process is terminated if all FBMs cannot be reached and the resulting net is a live. This study is improved in its computational efficiency in [25], and the objective function of the ILPP is maximizing the number of FBMs that are prohibited by the PI; in other words, a control place is designed such that as many FBMs as possible are forbidden and all minimal sets of legal markings are not prohibited. If the ILPP has no solution, it means that there is no maximally permissive Petri net supervisor for the Petri net model.

#### 3. Basics of Petri Nets

Petri nets are a mathematical and graphical tool suitable for several systems. It is a major tool for studying and describing manufacturing system operations that are characterized as being asynchronous, concurrent, parallel, and distributed.

A Petri net or place/transition net can be defined as a four-tuple , where is a finite nonempty set of places, is a finite nonempty set of transitions, and are disjoint, are called nodes with and , and and are represented by circle and bar, respectively. is called a flow relation or directed arcs of the net that can be represented by arcs with arrows from places (transitions) to transitions (places). is a mapping that assigns a weight to an arc: if ; otherwise, , where and . is called an ordinary net, if , . Consider a node , and is a preset of . Postset of is . A marking of is a mapping from . denotes the number of tokens in place . Usually, markings and vectors can be described using formal sum. Therefore, vector is denoted by . For example, a marking that puts two tokens in place , five tokens in place , and no tokens in other places in a net is denoted by . () is a net system or marked net and is denoted by , where is an initial marking of . For a Petri net modeling represents the different raw parts that are to be synchronously processed in the system, and the state of resources, such as machines and robots. A net is self-loop free or pure if for all , and . Incidence matrix [] in a net is an integer matrix that consists of rows and columns with . The enabled rule for each at marking if , . As a result, enabled rule is denoted by . When a transition fires, it removes tokens from each place and deposits tokens in each place . Therefore, it yields a new marking , denoted by , where . is reachable from if there exists a fireable finite transition sequence , and markings , and so that , which can be denoted by and satisfied the state equation , where is a mapping in to the number of occurrences of in , called a Parikh vector or a firing count vector. Obviously, is the set of all reachable markings of a net from initial marking and is denoted by . The reachable markings can be involved in the enumeration of all reachable markings of a net and graphically expressed by a reachability tree. The reachability tree is denoted by , which is a directed graph and consists of nodes and arcs, nodes are markings in the reachable markings , and arcs are labeled by the transitions of a net . For instance, an arc from to is labeled by if . A net with initial marking is to be -bounded if, for all , . In other words, for each reachable marking “” from the initial marking , the number of tokens in each place “” never exceeds a finite number “” A net is called safe if all its places are safe, and the number of tokens in each place “” does not exceed one. In other words, a net is -safe if it is 1-bounded. A Petri net with is a live if all its transitions are a live at . A transition is a live if, for all , , there is a firing sequence . A transition is dead at if , . -vector (place vector) and -vector (transition vector) are column vectors. The former is catalogued by and called a -invariant or place invariant if and . The latter is catalogued by and called a -invariant or transition invariant if and , where is the integers set. If each element of is nonnegative the -invariant is called a -semiflow or place semiflow. Suppose that is a place invariant of a Petri net with () and is a reachable marking from the initial marking . Then, . Let be a support of place invariant and it can be classified into three parts. Firstly, is a positive support of place invariant , and . Secondly, is a negative support of place invariant , and . Finally, is a minimal place invariant if is not a superset of the support of any other one and its components are mutually prime. Let ’s be the coefficients of place invariant if, for all , .

#### 4. Deadlock Prevention Methods and Policies

##### 4.1. Siphon Control Methods

This section presents two methods that are motivated by Ezpeleta et al. [13] and Li and Zhou [11]. These methods are called a strict minimal siphons control method and an elementary siphons control method, respectively.

###### 4.1.1. Strict Minimal Siphons (SMSs) Control Method

A siphon in a Petri net is a set of places . The very important property of siphon is that, for a given marking, the siphon is unmarked.

*Definition 1. *Let be a net. Any set , with is called a siphon. If a siphon does not properly contain another siphon is called a minimal siphon. A minimal siphon is called a strict if .

Siphons play a significant role in the liveness analysis of a Petri net, especially in ordinary ones. If a siphon in a net has no tokens, then no transitions in are enabled and all the transitions connected to cannot be fired; as a result, the transitions are dead leading to the loss of liveness of the Petri net. In [13], a monitor is added to each strict minimal siphon in order to achieve the liveness of the system. The proposed approach is simple and ensures a success. Nevertheless, it leads to a complex Petri net model than the originally model because the added places are equal to the strict minimal siphons in the target net model and the added arcs are larger than that of places added.

The SMS control based on complementary sets of siphons is used to design the control places. A complementary set of a siphon is a set of operation places which are the holders of the resources in but do not belong to . In addition, is the support of a place invariant, which means the operation places in will compete for the resources in with the operation places belonging to . will be unmarked when all tokens in flow into . The following notation will be used in the establishment of the control policy.(1) denotes the set of strict minimal siphons which does not contain the support of any place semiflow (i.e., siphons that can be emptied).(2)Given the fact that is a siphon we have , , , where is the operation places and is the resource places. denotes the following set of state places: , where , indicates the positive support of place invariant , , . For a given siphon , is the set of holders, corresponding to resources in that do not belong to . is called ’s complementary set.(3)Given the fact that is a complementary set of , add a control place for and the initial marking of control place is .

Based on the concept of strict minimal siphon, the proposed deadlock prevention algorithm developed by Ezpeleta et al. [13] is stated as follows.

*Algorithm 2 (SMS based policy). *
*Input*. Petri net model () of an AMS, where .*Step **1*. For a given Petri net (), compute all SMSs.*Step **2.* For each siphon SMS, add a monitor such that(i)the output arcs are connected to the source transitions leading to the sink transitions of and all arcs weights are ones;(ii)the input arcs are connected from the stealing places of and all arcs weights are ones;(iii), where is an initial marking of a monitor.*Step **3*. Repeat Step 2 until all existing SMSs are covered. *Step **4*. Add all monitors into () and the resulting net is denoted by (). *Step **5*. Output (). *Step **6*. End.

For instance, consider the AMS shown in Figure 1(a). Its Petri net model is shown in Figure 1(b). It consists of one robot R1 that can hold a part at a time, two machines M1 and M2, where each machine can process a part at a time, two loading buffers (I1 and I2), and unloading buffers (O1 and O2). Two parts types are considered in the system: PA and PB. PA moves to M1 and PB moves to M2. The robot R1 reaches the machine that finishes its operation first and grips and loads the part to the next machine 1 or machine 2. The Petri net model consists of 11 places and 8 transitions. The places have the following set partition: , , and , where is the input places, is the resources places, and is the operation places. It has 8 minimal siphons, 3 of which are strict minimal siphons and 20 reachable markings. The three SMSs are , , and . Table 1 shows the required monitors using Algorithm 2 for Figure 1(b). Figure 2 illustrates the controlled system of the Petri net model in Figure 1(b) after adding monitors by using Algorithm 2.