**1. Introduction**

A typical example of discrete event systems is an automated manufacturing system (AMS) [1,2]. It enables various product types to be entered at discrete times by sharing resources like machines, automatic controlled vehicles, automated tools, robots, and buffers at asynchronous or simultaneous operations. AMSs have to cope with unexpected and rapid market changes on a competitive global market. They must make rapid modifications to their software and hardware to meet these dynamic changes. This requirement cannot, however, be satisfied successfully with traditional automated manufacturing systems, which require large capital investments. Reconfigurable manufacturing systems have now been developed to deal with those drawbacks in traditional automated manufacturing systems [3–5]. Reconfigurable manufacturing systems are a new kind of production systems that are randomly and dynamically configured in real time. Such configurations involve processing rework and failures, adding new products and machines, and adding new handling device. In RMSs, a set of system resources can be used to process each component according to a specific process sequence. This sharing of resources, however, may lead to deadlocks, and some operations can therefore remain incomplete. Therefore, dealing with deadlock problem is critical for RMSs.

Petri nets (PNs) are widely used for the scheduling, deadlock analysis and control in AMSs as graphical and mathematical modelling tools [6–14]. They can be used to describe characteristics and behaviors of AMSs such as synchronization, concurrency, conflict, causal dependence, and sequencing. Petri nets can be used for behavioral features, for example boundedness and liveness [15,16]. From a technical point of view, several policies based on Petri nets have been proposed. These policies are based on three strategies: (i) deadlock detection and recovery, (ii) deadlock avoidance, and (iii) deadlock prevention [15,17]. Most of these policies have proposed deadlock control in Petri nets through structural analysis [6,18] and reachability graph analysis [19–21]. In addition, three criteria to evaluate and construct an AMS supervisor have been proposed, namely behavioral permissiveness, computational complexity, and structural complexity [15,22].

Recently, several approaches have been adapted to deal with dynamic changes in manufacturing systems [7,23–36]. They primarily concentrate in two directions: direct and indirect. Direct approaches provide modification mechanisms or particular rules for system structure configurations, while indirect approaches typically import additional mechanisms for system reconfiguration specifications. The event–condition–action (ECA) paradigm is developed by Almeida et al. [30] for the design of reconfigurable logic controllers. Their research has demonstrated that the reconfiguration process is highly dependent on the modularity level of the logical control system and that not all "modular" structures can be reconfigured. For a class of discrete event systems (DESs), Sampath et al. [26] presented a reconfiguration approach for their control specifications, subject to linear constraint. This approach is suited to systems such as hospital management systems and can be reconfigured in non-real time. In order to evaluate and improve the performance of the control architecture, Dumitrache et al. [27] developed a real-time reconfigurable supervised control architecture for large manufacturing systems. A model-based control design for reconfigurable manufacturing systems is developed by Ohashi and Shin [28] through state transition diagrams and general graph representation taking into account configuration and reuse of design data. Kalita and Khargonekar [29] introduced a hierarchical structure and a framework for modeling, analysis, specification, and design of logic controllers for RMSs, which allows rapid reconfigurability and reusability of the controller during reconfiguration. In [23], reconfigurable manufacturing systems were used to replace the existing manufacturing systems to offer higher convertibility and flexibility such as dedicated production systems. Serial and parallel configurations, a rules-based matrix approach has been developed and implemented. In addition, a higher-level deadlock control method is presented for the serial and parallel configurations.

Net Rewriting Systems (NRS) are another graph-based reconfiguration mechanism [34]. In terms of pattern matching and dynamic structure replacements, the reconfiguration occurs. By the implementation of a Turing machine the expressive power was shown to be Turing equivalent. A subset of net rewriting systems, called reconfigurable nets, have also been provided with an algorithm to flatten a Petri net to standard. This subset only restricts NRS to those transformations that remain unchanged in the number of places and transitions, that is, only the flow relation can be changed. Flattening significantly increases the size of transitions by multiplying the number of reconfigurations by the amount of transitions. The NRS is used in logic controllers with improved net rewriting systems [35]. The improved NRS version restricts the rewriting rules to ensure important structural characteristics such as boundedness, liveness, and reversibility are not invalidated. In addition, in [24], an improved net rewriting system (INRS) was developed with the aim of reconfiguring an RMS supervisory controller based on PNs. Changes to an RMS modification were made to rewrite rules that were then applied in the initial PN controller. The INRS is first proposed as a reconfiguration basis. The structure of a Petri net model can be changed dynamically. Then, the study provided three representations of the RMS modification and suggested an INRS-based method to the design of the Petri net controller of an RMS. In this approach, the properties of behavioral, i.e., the boundedness, reversibility, and liveness of a modified system, were not verified or validated.

In [31], colored timed PNs (CTPN) were used in the modelling of RMSs and a mechanism to describe reconfigurability in the CTPN architecture was introduced that leads to a new architecture supporting the reconfiguration. This mechanism includes reconfigurable transitions, specific places, and inhibitor arcs. Wu and Zhou introduced intelligent token Petri net (ITPN) [25]. In their model, tokens representing job instances carry real-time knowledge about system states and changes, just like intelligent cards in practice such that dynamical changes of a system can be easily modeled. These formalisms can describe the reconfiguration behavior of the system. However, some of dynamic changes do not clearly define the modularity, which brings confusion to engineers in designing, understanding, and future redevelopment. Correctness of the system such as coherence of states before and after system reconfigurations is not considered. In addition, temporal constraints, which are of great significance in real-time systems are not mentioned. In [32], reconfigurable object nets (RONs) are used to model, simulate, and analyze RMSs. A formal method was proposed for fulfilling a new production requirement. The configuration consists of new extrusion and cutting machines. The reconfiguration is represented as graph transformations, RON tool was used to simulate the reconfigured systems and TINA [37] and PIPE [38] software tools were used to carry out the analysis.

The work of Silva et al. [36] explored the principles of the different approaches and takes from them the best practices. Configuration mechanisms were proposed using Holonic and multiagent system methods to allow a reconfigurable distributed production control system to systematically detect faults. To describe communication interfaces, the principle of service-oriented architecture was used. Hybrid top-down and bottom-up approaches were presented using Petri net models. In [33], object-oriented Petri nets (ORPNs) and π-calculus were used as two complementary formalisms. Initial RMSs structure and system behavior were modeled by ORPN while the π-calculus was used to describe RMSs' reconfiguration. To evaluate, check, and validate RMSs, Petri nets and π-calculus supporting tools were used. The reconfigurability mechanism and consistency of RMSs could be analyzed by π-calculus. In [7], a new model is proposed, namely the intelligent colored token Petri net (ICTPN), which simulated dynamic configurations of systems such as adding new machines, processing failures and rework, machine failures, processing routes changes, removing old machines, and adding new products. The primary idea is that smart colored tokens were part types which represented real-time knowledge of system status and configurations. This allowed for the effective modeling of dynamic system configurations. The proposed ICTPN could modularly model dynamic system changes to generate a very compact model. Moreover, when configurations appear, only the colored token of the part type, which is changed from the current model was changed. The resulting ICTPN model ensures that the behavioral properties such as deadlock-free, conservative, and reversible were guaranteed.

All of the above methods with PNs attempted to deal with dynamic configuration issues in manufacturing systems. However, most of them do not include an algorithm or mechanism for reconfiguration, could not guarantee the properties of behavioral Petri net (i.e., boundedness (or safeness), liveness, and reversibility), or could not ensure that the results of the reconfiguration are correct, accurate or valid. In addition, few techniques for rapid and valid reconfiguration of literature deadlock control supervisors were presented.

The objective of this article is to develop a novel two-step solution for quick and accurate reconfiguration of supervisory controllers for deadlock control in RMSs with dynamic changes. In the first step, the net rewriting system used in [34,39] was adapted to design a reconfigurable Petri net model under dynamic configurations. The obtained model guarantees boundedness behavioral property but may lose the other properties of a Petri net model (i.e., liveness and reversibility). This means that the reconfigured Petri net model has finite states, deadlocks, and does not behave cyclically. For this issue, the second step develops an automatic deadlock prevention policy for reconfigurable Petri net using the siphon control method based on place invariant to solve the deadlock problem with dynamic structure changes in RMSs and achieve liveness and reversibility behavioral properties for the system. Thus, the developed approach has the ability of adapting to RMS configuration changes.

The major applications of the developed approach are as follows:


This paper is organized as follows. Section 2 describes basic concepts of Petri nets, reconfigurable Petri nets. Section 3 presents the deadlock prevention policy for reconfigurable Petri net based on the concept of minimal siphons and place invariants. The behavioral and quantitative analysis of the proposed reconfigurable Petri net are presented in Section 4. A real-world case study is presented in Section 5 to demonstrate the application of the proposed approach. Conclusions and future research are presented in Section 6.
