Abstract

Analysis and control of deadlocks play an important role in the design and operation of automated flexible manufacturing systems (FMSs). In FMS, deadlocks are highly undesirable situations, which always cause unnecessary cost. The design problem of an optimal supervisor is in general NP-hard. A computationally efficient method often ends up with a suboptimal one. This paper develops a deadlock prevention policy based on resources reallocation and supervisor reconfiguration. First, given a plant model, we reallocate the marking of each resource place to be one, obtaining a net model whose reachable states are much less than that of the original one. In this case, we find a controlled system for it by using the theory of regions. Next, the markings of the resource places in the controlled system are restored to their original ones. Without changing the structure of the obtained controlled system, we compute the markings of the monitors gradually, which can be realized by two algorithms proposed in this paper. Finally, we decide a marking for each monitor such that it makes the controlled system live with nearly optimal permissive behavior. Two FMS examples are used to illustrate the application of the proposed method and show its superior efficiency.

1. Introduction

Traditional mass production systems can hardly cope with intensive competition in market and rapid variation in requirements. Hence, automated flexible manufacturing systems (FMSs) arise, aiming to offer a novel production mode with a small batch and multiple product types. The analysis and control of such systems have become the hot topics in the field of manufacturing systems. Petri nets [1] are a graph-based mathematical formalism suitable to describe, model, and analyze the behavior of automated flexible manufacturing systems.

Due to the existence of shared resources, an FMS may contain deadlocks. Based on Petri nets, researchers have developed many policies to deal with the deadlock problem [26] in FMS. Generally, there are mainly two analysis techniques to deal with deadlock prevention in FMS: structure [711] and reachability graph analysis [1216]. The former always obtains a deadlock prevention policy through special structural objects of a Petri net such as siphons and resource-transition circuits. This method can usually obtain a computationally efficient liveness-enforcing supervisor in general but at the same time restrict a system such that a portion of permissive behavior is excluded. For the latter, the reachability graph can completely reflect the behavior of a system. Though a very highly or even maximally permissive liveness-enforcing supervisor can always be obtained, its computation is very expensive.

As stated, reachability graph analysis [17] is an important technique for deadlock controll; however, it always suffers from a state explosion problem. This is due to the fact that it is impossible to achieve the enumeration of all or a part of reachable markings in practice. Based on this technique, an optimal or suboptimal supervisor with highly behavioral permissiveness can always be obtained for a small system. In [18], Uzam and Zhou develop an iterative approach to design an optimal or suboptimal supervisor. This method is easy to use if the reachable space of a system is small but cannot guarantee the optimality of the supervisor.

The theory of regions developed in [19] can be used as an effective approach to find an optimal liveness-enforcing Petri net supervisor if such a supervisor exists. However, it suffers from computational and structural complexity problems. The work in [20] proposes a vector covering approach to improve the computation efficiency of the work in [19].

A siphon-based deadlock prevention policy is a typical application of structure analysis techniques of Petri nets. Although not optimal and even overly restrictive, this approach is computationally tractable and allows its supervisor to be reused when a system experiences new job instances [2, 2128]. Recent effective and computationally efficient deadlock prevention policies are proposed by Piroddi et al. in [29, 30].

Nowadays, the distribution of resources in an FMS may change frequently and dynamically due to fluctuant customer demands. Such changes mean different production or service requirements for the providers. Therefore, the supervisory control system has to reconfigure rapidly in response to the changes in its physical entity and the control specifications by modifying or adjusting its plant model and controller. Once the resource configurations are changed, the supervisors are updated accordingly. Recently, the study in [31] proposes a novel deadlock prevention policy based on reconfiguration of Petri net supervisors. The method presented in [31] is near optimal, but its performance needs to be further improved.

Motivated by existing work, this paper presents an effective and computationally efficient method to design nearly optimal control places based on resources reallocation and supervisor reconfiguration. The main idea of the method is stated as follows. (i) The proposed method works on the premise of a class of ordinary Petri net with , where for all  , is called a set of idle process places, is called a set of activity places, and is called a set of resource places. (ii) We first reallocate the initial marking of each resource place in to be one, obtaining a model where , for all  , , and , . In this case, we can design monitors by using the theory of regions and find a controlled system for with , where , , for all  , is called a set of control places.  (iii)Then, the markings of the resource places in are restored to their original ones, obtaining a controlled system with , where for all  , , and for all  , . (iv) Without changing the structure of the controlled system , we compute the markings of the monitors gradually. Finally, we decide a marking for each monitor such that , , and for all  , makes the controlled system live, where is a controlled system for with .

The rest of this paper is organized as follows. Section 2 briefly reviews preliminaries used in this paper. Section 3 formulates the considered problem through a motivation example. Section 4 presents a deadlock prevention policy that is formalized by Algorithm 2. Two FMS examples are given in Section 5, showing the superiority of the proposed method. A comparison between the proposed method and a previous one is made in Section 6. Finally, Section 7 concludes this paper.

2. Preliminaries

2.1. Basics of Petri Nets

A generalized Petri net (structure) [7] is a four-tuple , where and are finite, nonempty, and disjoint sets. is a set of places and is a set of transitions with and . is called a flow relation of a net, represented by arcs with arrows from places to transitions or from transitions to places. is a mapping that assigns a weight to an arc: if , and otherwise, where and . If , for all  , the net is called an ordinary Petri net.

A transition is enabled at a marking if for all  , . This fact is denoted as . Firing it yields a new marking such that , , as denoted by . is called an immediately reachable marking from . Marking is said to be reachable from if there exists a sequence of transitions and markings , and such that holds. The set of markings reachable from in is called the reachability set of Petri net and denoted as . is called the incidence matrix of . It is a integer matrix with .

A -vector is a column vector index by and a -vector is a column vector index by , where is the set of integers. is a -invariant if and . A -invariant is said to be a -semiflow if every element of is nonnegative.

A nonempty set is a siphon if . A siphon is minimal if there is no siphon contained in it as a proper subset. A minimal siphon that does not contain the support of any -invariant is called a strict minimal siphon (SMS).

A siphon is said to be max-marked at if such that , where . is max-controlled if it is max-marked at any reachable marking. satisfies the maximal controlled-siphon (cs) property if each minimal siphon of is max-controlled [33]. Siphon is called uncontrolled in if , for all  , is dead at .

A marking of a Petri net is a mapping from to . denotes the number of tokens in place . A place is marked at a marking if . A subnet is marked at a marking if at least one place in is marked at . The sum of tokens of all places in is denoted by , that is, . is said to be empty at if . is called a net system or marked net and is called an initial marking of .

Markings and vectors are usually represented via using a multiset. As a result, vector is denoted by . For instance, a marking that puts two tokens in place and three tokens in place only in a net with is denoted as instead of .

Let be a node of net . The preset of is defined as . While the postset of is defined as . Furthermore, we have and .

Given a Petri net , is live at if for all  , , . is live if , is live at . is dead at if , . is deadlock-free if for all  , , .

With respect to the concepts of supervisors and controlled systems, the reader is referred to [14]. A supervisor is said to be optimal if its resulting controlled system covers all safe states of a plant and every reachable state in the controlled system is a safe state of the plant. Such a controlled system is said to be optimal.

2.2. M-Nets

This paper considers a class of manufacturing-oriented Petri nets, M-nets [31]. It is a generalization of the existing net classes that can model FMS. In this paper, we just focus on the research of ordinary M-nets, a type of M-nets.

Definition 1. An M-net denoted by satisfies the following statements:(1) is composed of nets , and , where for all  , , is called a subnet of .(2) is called a set of idle process places with , for all  , ; is called a set of activity places with , for all , ; and is called a set of activity places.(3) For all  , , .(4) For all  , it is associated with a minimal -semiflow such that , for all  , , and , .(5) For all  , is associated with a minimal -semiflow , where .(6) is quasi-live, bounded, and conservative.(7) with is live, bounded, and reversible, where is the resulting net from removing resource places in .(8) Let be two subnets with . Their composition denoted by with is defined as follows:(i), , and ,(ii),(iii),(iv), and , ,(v)  for all  , ; , ; , ; , ; and for all  , .(9) The net resulting from the composition of subnets , and is defined as follows: if , then ; if , then .(10), ; , ; and , . Such a marking is said to be an admissible initial marking.(11) An uncontrolled siphon in contains at least one resource place and one activity place but no idle process place.(12) is live if no siphon is uncontrolled.(13) If is not live, liveness can be enforced by adding monitors whose addition leads to a controlled system.(14) Let be a controlled system for . is live if it is ordinary and no siphon is unmarked. is live if it is generalized and satisfies the controlled-siphon (cs) property.(15) Let be the set of monitors in . For all  , there exists a minimal -semiflow such that and for all  , .
In order to make Definition 1 clear, an example is given in Appendix A. It is easy to find that M-nets are more general than almost all manufacturing-oriented Petri nets, for example, the ones in [2, 22, 24, 32].

2.3. An MIP-Based Deadlock Detection Method

In this paper, by using a technique that is called the mixed integer programming (MIP) approach proposed in [32], siphons that cause deadlocks can be detected. Let be an ordinary net with and the maximal empty siphon at , that is, , . Finding in is the solution of a mixed integer programming problem. For all  , let and for all  , let .

It is easy to see that any with and any with are removed from the net. Since is a siphon, we have that for all  , implies and for all  , implies the truth of . This leads to

For a structurally bounded net, we have where is the structural bound of place . Therefore, the maximal siphon unmarked at a given marking can be determined by the following MIP problem and there exist siphons unmarked at iff [32]: s.t. constraints (1)–(4) and where is the incidence matrix and and are vectors of real numbers. Relation is usually called the state equation.

Theorem 2 (see [32]). Let be a Petri net with . There is no emptiable siphon if .

Corollary 3. Let be an ordinary M-net with . There is no emptiable siphon if .

The proof of Corollary 3 is given in Appendix B.

Theorem 4. Let be an ordinary M-net with . Then is live if .

The proof of Theorem 4 is given in Appendix B.

3. Structure Design of a Petri Net Supervisor

Now, let us go briefly through the processes by using the theory of regions to design a supervisor for a Petri net model. One first needs to generate its reachability graph. Then, the set of marking/transition separation instances should be found, whose number is in theory exponential with respect to the net size and the initial marking. Finally, for each instance, a monitor should be found by solving a linear programming problem in which the number of constraints is approximately equal to that of nodes in the reachability graph. For such a method, the size of a reachability graph is rather sensitive to the size and the initial marking of a net. These facts make it infeasible for the theory of regions to be applied to real-world problems.

With the purpose of formulating the proposed method even more clearly, we design Algorithm 1 to find a controlled system for that can be obtained by reallocating the marking of each resource place in to be one, with .

Input: an ordinary M-net with
Output:
begin {
,
,
if  {there exists an optimal controlled system for    then
 design a controlled system for by the theory of regions
else
 design a controlled system for by the method in [18]
end if
,
if   is an ordinary controlled system}   then
 output
else
 exit and stop the algorithm
end if
output
} end of the algorithm

Input: an ordinary M-net with
Output: controlled system
begin {
design a controlled system for by Algorithm 1, then
,
,
,
, ,
,
While    makes not live, which can be decided by the MIP-based deadlock detection
method in [32]}  do
for   to   do
   ;
end for
end while
       denotes the marking vector
for   to   do
;
end for
       denotes the marking vector
while (1) do
for   to   do
  if  
    ;
  else
    ;
   break;
  end if
end for
if   makes live, which can be decided by the MIP-based deadlock detection
 method in [32]}do
   break;
end if
end while
,
output
} end of the algorithm

Proposition 5. Let be the resulting net from adding monitors to an ordinary M-net by using Algorithm 1. Then is ordinary and live.

The proof of Proposition 5 is given in Appendix B.

In order to illustrate Algorithm 1, consider a small example from [31]. Figures 1(a) and 1(b) show an ordinary M-net and its corresponding reachability graph with eight reachable states, respectively. Now by applying Algorithm 1 to , a plant mode can be obtained, as shown in Figure 1(c). It has the same topology structure as in Figure 1(a) but its resource places have a small initial marking with and . Its reachability graph is shown in Figure 1(d) with five reachable states. Figure 1(e) shows a controlled system for , which can be obtained by using the theory of regions [15, 19].

The principal objective of reallocating the marking of each resource place to be one is that it is more tractable by using the theory of regions to design a controlled system for than that for . We can see that the reachable states of are five that are less than that of whose reachable states are eight. One can image the heavy computation if the theory of regions is applied to such a net shown in Figure 1(a), with an initial marking having more than states. Algorithm 1 considers , as shown in Figure 1(c), which has five reachable markings only. Therefore, it is easier for us to find a supervisor for than that for . Then, a controlled system for can be obtained by using the theory of regions, as shown in Figure 1(e).

In this section, we propose a method to realize the structure design of a controlled system which can be obtained by Algorithm 1. That is to say, the structure of the supervisors has been found, based on which a deadlock prevention policy will be presented in the next section.

4. Deadlock Prevention Policy

This section proposes a deadlock prevention policy that can be carried out through the following Algorithm 2. In the previous section, a controlled system can be obtained for with and . In this section, we can find a controlled system for by restoring the markings of the resource places in to their original ones and then computing a marking for each monitor. That is to say, even if the initial marking of the plant model changes, the structure of the controlled system obtained previously can be reused. This implies that we only need to compute the marking of each monitor in the controlled system when the markings of the resource places change.

Now, let us consider the relationship between the activity places, the monitors, and the resource places. First, we can find that the tokens that will flow into the activity places can not be greater than that of their holding resource places. Similarly, the tokens in the monitor should be less than that of the resource places which the monitor's activity places hold. That can be expressed by the following: for all  , , is the set of the activity places controlled by  , and for all  , is called the monitor's activity place. , for all  , . Then, an upper limit value for each marking with respect to the monitors ,, and can be obtained. Finally, we decide a marking for each monitor such that it makes the controlled system live which can be decided by the MIP-based deadlock detection method in [32]. Consequently, Algorithm 2 is designed to formulate the proposed method. Let denote a controlled system for , which has the same net structure as with .

Theorem 6. Let be a controlled system for an ordinary M-net by using Algorithm 2. Then is live.

The proof of Theorem 6 is given in Appendix B.

We briefly explain Algorithm 2 as follows. First, a controlled system for can be obtained by using Algorithm 1 in the previous section. Next, the markings of the resource places in are restored to their original ones. Then, we compute an upper limit value for the marking of each monitor and denote it by , . If the marking vector makes the controlled system live, we stop the algorithm and the marking vector is the result we want to obtain. If the marking vector makes the controlled system not live, then each marking in decreases by one; repeat this step until it makes the controlled system live and denote it by . Then, each marking in increases by one that can be denoted by . That is to say, we obtain a new higher limit value vector and a lower limit value vector for the marking of each monitor. Finally, by using Algorithm 2, we decide a marking for each monitor such that for all  , , and , makes the controlled system live which can be decided by the MIP-based deadlock detection method proposed in [32].

For example, a controlled system can be obtained for the net in Figure 1(a) by utilizing Algorithm 2, as shown in Figure 2. In the previous section, a controlled system has been obtained, as shown in Figure 1(e). Then, we can find a controlled system for by restoring the markings of the resource places in to their original ones with and , and then an upper limit value for the marking of the monitor can be computed. We can find that the activity places controlled by are and . Therefore, , . Then, we can obtain that implies that . As shown in Figure 2, the controlled system is live with , which can be decided by the MIP-based deadlock detection method in [32]. Consequently, the marking is the one that we want to obtain.

Given a plant model , we reallocate the marking of each resource place to be one, obtaining a net model . By using Algorithm 1, a controlled system for can be obtained. Then, the markings of the resource places in are restored to their original ones. On the premise of not changing the structure of the controlled system, we compute the marking of each monitor by Algorithm 2. That is to say, even if the initial markings of the plant model change, the structure of the controlled system obtained previously can be reused. This implies that we only need to compute the marking of each monitor in the controlled system without changing the supervisor's structure. Figure 3 shows the flowchart of the proposed deadlock control strategy.

5. Experimental Studies

In order to show the advantage of the proposed method, this section provides two typical examples that are taken from [31]. The computational results indicate that the proposed deadlock prevention policy is nearly optimal and superior to the one in [31].

An FMS consists of two robots R1 and R2 and three machines M1–M3. Its model is shown in Figure 4(a). It is an ordinary M-net, where and are idle places, are resource places, and the others are activity places. As shown in Figure 4(b), is the controlled system for the net with the initial marking of each resource place being one.

To illustrate Algorithm 2, consider shown in Figure 4(b). The activity places and are controlled by and hold the resource places and , respectively. That can be expressed by the following: , . Based on Algorithm 2, the marking of the monitor should be less than the total markings of the resource places and . That can be expressed by an inequality: Much the same can be applied to monitors and . The inequalities can be obtained as follows:

Now, the net under initial marking is used to demonstrate the proposed method. From (7) and (8), the results can be obtained as follows:

Therefore, we can obtain an upper limit value for the marking of each monitor and denote it by . Then, we find that the marking vector makes the controlled system live which can be decided by the MIP-based deadlock detection method proposed in [32]. Therefore, the marking vector is the result we want to obtain. It can be verified that the controlled model in Figure 4(b) under initial marking with , and obtained by the proposed method is live with 1032 reachable states. Compared the proposed method with the one in [31] with 941 states, it can be clearly seen that we have achieved a better result, what we call a near-optimal result.

Compared with the method in [31], the superiority of the proposed policy can be verified. Table 1 shows the permissive behavior of the controlled systems under different initial markings, where the markings of the monitors are decided by Algorithm 2. In this table, is the number of reachable states of , represents the number of states that an optimal controlled system for has, indicates the number of states of the controlled system , and implies the optimality degree. In order to make a comparative analysis of the proposed method and the one in [31], let Li’s denotes the results in [31]. For economy of space, the detailed computational steps are omitted. From this table, we conclude that the proposed method for this example is near optimal and superior to the one in [31].

The second FMS is shown in Figure 5(a). It has two robots R1 and R2, each of which can hold one product at a time. The cell also contains four machines M1–M4, and each of them can hold one part. Parts enter FMS through two automatic loading buffers I1 and I2 and leave it through two unloading ones O1 and O2. The robots deal with the movements of parts. Two part types P1 and P2 are produced. Their respective production routes are shown in Figure 5(b).

Figure 6(a) shows its net model that is an ordinary M-net in which , , and the others are activity places. The controlled system of such a plant model is shown in Figure 6(b), which can be obtained by the theory of regions [15].

Consider the model shown in Figure 6(b). The monitor controls the activity places , , and . The set of their corresponding resource places is . Therefore, the markings of the monitor should be less than the total markings of the resource places and . That can be expressed by an inequality:

The same situation can be applied to monitors , , , , and . The inequalities can be obtained as follows:

By exploiting Algorithm 2, the markings for the monitors can be obtained, as shown in Table 2. For economy of space, the computational steps for the system are not shown in detail. Table 2 shows the performance of the controlled systems under different initial markings. From this table, it is verified that the proposed method for this example is nearly optimal and may even achieve optimality. It is obviously superior to the method in [31].

6. Comparision of Computational Efficiency

The deadlock prevention method proposed in [31] needs to calculate all SMS in the controlled system and infer algebraic inequalities. An improved method of avoiding this problem is presented in this paper, which is simple and practicable. To illustrate the application of the proposed method, two FMS examples are used in this paper. A comparison between the proposed method and the one in [31] is shown in Tables 1 and 2. The superiority of the proposed one is obvious. For a class of FMS considering resource allocation, this paper proposes a deadlock prevention policy by resources reallocation and supervisor reconfiguration, which can make a good tradeoff between optimality and computational tractability for a class of ordinary Petri nets.

7. Conclusion

The deadlock prevention policy is a static strategy that imposes restrictions on the interactions among resources and processes such that resource requests that may lead to deadlocks are prevented. Behavioral permissiveness is very important in designing a liveness-enforcing supervisor for a system to be controlled. An optimal liveness-enforcing supervisor can lead to high utilization of system resources. This paper proposes a deadlock prevention policy by resources reallocation and supervisor reconfiguration. Given a plant model, we first reallocate the marking of each resource place to be one, and then find a controlled system by using Algorithm 1. Next, the markings of the resource places in the controlled system are restored to their original ones. Without changing the structure of the controlled system, we compute the markings of the monitors. Finally, we decide a marking for each monitor such that it makes the controlled system live which can be realized by Algorithms 2 proposed in this paper. For a fixed net structure with different initial marking, the theory of regions is used once only. That is to say, the supervisory control system can be reconfigured rapidly in response to the changes in the initial markings of the plant model. Two FMS examples are used to illustrate the application of the proposed method and show its superior efficiency.

However, the proposed method suffers from the computational complexity problem due to the theory of regions. In theory, it suffers from the exponential complexity. Future efforts will be made to a near-optimal supervisor with low computational costs. In addition, the proposed method is applicable to ordinary M-nets only. Therefore, our future work will extend this method to more general classes of Petri nets, for example, the ones in [34, 35].

Appendices

A. An Example for Definition 1

As the net shown in Figure 7, it is an M-net, where is an idle process place, , and are activity places, and and are resource places. It is quasi-live, bounded, and conservative. It is live if no siphon is uncontrolled.

B. Proofs for Corollary 3, Theorems 4, 6, and Proposition 5

The proof of Corollary 3.

Proof. It follows immediately from the definition of an ordinary M-net that it is a class of ordinary Petri nets. According to Theorem 2, the result is true.

The proof of Theorem 4.

Proof. Let be an ordinary M-net. There is no emptiable siphon if from Corollary 3. By the definition of M-nets, if is ordinary and no emptiable siphon, that is, uncontrolled siphon in , is live.

The proof of Proposition 5.

Proof. It follows immediately from the theory of regions that is live. is excluded by Algorithm 1 if it is a generalized net. Therefore, the result is true.

The proof of Theorem 6.

Proof. According to Proposition 5, is ordinary and live. The structure of the controlled system is the same as that of the . That is to say, is an ordinary controlled system as well as an M-net according to Definition 1. Then, from Theorem 4, is an ordinary M-net, is live if . Therefore, the result is true.

Acknowledgments

This work was supported in part by the National Natural Science Foundation of China under Grants no. 61074035 and 61100056, the Fundamental Research Funds for the Central Universities under Grant no. 72103326, the Zhejiang Provincial Natural Science Foundation of China under Grant no. LY12F03020, the Zhejiang Provincial Education Department Foundation under Grant no. Y201018216, and the Opening Project of Key Laboratory of Measurement and Control of Complex Systems of Engineering, Ministry of Education, Southeast University, Nanjing, under Grant no. MCCSE2012A05.