ARTICLE IN PRESS Control Engineering Practice 17 (2009) 1174–1189
Contents lists available at ScienceDirect
Control Engineering Practice journal homepage: www.elsevier.com/locate/conengprac
The real-time supervisory control of an experimental manufacturing system based on a hybrid method Murat Uzam , Go¨khan Gelen ¨ niversitesi, Mu ¨ hendislik Mimarlık Faku ¨ ltesi, Elektrik-Elektronik Mu ¨ hendislig˘i Bo ¨lu ¨ mu ¨ , Kampu ¨ s. Nig˘de, Turkey Nig˘de U
a r t i c l e in f o
a b s t r a c t
Article history: Received 14 October 2008 Accepted 15 May 2009 Available online 25 June 2009
In this paper, the real-time supervisory control of an experimental manufacturing system is reported based on a recently proposed hybrid (mixed PN/automaton) approach. Assuming that an uncontrolled bounded Petri net (PN) model of a (plant) discrete event system (DES) and a set of forbidden state specifications are given, the proposed approach computes a maximally permissive and nonblocking closed-loop hybrid model. The method is straightforward logically, graphically and technologically. This paper particularly shows the applicability of a hybrid (mixed PN/automaton) approach to low-level realtime DES control. To do this, programmable logic controller (PLC) based real-time control of an experimental manufacturing system is considered. & 2009 Elsevier Ltd. All rights reserved.
Keywords: Automata Petri nets Supervisory control theory PLC Real-time implementation Ladder logic diagram
1. Introduction The changing social environment required by the increasing customization of both goods and services desired by customers has brought about new automation and information technologies (Morel, Valckenaers, Faure, Pereira, & Diedrich, 2007). During the last two decades researchers have put a great deal of efforts into addressing the increasing demand of industry for formal control design of discrete event systems (DES), including manufacturing systems, computer networks, logistic systems, and traffic control systems. Supervisory control theory (SCT) was introduced to extend control theory concepts for continuous systems to the discrete-event environment (Ramadge & Wonham, 1987, 1989; Wonham & Ramadge, 1987). In SCT, a forbidden state problem (Ramadge & Wonham, 1987) specifies conditions that must be avoided, typically the simultaneous utilization of some resource by two or more users; in addition SCT generally requires the controlled system to be nonblocking (namely that specified target states, often just the initial state, be maintained reachable), and to be maximally permissive, i.e., to permit the occurrence of all events not leading to violation of the foregoing requirements. As an alternative to the original automaton framework of SCT, Petri-netbased approaches to supervisory control design have been considered as well (Guia & DiCesare, 1991). This is mainly because the state-space representation of Petri net (PN) as a vector
Corresponding author. Tel.: +90 388 225 22 82, fax: +90 388 225 0112.
E-mail addresses:
[email protected] (M. Uzam),
[email protected] (G. Gelen). 0967-0661/$ - see front matter & 2009 Elsevier Ltd. All rights reserved. doi:10.1016/j.conengprac.2009.05.004
addition system (whose states are integer-vectors, the PN ‘‘markings’’) can result in a compact system description, thus keeping the net structure small even though the number of possible markings may become large. PN models lend themselves not only to systematic construction of supervisory controllers, but also to the analysis of various qualitative properties and quantitative performance evaluation (Guia, 1996). The disadvantage of PN models is that, in general, optimal supervisors need not exist within the class of PN (Giua, DiCesare, & Silva, 1992) and that nonblocking (e.g. reversibility) is difficult to achieve by standard PN methods (which tend to focus on weaker requirements such as net liveness and deadlock-freeness). Mainly two types of PN supervisors have been proposed in the literature: the compiled supervisor, where control policy is represented as a net structure, and the mapping supervisor, where control actions (event enabling/disabling) are computed by an online controller as a feedback function of the marking of the system. There are several advantages in fully compiling the supervisor action into a net structure (Guia, 1996): computation of control action is faster, and the same PN execution algorithms may be used for both the original system and the supervisor. In addition, a closed-loop model of the system under control can be built with standard net composition constructions. It is evident that compiled supervisors are preferable to mapping supervisors. However, optimal PN-based controllers need not always exist, even though the counterpart SCT problem may be solvable in the framework of automata (Giua et al., 1992). In addition to the pure SCT dealing with discrete event systems, there are some recent efforts, such as Millan and O’Young (2008), for the synthesis of supervisory controllers for plants with a mixture of discrete and
ARTICLE IN PRESS M. Uzam, G. Gelen / Control Engineering Practice 17 (2009) 1174–1189
continuous dynamics, i.e., plants with hybrid dynamics. Specification of a batch plant using process algebra and Petri nets is reported in Falkman, Lennartson, and Tittus (2009). Recently, a hybrid approach to supervisory control of DES for forbidden state problems, which couples SCT (automaton) supervisors to uncontrolled PN models through inhibitor arcs was proposed in Uzam and Wonham (2006). Assuming that an uncontrolled bounded Petri net model of a (plant) DES and a set of forbidden state specifications are given, the approach proposed in Uzam and Wonham (2006) computes a maximally permissive and nonblocking closed-loop hybrid model. This method is entirely straightforward logically, graphically and technologically and becomes a useful alternative to mapping supervisors, especially when there does not exist an optimal PN type controller for the given problem. The method proposed in Uzam and Wonham (2006) is general in the sense that it is not limited to any special subclass of bounded PNs such as marked graphs or state machines. Therefore, the method should be widely applicable and of practical interest. The work reported in Uzam and Wonham (2006) deals mainly with the high-level control of DESs. However, the results obtained in Uzam and Wonham (2006) can be applied to both high-level control, where the role of the supervisor is to coordinate control of, in the manufacturing sense, machines, robots etc., and to low-level control, where the role of the supervisor is to arrange low level interaction between the control devices, such as motors, actuators, etc. The methodology is easy to understand and easy to apply to real-time control of DES problems. Therefore, the purpose of this paper is to show the applicability of the hybrid (mixed PN/automaton) control method, proposed in Uzam and Wonham (2006), to low-level control of DESs. To do this, the real-time control of an experimental manufacturing system is considered in detail by means of a programmable logic controller (PLC). The remainder of this paper is organized as follows: Section 2 provides preliminary information about SCT, automation Petri nets (a class of interpreted Petri nets), and token passing logic (TPL) methodology, a technique to convert interpreted Petri nets into ladder logic diagrams (LLD) for implementation on PLCs. The hybrid methodology proposed in Uzam and Wonham (2006) is recalled and modified in Section 3. In Section 4, an experimental manufacturing system is introduced as a DES control problem. How the real-time supervisory control of this experimental manufacturing system is accomplished successfully by using the modified hybrid method is also explained in detail in Section 4. Some issues regarding the implementation of DES supervisors using PLC are discussed in Section 5. Finally, conclusions are given and some future research directions are provided in Section 6.
2. Preliminaries 2.1. Supervisory control theory Supervisory control theory was introduced to extend control theory concepts for continuous systems to the discrete-event environment (Ramadge & Wonham, 1987, 1989; Wonham & Ramadge, 1987). In SCT, a forbidden state problem (Ramadge & Wonham, 1987) specifies conditions that must be avoided, typically the simultaneous utilization of some resource by two or more users; in addition SCT generally requires the controlled system to be nonblocking (namely that specified target states, often just the initial state, be maintained reachable), and to be maximally permissive, i.e., to permit the occurrence of all events not leading to violation of the foregoing requirements. Discrete event systems evolve on spontaneously occurring events. Let S be finite set of events. The set of all finite concatenations of events in S is denoted by S*. An element of this set is called a string. The
1175
q0
e1 q1 e2
Fig. 1. A simple automaton model.
number of events gives the length of the string. The string with no element is denoted by e and is called empty string. A subset m L S is called a language over S. For a string s 2 S , s denotes the prefixes of s and is defined as s ¼ fsp 2 S j9t 2 S ðsp t ¼ sÞg. Extension of this definition to language prefix closure of a language L is denoted by L. A language L satisfying the condition L ¼ L is said to be prefix closed (Cassandras & Lafortune, 1999; Wonham, 2008). An automaton, denoted by G, is a six-tuple G ¼ (Q, S, f, G, q0, Qm) where, Q is the set of states, S is the finite event set, f: Q S-Q is the partial transition function. G: q-2S is the active event function. G(q) is the set defined for every state of G and represents the feasible events of q. q0 is the initial state and Q m Q is the set of marked states representing the completion of a given task or operation. A simple automaton model with two states is shown in Fig. 1. This automaton has two states labeled with q0 and q1. q0 with a double arrow is the initial (and marked) state, while q1 with an exiting arrow is the marked state of the automaton. A directed arrow represents the transition functions of the automaton. Labels of transitions (e1, e2) correspond to events. The language generated by G is denoted by L(G) and is defined as L(G) ¼ {sAS*: f(q0,s) is defined}. The language marked by G is denoted by Lm(G) and is defined as Lm(G) ¼ {sAS*: f(q0,s)AQm}. The DES modeled as automaton G is said to be nonblocking if LðGÞ ¼ Lm ðGÞ. DESs named as A and B can be composed with synchronous product (parallel composition) operation. Synchronous product of two automata is denoted by A||B and it represents the synchronous behavior of two automata. In the resulting automaton common events occur synchronously, while the other events occur asynchronously (Cassandras & Lafortune, 1999; Wonham, 2008). SCT makes use of formal languages to model the uncontrolled behavior of discrete event systems (plant) and specifications for the controlled behavior. The objective is to restrict the behavior of the system to a desired behavior, which is represented by the specifications. This is done by disabling some events to prevent the occurrence of some undesired strings in the system. The disabling action is accomplished by another simultaneously executing automaton called the supervisor. The system cannot be forced by supervisor to generate new events. In SCT, events are divided into two disjoint sets, the controllable events and uncontrollable events. These sets are denoted by Sc and Suc, respectively. The supervisor has no effect on uncontrollable events, which means that the supervisor cannot disable uncontrollable events. The existence of a supervisor is guaranteed if the desired language satisfies controllability conditions. This condition is defined as K Suc \ M K, where K is the language that will be generated under the control of supervisor and M is the language generated by the uncontrolled system.
2.2. Automation Petri nets Petri nets are widely used as formal method for design, analysis and control of DESs. Petri nets were named after Carl A. Petri, a contemporary German mathematician and computer scientist, introduced a net-like mathematical tool for the study of communication with automata (Petri, 1962). Ordinary Petri nets
ARTICLE IN PRESS 1176
M. Uzam, G. Gelen / Control Engineering Practice 17 (2009) 1174–1189
accomplished by the firing of the enabled transitions. The following rules are used to govern the flow of tokens: Enabling rules: in the APN, there are three rules which define whether a transition is enabled to fire. These pre-conditions must be satisfied for a transition to fire.
p1
t1
1
2 p3
p2
p5
p4 3
2 2 t3
t2
p6
3
Action1
Fig. 2. An automation Petri net (APN) model.
do not deal with actuators or sensors. Because of this, it is necessary to define a Petri net-based controller (automation Petri net, APN) which can embrace both actuators and sensors within an extended Petri net framework (Uzam & Jones, 1998; Uzam, Jones, & Yu¨cel, 1999). An APN model is shown in Fig. 2. In the APN, sensor readings can be used as firing conditions at transitions. The presence or absence of sensor readings can be used in conjunction with the extended Petri net preconditions to fire transitions. In the APN, two types of actuation can be considered, namely impulse actions and level actions. Actions are associated with places. Formally, an APN can be defined as follows: APN ¼ ðP; T; Pre; Post; In; En; X; Q ; M 0 Þ
(1)
where P ¼ {p1, p2, y, pn} is a finite, non-empty set of places, T ¼ {tl, t2, y, tm} is a finite, non-empty set of transitions,P [ Ta+ and P \ T ¼ + Pre: (P T)-N is an input function that defines directed ordinary arcs from places to transitions, where N is the set of non-negative integers. Post: (T P)-N is an output function that defines directed ordinary arcs from transitions to places, In: (P T)-N is an inhibitor input function that defines inhibitor arcs from places to transitions, En: (P T)-N is an enabling input function that defines enabling arcs from places to transitions, w ¼ {w1, w2, y , wm} is finite, non-empty set of firing conditions associated with the transitions, Q ¼ {q1, q2, y, qn} is finite set of actions that might be assigned to the places, M0 ¼ P-N is the initial marking. The APN consists of two types of nodes called places, represented by circles (J), and transitions, represented by bars ). There are three types of arcs used in the APN, namely, ( ), inhibitor arc, ordinary arc, represented by a directed arrow ( ), and finally represented by an arrow, whose end is a circle ( enabling arc, represented by a directed arrow, whose end is empty ). Weighted and directed ordinary arcs connect places to ( transitions and vice versa, whereas weighted enabling arcs and inhibitor arcs connect only places to transitions. The number of tokens in places represents the current state of the system and transitions represent events. Each transition has a set of input places and output places, which represent the pre-condition and post-condition of the transition, respectively. The actions (Q), assigned to the places, can be either impulse actions or level actions. Impulse actions are enabled at the instant when a token is deposited into the place, and level actions are enabled when there is a token(s) at the place. More than one action may be assigned to a place. Firing conditions in the APN are recognized as external events such as sensor readings. A firing condition, w, associated with a transition t, is a Boolean variable that can be ‘‘0’’, in which case related transition t is not allowed to fire, or it can be ‘‘1’’, in which case related transition t is allowed to fire if it is enabled. The marking of the APN is represented by the number of tokens in each place. Tokens are represented by black dots (). Movement of tokens between places describes the evolution of the APN and is
(1) If an input place p of a transition t is connected to t with a weighted ordinary arc Pre(p,t), then t is said to be enabled when p contains at least the number of tokens equal to the weight of the directed ordinary arc, i.e., M(p)ZPre(p,t). (2) If an input place p of a transition t is connected to t with a weighted enabling arc En(p,t), then t is said to be enabled when p contains at least the number of tokens equal to the weight of the enabling arc, i.e., M(p)ZEn(p,t). (3) If an input place p of a transition t is connected to t with a weighted inhibitor arc In(p,t), then t is said to be enabled when p contains less tokens than the weight of the inhibitor arc, i.e., M(p)oIn(p,t). Firing rules: in the APN, an enabled transition t can or cannot fire depending on the external firing condition w of t. These firing conditions can be leading edge (m), falling edge (k), positive level or zero level, of a sensor reading. Broadly speaking, a firing condition w may include more than one sensor reading with ‘‘AND’’, ‘‘OR’’ and ‘‘NOT’’ logical operators. When dealing with more than one sensor reading as firing conditions, the logical operators of firing conditions must be taken into account accordingly. In the special case, where w ¼ 1, transition t is always allowed to fire when it is enabled. When an enabled transition t fires, it removes from each input place p the number of tokens equal to the weight of the directed ordinary arc connecting p to t. It deposits, at the same time, in each output place p, the number of tokens equal to the weight of the directed arc connecting t to p. It should be noted that, the firing of an enabled transition t does not change the marking of the input places, which are connected to the transition t only by enabling or inhibitor arcs. It is also possible to consider timed APNs, as in normal Petri nets. Ordinary Petri nets do not include any concept of time. With this class of nets, it is possible only to describe the logical structure of the modeled system, but not its time evolution. Due to the need for the temporal requirements of discrete event systems, the concept of time has been introduced into Petri nets in variety of ways. In this paper the timed-transition Petri net is utilized as described in David and Alla (1992), p. 94. 2.3. Token passing logic methodology The control community all around the world has been very active for the past two decades in producing Petri net based discrete event control design techniques especially for manufacturing systems. Generally, PLCs are the preferred implementation tools for such controllers in today’s modern factories. In addition, ladder logic diagrams are the most common and preferred programming languages used in today’s PLCs. Therefore, it was a necessity to be able to convert the Petri net based discrete event controllers into LLDs. To address this need the token passing logic concept was introduced (Jones, Uzam, Khan, Karimzadgan, & Kenway, 1996; Uzam, 1998; Uzam & Jones, 1996, 1998; Uzam, Jones, & Yu¨cel, 2000). For a detailed survey about LLD and Petri net based discrete event control design methods the reader is referred to Peng and Zhou (2004). It can be clearly seen from Peng and Zhou (2004) that the TPL concept is very well established and very well received by the control community for converting Petri nets into LDD. The prime feature of the TPL concept is that it facilitates the direct conversion of Petri net based logic controllers
ARTICLE IN PRESS M. Uzam, G. Gelen / Control Engineering Practice 17 (2009) 1174–1189
into LLD. This is achieved by adopting the Petri net concept of tokens as the main mechanism for controlling the flow of the control logic. Hence, each place within the Petri net corresponds to a counter (or a flag) within the LLD program. Each action at a Petri net place corresponds to an action within the LLD program, and each transition within the Petri net involving a movement of tokens corresponds to a simulated movement of tokens between LLD rungs. This simulated movement of tokens is achieved by deploying separate counters at each place within the LLD program and by incrementing and decrementing these counters to simulate token flow. Thus, each place within the Petri net has an associated counter (or a flag), and the current count value of the counter represents the number of tokens that would be at the corresponding place within the Petri net. Furthermore, in consonance with the Petri net approach, if the count value of the counter associated with the place is non-zero then any actions associated with that place are activated. Finally, to complete the Petri net synergy, if the counter associated with a place is non-zero and a Petri net like transition associated with that place becomes active, then the counter at the place is decrement by one, and the subsequent place linked by the output transition is incremented by one. Moreover, the PLC on delay timers can be readily used to implement timedtransition Petri net. In essence, the Petri net places are represented by separate counters. The count value of the counter represents the Petri net tokens. The Counting down and counting up the counters simulate the flow of Petri net tokens. For safe (1-bounded) Petri net places flags (memory bits) can be deployed, in which case setting and resetting of the related flags will be used to simulate the flow of tokens. In theory, the methodology can cope with any number of tokens and provide a visual description of the LLD program, which has all the advantages of a full Petri net analysis. Furthermore, colored Petri nets and hierarchical Petri nets can also be converted into LLD using this technique; simply by adding more counters (or flags) to each place. For a detailed treatment of the TPL concept please see Uzam (1998).
3. The hybrid approach to supervisory control of discrete event systems The hybrid approach to supervisory control of discrete event systems proposed in Uzam and Wonham (2006) is briefly recalled and modified here. There are three aspects to be considered: Firstly, the original hybrid method is described for general Petri nets, but this work is concerned with interpreted Petri nets, namely APNs. Secondly, in the original hybrid method as an intermediate step, the simplified Ramadge–Wonham (RW) supervisor is obtained from the RW supervisor, but the implementation of the hybrid controllers obtained by using the simplified supervisor with a PLC has not yet been accomplished. This issue is considered in the discussion section. In this paper, the RW supervisor is utilized instead of the simplified one. Finally, one more design step is added for the real-time implementation of the controlled model on a PLC. As a result of these three points explained, the design steps of the original hybrid method are modified accordingly. The supervisory control of a DES based on the hybrid approach is illustrated in Fig. 3. The architecture consists of four parts: (i) the discrete event system to be controlled, (ii) the controller (supervisor), (iii) sensor readings, regarded as outputs from the DES and as inputs to the controller, and (iv) control actions, regarded as outputs from the controller and as inputs to the DES. The supervisor must guarantee that no forbidden state will be reached, that specified target states remain reachable (nonblocking) and that controlled behavior is maximally permissive, i.e., the supervisor does not unnecessarily constrain system operation and is in this sense ‘‘optimal’’.
1177
Control actions
APN model Inhibitor arcs (control data) auto-net
Discrete Event System (Plant)
controlled model (supervisor) Sensor readings Fig. 3. Supervisory control of a DES based on the hybrid approach.
The plant and supervisor are assumed to run concurrently, as follows. The occurrence of an event in the plant is transmitted to the supervisor as a plant output through sensory feedback, resulting in a supervisor state change. The supervisor functions as a state-feedback controller, whose enabling/disabling control actions are output as a plant input, closing the feedback loop. The controlled behavior of the plant will be the subset of uncontrolled behavior (i.e., sublanguage of uncontrolled event strings) that survives under supervision. The controlled model of the plant consists of the uncontrolled plant PN model itself, and the controlling auto-net, coupled together by means of inhibitor arcs which represent the control data (or logic). The auto-net (‘‘automaton net’’) is a Petri-net-like graphical representation of the RW automaton supervisor, in which there is only one token and all places have capacity 1. In the auto-net, as a graphical object, each state and transition arc of the RW supervisor is shown respectively as a Petri-net-like-place and a Petri-net-like-transition. Initially, a single token is deposited in the place representing the initial state. The auto-net represents the controlled behavior of the plant; its transitions represent either controllable or uncontrollable events; and its role is to track the plant behavior and implement control (event disabling) action. For the latter, inhibitor arcs are used. When an event occurs in the plant, the auto-net changes state synchronously, in accordance with the location of its single token and the event in question. Transitions in plant and auto-net are synchronized on the basis of shared labels. Because a transition with given label may occur in more than one location in the auto-net, the latter is not, generally, a PN, and quite possibly cannot be represented as such. It is this feature that endows the hybrid representation with generality and flexibility. The design and implementation steps can be summarized as follows.
(1) Assume that an uncontrolled APN model (UAPNM) of a DES, with initial marking, and a set of forbidden state specifications are given. (2) Check that UAPNM is bounded and determine explicit bounds on the place markings. (3) Reduce UAPNM, if possible, by PN reduction rules. (4) Convert the (reduced) UAPNM and the specifications into equivalent buffer models. (5) Apply supervisory control theory to obtain a Ramadge– Wonham supervisor (SUPER) and its control data (SUPDAT). (6) Convert SUPER into an auto-net representation, say AUTONET. (7) Obtain the closed-loop (or controlled) hybrid model, say CHM, by coupling AUTONET to UAPNM using inhibitor arcs according to SUPDAT.
ARTICLE IN PRESS 1178
M. Uzam, G. Gelen / Control Engineering Practice 17 (2009) 1174–1189
Fig. 4. The experimental manufacturing system.
(8) Finally, implement the CHM on a programmable logic controller as a ladder logic diagram. The boundedness computation in step 2 can be carried out with available PN tools or (in simple cases) by inspection. The reduction techniques in step 3 are well known, and preserve properties such as boundedness, liveness, and reversibility. For step 4, if place p is bounded in accordance with M(p)rb, say, then p is modeled by a buffer with capacity b (i.e., b+1 states). For example if an APN place has a token capacity of 3, then it can be represented by 4 states. Step 5 can be performed by standard SCT software; the package (TCT, 2008) is used for computing SUPER and SUPDAT by procedures supcon() and condat(), respectively. The detailed syntax of these steps is provided in the TCT-generated log files for the considered example. In step 6, the conversion of SUPER to AUTONET is done simply to render the graphical representation similar to that of a PN, as described above. When there are self-loops within the SUPER they are just ignored, as there is no change either between states or in the control action. In step 7, an inhibitor arc connects an input place of AUTONET to a transition to be controlled (enabled/disabled) in (the reduced) UAPNM; the transition is enabled precisely when the input place
of the inhibitor arc (or more generally of all inhibitor arcs terminating at the transition) is void of tokens. As a consequence of SCT and its TCT implementation (TCT, 2008), the closed-loop compiled hybrid model CHM represents a nonblocking and maximally permissive solution to the supervisory control problem considered. The final step: the design phase is only the first step towards the control of DESs. After designing a controller (supervisor), it is necessary to have an automatic means for the generation of control code from the controller. The supervisory control can be enforced by implementing the supervisor on an industrial computer. Since programmable logic controllers with a graphical symbolic programming language, called ladder logic diagrams, are the most popular implementation tools in today’s automated modern factories, in this paper the TPL technique described in the previous section is used for converting the controlled model CHM into an LLD code for implementation on a PLC.
4. Real-time supervisory control of an experimental manufacturing system In this section, an experimental manufacturing system is considered to show the applicability of the proposed hybrid
ARTICLE IN PRESS M. Uzam, G. Gelen / Control Engineering Practice 17 (2009) 1174–1189
method to low level real-time supervisory control of discrete event systems. Firstly, the experimental manufacturing system is explained together with the control specifications as a DES control problem. Then, this problem is solved by the hybrid method explained in Section 3.
4.1. Problem description The experimental manufacturing system, shown in Fig. 4, represents a component sorting and assembly processes that can be controlled by virtually any controller such as microcontroller or PLC. The upper conveyor and the lower conveyor are driven by the upper conveyor motor (Actuator 1) and the lower conveyor motor (Actuator 2) respectively. A random selection of metallic pegs and plastic rings are placed on the upper conveyor. The rings and pegs need to be identified and separated. This is done by two sensors, a proximity sensor (Sensor 1) and an infra-red reflective sensor (Sensor 2). By using these two sensors a distinction can be made between the peg and the ring. By means of the sort solenoid (Actuator 3), plastic rings can be ejected down the assembly chute, which can have up to five plastic rings. Metallic pegs, meanwhile, continue on the upper conveyor and are deflected down the feeder chute. The feeder chute automatically feeds pegs onto the lower conveyor. An infra-red emitter/detector (Sensor 3) is used to determine whether or not the assembly area is empty. If it is, the assembly solenoid (Actuator 4) is used to dispense a ring from the assembly chute into the assembly area. The assembly area is positioned just above the lower conveyor and, when a metallic peg passes, the peg engages with the hole in the ring and the two components are assembled. The lower conveyor is used to carry completed components into the collection tray. In this work, a Siemens S7-300 (CPU319) PLC is used to control the process, and software called ‘‘SIMATIC MANAGER’’ is used to program the PLC. PLC inputs and outputs are given in Tables 1 and 2, respectively. For the sake of simplicity, it is assumed that the assembly chute can have only one ring at a time. It is also assumed that when the system is switched on, both upper and lower conveyor motors are switched on automatically. The control specifications are as follows: (1) Operate the sort solenoid only when there is a ring at the sort area and there is space in the assembly chute. (2) Operate the assembly solenoid only when there is a ring in the assembly chute and there is space at the assembly area.
4.2. Design and implementation steps for solving the control problem The problem stated in the previous section is a DES control problem and is solved by the proposed hybrid method. The design and implementation steps of the hybrid method are as follows. 4.2.1. Step 1 For the stated problem, the uncontrolled APN model is obtained as shown in Fig. 5, where there are ten places, P ¼ {p1, p2, y, p10} and seven transitions T ¼ {t1, t2, y, t7}, with which the firing conditions, w ¼ {w1, w2, y, w7} are associated, respectively. Note that transitions t6 and t7 are controllable, while transitions t1, t2, y, t5 are uncontrollable. The firing conditions arew1 ¼ I0:0, w2 ¼ I0:0 and I0:1, w3 ¼ I0:0, w4 ¼ I0:2, w5 ¼ I0:2, w6 ¼ 1, w7 ¼ 1. Transitions t3, t4 and t5 are timed transitions with time delays 1, 0.7 and 1.5 s, respectively. Places p7 and p8 represent the off and on states of the sort solenoid, respectively. Likewise, places p9 and p10 represent the off and on states of the assembly solenoid. A token in p1 (respectively. p3, p5) represents the available space in the sort area (respectively in the assembly chute, in the assembly area). A token in p2 (respectively p4, p6) depicts the presence of a plastic ring in the sort area (respectively in the assembly chute, in the assembly area). Initially, both solenoids are off and there are no plastic rings in the manufacturing system. When there is no ring at the sort area (a token in place p1), and the presence of a ring is detected, i.e., w2 ¼ I0:0 and I0:1, transition t2 fires by removing the token from p1 and by depositing a token into p2. This means that there is a ring at the sort area. When there is a ring at the sort area either it clears the sort area through transition t1 or it is put into the assembly chute through transition t3. If there is a ring at the sort area, the sort solenoid is off, and the absence of a ring is detected, i.e., w1 ¼ I0:0 then transition t1 fires p1
PLC input
Sensor
Definition
I0.0 I0.1 I0.2
Sensor 1 Sensor 2 Sensor 3
Detects a ring or peg at the sort area Detects a peg at sort area Detects a ring in the assembly area
p2
t1
2
p7 =I0.0 =I0.0&I0.1 3=I0.0 4=I0.2 5=I0.2 6=1 7=1 p3 T1=1 sec. T2=0.7 sec. T3=1 .5 sec. 1
t3
T1
3
t6 p8
6
Q0.0 p4 p9
t4
T2
4
Table 2 PLC outputs.
t2
1
2
Table 1 PLC inputs.
1179
t7 p10
Q0.1 p5
PLC outputs
Actuator numbers
Definition
Q0.0 Q0.1 Q0.2 Q0.3
Actuator Actuator Actuator Actuator
Sort solenoid Assembly solenoid Upper conveyor motor Lower conveyor motor
1 2 3 4
p6
t5
T3
5
Fig. 5. The uncontrolled APN model (UAPNM).
7
ARTICLE IN PRESS 1180
M. Uzam, G. Gelen / Control Engineering Practice 17 (2009) 1174–1189
t1
t3 P1:
t3
t3
p4
p1 1
0 12,32
t2
1 p7
22
32 t6
1
0
t6
52
42
P9:
32 p6
p3
1
0 1
0 t3
32
t4 P6:
P3:
42
1
0 t3
t4
t4
61
p8 1
0 t4
t3
P8.
p5
12, 32
t1
42
P5:
p2
1
0
42
t5 P2:
61
P7: 12
0
t4
t2
t1
32
P4:
22
p9 1
0
52
t5
71
42
t7
t7 P10:
71
p10
1
0 42
t4
Fig. 6. Buffer models for the places of the UAPNM.
by removing the token from p2 and by depositing a token in p1. This means that the ring cleared the sort area. If there is a ring at the sort area, the sort solenoid is on, there is space in the assembly chute, and the absence of a ring is detected, i.e.,w3 ¼ I0:0, then timed-transition t3 is being fired for 1 s, after which the token at the sort area is removed, and a token is deposited into the assembly chute, by using the empty space in the assembly chute. This means that the ring at the sort area is put into the assembly chute by means of the sort solenoid and this process takes 1 s. If there is a ring in the assembly chute (a token in place p4), there is space at the assembly area (a token in p5), the assembly solenoid is on, and the presence of a ring is detected i.e., w4 ¼ I0:2 then the timed transition t4 is being fired for 0.7 s, after which the token at the assembly chute is removed, and a token is deposited into the assembly area, by using the empty space in the assembly area. This means that the ring at the assembly chute is put into the assembly area by means of the assembly solenoid and this process takes 0.7 s. If there is a ring at the assembly area (a token in p6), and a peg engages with the hole in the ring, i.e., w5 ¼ I0:2 then it takes 1.5 s for the ring and the peg to be assembled and to clear the assembly area. After this, there is space at the assembly area (a token is deposited into p6). Note that actions Q0.0 and Q0.1 are assigned to places p8 and p10, respectively. They represent the sort solenoid and the assembly solenoid operations, respectively.
4.2.2. Step 2 It can be easily verified by inspection that the UAPNM shown in Fig. 5 is 1-bounded (i.e., safe-each place has the maximum token capacity of 1) and reversible, with the place marking bounds p1:1, p2:1, p3:1, p4:1, p5:1, p6:1, p7:1, p8:1, p9:1, p10:1.
4.2.3. Step 3 No reduction technique is applied to the UAPNM and it is used as is.
4.2.4. Step 4 In this step the UAPNM is converted into equivalent buffer models. In addition, the two specifications are also represented as automata models. Firstly, the conversion of the UAPNM is considered. The UAPNM is converted into related automaton buffer models as shown in Fig. 6. The following event coding is used in the conversion process. Note that odd (respectively, even) integers are used for controllable (respectively, uncontrollable) events in the TCT software. Event coding: UAPNM: TCT:
t1 12
t2 22
t3 32
t4 42
t5 52
t6 61
t7 71
In the following, PLANT, i.e., the automaton representation of the UAPNM, is obtained. Firstly, the buffer model of each place is defined by the Create() command and then the synchronous product command, namely Sync(), of TCT is used. P1 ¼ Create(P1,[mark 0],[tran [0,22,1],[1,12,0],[1,32,0]]) (2,3) P2 ¼ Create(P2,[mark 0],[tran [0,22,1],[1,12,0],[1,32,0]]) (2,3) P3 ¼ Create(P3,[mark 0],[tran [0,32,1],[1,42,0]]) (2,2) P4 ¼ Create(P4,[mark 0],[tran [0,32,1],[1,42,0]]) (2,2) P5 ¼ Create(P5,[mark 0],[tran [0,42,1],[1,52,0]]) (2,2) P6 ¼ Create(P6,[mark 0],[tran [0,42,1],[1,52,0]]) (2,2) P7 ¼ Create(P7,[mark 0],[tran [0,12,0],[0,61,1],[1,32,0]]) (2,3) P8 ¼ Create(P8,[mark 0],[tran [0,61,1],[1,32,0]]) (2,2) P9 ¼ Create(P9,[mark 0],[tran [0,71,1],[1,42,0]]) (2,2) P10 ¼ Create(P10,[mark 0],[tran [0,71,1],[1,42,0]]) (2,2) PLANT ¼ Sync(P1,P2) (2,3) PLANT ¼ Sync(PLANT,P3) (4,7) PLANT ¼ Sync(PLANT,P4) (4,7) PLANT ¼ Sync(PLANT,P5) (8,16) PLANT ¼ Sync(PLANT,P6) (8,16) PLANT ¼ Sync(PLANT,P7) (16,34) PLANT ¼ Sync(PLANT,P8) (16,34) PLANT ¼ Sync(PLANT,P9) (32,80) PLANT ¼ Sync(PLANT,P10) (32,80)
The PLANT is obtained as shown in Fig. 7.
ARTICLE IN PRESS M. Uzam, G. Gelen / Control Engineering Practice 17 (2009) 1174–1189
0
12
71
61
52
22 1
2 71
3 22
71
22
61
61
12
4
5
32
6
52
71 61
7 52
1181
71
71 71
9 61
32
22
10
22
8
12
61
22
71
11
12
22
52
42
61
52
52
12 14
13 42
52
61
16
52
22
12
17
52
18
71
61
42 22
15 61
71
52
42
22
52
22
71
19 20
22 12
52
52 24
23 32
22
71
61
25
12 71 22 61
52
61
12
32 22
21
71
61
26
22
29
28
52
27
71
61 30
22
61
52
71
31 Fig. 7. PLANT.
Secondly, the automata models of the two control specifications are considered. The first specification states the following:
Operate the sort solenoid only when there is a ring at the sort area and there is space in the assembly chute.
ARTICLE IN PRESS 1182
M. Uzam, G. Gelen / Control Engineering Practice 17 (2009) 1174–1189
61
22
0
61
0
1
22
1 42
12, 32 SPEC 1A 52 71
32
SPEC 1B
42 52 61 71
52 71 32
22
52 71
SPEC 1: 0
12
1
12
2
42
3
42
Fig. 8. Automata models for the first specification.
It may be re-stated as follows: Operate the sort solenoid when there is a ring at the sort area AND Operate the sort solenoid when there is space in the assembly chute. The first part of the first specification, namely ‘‘Operate the sort solenoid when there is a ring at the sort area’’ is represented as an automaton model, called SPEC1A, shown in Fig. 8. Similarly, the second part of the first specification, namely ‘‘Operate the sort solenoid when there is space in the assembly chute’’ is represented as an automaton model, called SPEC1B, shown in Fig. 8. The following TCT procedures are carried out for defining both SPEC1A and SPEC1B: SPEC1A ¼ Create(SPEC1A,[mark 0],[tran [0,22,1],[1,12,0],[1,32,0],[1,61,1]]) (2,4) SPEC1B ¼ Create(SPEC1B,[mark 0],[tran [0,32,1],[0,61,0],[1,42,0]]) (2,3)
The first part of the second specification, namely ‘‘Operate the assembly solenoid when there is a ring at the assembly chute’’ is represented as an automaton model, called SPEC2A, shown in Fig. 9. Similarly, the second part of the second specification, namely ‘‘Operate the assembly solenoid when there is space at the assembly area’’ is represented as an automaton model, called SPEC2B, shown in Fig. 9. The following TCT procedures are carried out for defining both SPEC2A and SPEC2B: SPEC2A ¼ Create(SPEC2A,[mark 0],[tran [0,32,1],[1,42,0],[1,71,1]]) (2,3) SPEC2B ¼ Create(SPEC2B,[mark 0],[tran [0,42,1],[0,71,0],[1,52,0]]) (2,3)
The ‘‘AND’’ statement of the specification is accomplished by applying the synchronous product procedure Sync() of TCT to SPEC2A and SPEC2B and thus yielding the SPEC2 as follows: SPEC2 ¼ Sync(SPEC2A,SPEC2B) (4,6) Blocked_events ¼ None
The ‘‘AND’’ statement of the specification is accomplished by applying the synchronous product procedure Sync() of TCT to SPEC1A and SPEC1B and thus yielding the SPEC1 as follows: SPEC1 ¼ Sync(SPEC1A,SPEC1B) (4,8) Blocked_events ¼ None
After this operation, selfloops labeled with events that are possible in PLANT but not constrained by the first specification must be adjoined to each state. To do this, selfloops with event labels ‘‘52’’ and ‘‘71’’ are adjoined to each state of the SPEC1 as follows: SPEC1 ¼ Selfloop(SPEC1,[52,71]) (4,16)
As a result the automaton model SPEC1 is obtained as shown in Fig. 8, satisfying the first specification. The second specification states the following: Operate the assembly solenoid only when there is a ring in the assembly chute and there is space at the assembly area. The second specification may be re-stated as follows: Operate the assembly solenoid when there is a ring at the assembly chute AND Operate the assembly solenoid when there is space at the assembly area.
After this operation, selfloops labeled with events that are possible in PLANT but not constrained by the second specification must be adjoined to each state. To do this, selfloops with event labels ‘‘12’’, ‘‘22’’ and ‘‘61’’ are adjoined to each state of the SPEC2 as follows: SPEC2 ¼ Selfloop(SPEC2,[12,22,61]) (4,18)
As a result the automaton model SPEC2 is obtained as shown in Fig. 9, satisfying the second specification. To obtain a single specification, namely SPEC, from the two specifications SPEC1 and SPEC2, the meet procedure Meet() of TCT is applied as follows: SPEC ¼ Meet(SPEC1,SPEC2) (8,20) SPEC
] states:8 states set:0 y 7 initial state: 0 Marker states: 0 vocal states: none ] transitions: 20 Transitions: [0,22,1] [1,12,0] [1,32,2] [1,61,1] [2,22,3] [2,42,4] [2,52,2] [2,71,2] [3,42,5] [3,52,3] [3,71,3] [4,22,5] [4,52,0] [5,12,4] [5,32,6] [5,52,1] [5,61,5] [6,22,7] [6,52,2] [7,52,3]
4.2.5. Step 5 Now the supervisory control theory is applied to obtain a RW supervisor (SUPER) and its control data (SUPDAT). To accomplish this task, both the PLANT and the specification (SPEC) automata
ARTICLE IN PRESS M. Uzam, G. Gelen / Control Engineering Practice 17 (2009) 1174–1189
71
32
0
71
32
1 52
42 SPEC 2A 12 22 61
42
0
1
1183
SPEC 2B
12 22 61 71
42
12 22 61
12 22 61
32
SPEC 2: 0
1
3
2
52
52
Fig. 9. Automata models for the second specification.
The control data related to SUPER are: SUPDAT The control data are displayed as a list of supervisor states where disabling occurs, together with the events that must be disabled there. Control data: 0: 61 2: 71 4: 61 6: 61 8: 71 10: 61
71
71
1: 71 3: 61 5: 61 7: 61 9: 71 11: 61
71 71
4.2.6. Step 6 The depiction AUTONET of SUPER is shown in Fig. 11. 4.2.7. Step 7 The final closed-loop (controlled) hybrid model (CHM), which is nonblocking and maximally permissive is obtained by coupling AUTONET to UAPNM of Fig. 5 by inhibitor arcs according to SUPDAT. This is simply done by connecting the inhibitor arcs In(p11, t6), In(p11, t7), In(p12, t7), In(p13, t7), In(p14, t6), In(p15, t6), In(p16, t6), In(p16, t7), In(p17, t6), In(p17, t7), In(p18, t7), In(p19, t6), In(p20, t7), In(p21, t6), In(p22, t6), and In(p22, t7) from places P ¼ {p11, p12, y, p22} to the controllable transitions t6 and t7 as shown in Fig. 12.
Fig. 10. SUPER.
models are used in the Supcon() and Condat() procedures of TCT software as follows: SUPER ¼ Supcon(PLANT,SPEC) (12,23) SUPDAT ¼ Condat(PLANT,SUPER) Controllable
As a result the SUPER which represents the complete controlled behavior (Wonham, 2008) is as follows and is depicted in Fig. 10. SUPER
] states:12 Marker states: 0
states set:0 y 11 vocal states: none
initial state: 0 ] transitions: 23
Transitions: [0,22,1] [1,12,0] [1,61,2] [2,32,3] [3,22,4] [3,71,5] [4,12,3] [4,71,6] [5,22,6] [5,42,7] [6,12,5] [6,42,8] [7,22,8] [7,52,0] [8,12,7] [8,52,1] [8,61,9] [9,32,10] [9,52,2] [10,22,11] [10,52,3] [11,12,10] [11,52,4]
4.2.8. Step 8 The implementation of the controlled model by means of a Siemens S7 300 PLC is considered here. As explained in Section 2.3, the TPL methodology is used for converting the controlled Petri net into an LLD code. It should be noted that, for proper functioning, the order of the LLD code must be arranged as follows: first, the initial marking is written; next, the LLD code related to the auto-net is written; and finally, the LLD code for the APN model of plant is written. This is because after the initial marking is represented as LLD, the auto-net monitors the system behavior and changes its state, and then, according to the current state and the control policy, if necessary, the behavior of the APN model is restricted. Note that, while ‘‘on delay timers’’ are only associated with the timed-transitions in the APN model, the time evolutions of these timers are followed by the timed-transitions within the auto-net. As a result, to convert the controlled model (supervisor) into an LLD code, memory bits M0.1, M0.2, M0.3, M0.4, M0.5, M0.6, M0.7, M1.0, M1.1 and M1.2 are assigned to the places P ¼ (p1, p2, y, p10) of the APN model, respectively. Similarly, memory bits M2.0, M2.1,
ARTICLE IN PRESS 1184
M. Uzam, G. Gelen / Control Engineering Practice 17 (2009) 1174–1189
p1
p11
=I0.0 2=I0.0&I0.1 3=I0.0 4=I0.2 5=I0.2 6=1 7=1 T1=1 sec. T2=0.7 sec. T3=1 .5 sec.
APN model
1
t8
t9
2
1
T3
t23
7
7
t3
2=I0.0&I0.1
T1 3
3=I0.0 4=I0.2 5=I0.2 p3 6=1 7=1 T1=1 sec. T2=0.7 sec. T3=1 .5 sec.
p13
t15
1
t16
2
t12
T1
3
5
t13 T3 5
T3
t14
T3
5
p15 t18
t19
1
t20
2
Q0.0 p9 t4
2
4
1
p5
t21
p6
t5
T3
5
T1
Control Policy p11 t8
t9
2
1
6
p12
t28
t29
2
T2 4
6
p13
1
t11
t30 p21
7
p17
t24 t25 p20 T2 t27
t7
T2 p10
4
t10
t26
6
p4
p18
p19
t6
p8
Q0.1
T3
5
3
t22
2
1=I0.0
6
5
p16
p2
p7
t10
p14
t2
1
p12
t11
t17
t1
p14
p22
t15
1
t17 T3
t16
2
p16
t19
1
t22
t20
2
M2.2, M2.3, M2.4, M2.5, M2.6, M2.7, M3.0, M3.1, M3.2, and M3.3 are assigned to the places P ¼ (p11, p12, y, p22) of the auto-net, respectively. On delay timers T1 with 1 s time delay, T2 with 0.7 s time delay, and T3 with 1.5 s time delay are assigned to the timed-transitions t3, t4 and t5 of the APN model, respectively. After doing these assignments by using a direct mapping the LLD code shown in Fig. 13, is obtained. This LLD code is written for a Siemens S7-300 (CPU 319) PLC. The LLD symbols (as used in this paper) of a Siemens S7-300 PLC are given in Table 3. The LLD code is structured in such a way that the network 0 (NW0) initializes the system by means of the initialization memory bit M0.0. The auto-net is converted into LLD at the networks from NW1 to NW23, where the networks 1, 2, 3, y, 23 represent the transitions T ¼ (t8, t9, t10, y, t30), respectively. The APN model is converted into LLD at the networks from NW24 to NW33, where rungs 24, 25, y, 33 represent the transitions T ¼ (t1, t2, y, t7), respectively. Finally, action places p8 and p10 are represented by rungs 34 and 35, respectively. By adopting this concept, further clarity can be added to the system documentation and it is easy to understand and modify the LLD code if necessary. By using a PC software called ‘‘Simatic Manager’’, this LLD code was programmed on a Siemens S7-300 (CPU 319) PLC in the experimental set-up shown in Fig. 4. The LLD code, representing the controlled-model, i.e., the supervisor, implemented the control specifications as required and it did not unnecessarily constrain the behavior of the experimental manufacturing system. The physical system performed very well under the proposed control as described by the specifications.
t23
t12 5
T3
t13 5
T3
t14 T3
5
t18 T3 5 p17
5
Fig. 11. The AUTONET obtained from SUPER.
T1 p15
3
t21 T1
3
p18
7
7
p19
t24 p20
T2 t25
6
4
t26
t27
t28
t29
2
1
2
1
p21
t30
T2
4
p22
Auto-net Fig. 12. The closed-loop (controlled) compiled hybrid model of the manufacturing system.
The LLD code shown in Fig. 13 can be validated by using timing diagrams of the inputs, outputs, and the variables used within the LLD code. In order to accomplish such a task, a scenario can be characterized for the controlled plant to follow the supervisor’s disabling commands and also to inspect PLC inputs, the variables used and output signals. The timing diagram shown in Fig. 14 is used to validate the LLD code shown in Fig. 13. In the timing diagram from top to down, the first three entries represent the behavior of the three input signals, I0.0, I0.1 and I0.2. Next, one-bit variables (markers) are shown. They can be split into three parts. The first one is M0.0, used to setup the initial state of the controlled model (supervisor). The second part consists of ten markers representing the ten places p1, p2, y, p10 respectively. The third part contains twelve markers representing the 12 places p11, p12, y, p22, respectively. Then, the timing values and the status bits of the three on delay timers are shown. Finally, the
ARTICLE IN PRESS M. Uzam, G. Gelen / Control Engineering Practice 17 (2009) 1174–1189
M0.0
M0.1 S M0.3 S
NW0 (Init.)
M2.0
I0.0
I0.1
NW1 (t8) M2.1
I0.0
NW2 (t9) M2.1 NW3 (t10) M2.2 I0.0
T1
NW4 (t11) M2.7 I0.2
T3
NW5 (t12) M3.1 I0.2
T3
NW6 (t13) M3.3 I0.2
T3
NW7 (t14) M2.3
I0.0
NW8 (t15) M2.4
I0.0
I0.1
NW9 (t16) M2.5
T3
I0.2
M2.6
T3
I0.2
M2.5
I0.0
NW10 (t17)
NW11 (t18)
NW12 (t19) M2.6 NW13 (t20)
I0.0
I0.1
M0.5 S M0.7 S M1.1 S M2.0 S Q0.3 S Q0.4 S M0.0 S M2.0 R M2.1 S M2.1 R M2.0 S M2.1 R M2.2 S M2.2 R M2.4 S M2.7 R M2.2 S M3.1 R M2.1 S M3.3 R M2.0 S M2.3 R M2.4 S M2.4 R M2.3 S M2.5 R M2.3 S M2.6 R M2.4 S M2.5 R M2.6 S M2.6 R M2.5 S
M2.7
T1
I0.0
M2.7 R M2.6 S
NW14 (t21)
M2.4 R M3.2 S M2.3 R M3.0 S M3.1 R M2.7 S M3.0 R M3.1 S M3.2 R M3.0 S M3.0 R M3.2 S M3.3 R M3.1 S M3.1 R M3.3 S M3.2 R M3.3 S M0.2 R M0.1 S M0.1 R M0.2 S T1
M2.4 NW15 (t22) M2.3 NW16 (t23) M3.1 NW17 (t24) M3.0
I0.2
T2
NW18 (t25) M3.2
I0.0
I0.1
NW19 (t26) M3.0
I0.0
NW20 (t27) M3.3
I0.0
I0.1
NW21 (t28) M3.1
I0.0
NW22 (t29) M3.2
I0.2
T2
M0.2
M0.7
I0.0
M0.1
I0.0
I0.1
NW23 (t30)
NW24 (t1)
NW25 (t2) M0.2 M0.3 M1.0 I0.0 NW26 (t3.1)
R
M0.6
I0.2
NW30 (t5.1)
S_ODT Q
S
s5T#1.5s
R
M0.6
I0.2
NW31 (t5.2)
T3
BI
TV
BCD
M0.6 R M0.5 S
M0.7 M2.0 M2.3M2.4M2.5 M2.6 M3.0M3.2M3.3
NW32 (t6) M1.1 M2.0 M2.1M2.2 M2.5 M2.6 M2.7M3.1M3.3
NW33 (t7)
M0.7 R M1.0 S M1.1 R M1.2 S
M1.0 NW34 (Act.1)
Q0.0 M1.2
NW35 (Act.2)
Q0.1
BI BCD
M0.2 R M0.3 R M1.0 R M0.1 S M0.4 S M0.7 S T2
NW27 (t3.2)
M0.4 M0.5 M1.2 I0.2
S_ODT Q
S
s5T#700MS
M0.4 R M0.5 R M1.2 R M0.3 S M0.6 S M1.1 S T3
Q
TV
M0.2 M0.3 M1.0 I0.0 T1
NW28 (t4.1)
M0.4 M0.5 M1.2 I0.2 T2 NW29 (t4.2)
S_ODT S
s5T#1s
1185
TV R
BI BCD
Fig. 13. The LLD code implementation of the controlled model.
behavior of four output signals (Q0.0, Q0.1, Q03 and Q0.4) are drawn. In this timing diagram, basically there are two scenarios established. The first one is the assembly of one peg with one ring
represented between times t1 and t7, while the second one is about the successive two assemblies represented after time t8. Here the detailed explanation is provided just for the first scenario. As the second scenario is apparent from the first one it
ARTICLE IN PRESS 1186
M. Uzam, G. Gelen / Control Engineering Practice 17 (2009) 1174–1189
is not explained. Now consider the first scenario. Initially it is assumed that there are no parts within the system and that three input signals are zero (OFF). When the PLC is switched on, at time t0 the first rung NW0 will setup the initial values, i.e., the following markers are set M0.1, M0.3, M0.5, M0.7, M1.1, and M2.0. This is the initial marking of the controlled model. In this rung, the outputs Q0.3 and Q0.4 are also set. By doing so both upper and lower conveyor motors are switched on and they will stay on during the PLC operation. In this rung, the last command sets the M0.0 as well. This ensures that M0.0 will be used once at the beginning of the first PLC scan and it will stay set during the PLC operation. It can be seen that initially as M2.0 is ON both
Table 3 The LLD symbols for Siemens S7-300 PLC. LLD symbol
Definition
S R T I Q M
Set Reset Timer Input Output Memory bit Normally open contact Normally closed contact On delay S5 timer S: start input, Q: status of the timer, TV: preset time value, BI: remaining time value, BCD: remaining time value in BCD format, R: reset input, and Tr. No: number of timer
controllable transitions t6 (NW32) and t7 (NW33) are disabled due to the normally closed contacts of M2.0. At time t1 the presence of a ring (I0.0 ¼ 1, while I0.1 ¼ 0) is detected in front of the sort area. Then, five successive operations take place: 1. t8 is fired (NW1), i.e., M2.1 is set and M2.0 is reset (in the auto-net, the token moves from p11 to p12). 2. t10 is fired (NW3), i.e., M2.2 is set and M2.1 is reset (in the auto-net, the token moves from p12 to p13). In this case normally closed contact of M2.2 {the inhibitor arc In(p13,t7)} disables t7 (NW33) but t6 (NW32) is not disabled. 3. t2 is fired (NW25), i.e., M0.2 is set and M0.1 is reset (in the plant, the token moves from p1 to p2). 4. The controllable transition t6 is fired (NW32), i.e., M1.0 is set and M0.7 is reset (in the plant, the token moves from p7 to p8). 5. Finally, the sort solenoid is switched ON (there is a token in p8, therefore the action Q0.0 ¼ 1). When the sort solenoid is switched ON, the plastic ring is ejected down the assembly chute. As soon as the ring moves away from the sort area, the absence of the ring is detected by Sensor 1 (I0.0 ¼ 0) at time t2. With the absence of the ring, timed transition t3 is being fired (NW26) for T1 ¼ 1 s. After 1 s time delay, the status bit of timer 1 becomes ON at time t3. Then, five successive operations take place: 1. t11 is fired (NW4), i.e., M2.4 is set and M2.2 is reset (in the auto-net, the token moves from p13 to p15). 2. t22 is fired (NW15), i.e., M3.2 is set and M2.4 is reset (in the auto-net, the token moves from p15 to p21). In this case normally closed contact of M3.2 {the inhibitor arc In(p21,t6)} disables t6 (NW32) but t7 (NW33) is not disabled. 3. Timed transition t3 is effectively fired (NW27), i.e., M0.1 is set and M0.2 is reset (in the plant, the token moves from p2 to p1), M0.7 is set and M1.0 is reset (in the plant, the token moves from p8 to p7), M0.4 is set and M0.3 is reset (in the plant, the token moves from p3 to p4).
Fig. 14. The timing diagram used to validate the LLD code shown in Fig. 13.
ARTICLE IN PRESS M. Uzam, G. Gelen / Control Engineering Practice 17 (2009) 1174–1189
4. The controllable transition t7 is fired (NW33), i.e., M1.2 is set and M1.1 is reset (in the plant, the token moves from p9 to p10). 5. Finally, the sort solenoid is switched OFF (there is no token in p8, therefore the action Q0.0 ¼ 0) and the assembly solenoid is switched ON (there is a token in p10, therefore the action Q0.1 ¼ 1). It can be seen that at time t3, the ring reaches the end of assembly chute and as there is no ring at the assembly area the assembly solenoid is switched on to put it into the assembly area. When the assembly solenoid is switched on, the plastic ring is dispensed from the assembly chute into the assembly area. As soon as the ring comes to the assembly area, the presence of the ring is detected by Sensor 3 (I0.2 ¼ 1) at time t4. With the presence of the ring, timed transition t4 is being fired (NW28) for T2 ¼ 0.7 s. After 0.7 s time delay, the status bit of timer 2 becomes ON at time t5. Then, four successive operations take place: 1. t30 is fired (NW23), i.e., M3.3 is set and M3.2 is reset (in the auto-net, the token moves from p21 to p22). In this case, normally closed contacts of M3.3 disable both t6 (NW32) and t7 (NW33) {the inhibitor arcs In(p22,t6) and In(p22,t7) respectively}. 2. Timed transition t4 is effectively fired (NW29), i.e., M0.3 is set and M0.4 is reset (in the plant, the token moves from p4 to p3), M0.6 is set and M0.5 is reset (in the plant, the token moves from p5 to p6), M1.1 is set and M1.2 is reset (in the plant, the token moves from p10 to p9). 3. Finally, the assembly solenoid is switched OFF (there is no token in p10, therefore the action Q0.1 ¼ 0). It can be seen that at time t5, the ring reaches the assembly point. Between times t5 and t6 a metallic peg appears at the sort area (I0.0 ¼ 1 and I0.1 ¼ 1) and then it travels from upper conveyor to lower conveyor through feeder chute. Next, it engages with the hole in the ring and it takes the ring from the assembly area. As a result, the absence of the ring at the assembly area is detected by sensor 3 (I0.2 ¼ 0) at time t6. With the absence of the ring, timed transition t5 is being fired (NW30) for T3 ¼ 1.5 s. After 1.5 s time delay, the status bit of timer 3 becomes ON at time t7. Then, two successive operations take place: 1. t14 is fired (NW7), i.e., M2.0 is set and M3.3 is reset (in the auto-net, the token moves from p22 to p11). In this case, normally closed contacts of M2.0 disable both t6 (NW32) and t7 (NW33) {the inhibitor arcs In(p11,t6) and In(p11,t7) respectively}. 2. Timed transition t5 is effectively fired (NW31), i.e., M0.5 is set and M0.6 is reset (in the plant, the token moves from p6 to p5). It can be seen that at time t7, the system (controlled model) goes back to its initial state.
method and it is very difficult to apply this heuristic method to big problems with a big state space. On the other hand, the results provided here are based on formal supervisory control theory and they are easy to apply. Therefore, the method proposed in this paper is considered as a formal and improved version of the one proposed in Uzam et al. (2000). Secondly, the simplified (reduced) supervisor for the problem explained in the previous section is considered. After applying the Supreduce() and Condat() TCT commands to this problem, the simplified supervisor, whose reduced auto-net representation can be seen from Fig. 15, is obtained. The closed-loop (controlled) hybrid model for the reduced auto-net is shown in Fig. 15. It is obtained by coupling reduced auto-net to UAPNM of Fig. 5 by inhibitor arcs according to reduced control data. This is simply done by connecting the inhibitor arcs from places P ¼ {p11, p12, y, p17} to the controllable transitions t6 and t7 as shown in Fig. 15. In the original hybrid method (Uzam & Wonham, 2006) the simplified (reduced) RW supervisor is obtained from the RW
p1 t1
APN model t2
p2
1
2
p7
=I0.0 2=I0.0&I0.1 3=I0.0 4=I0.2 5=I0.2 p3 6=1 7=1 T1=1 sec. T2=0.7 sec. T3=1 .5 sec. 1
t3 T1
3
t6
p8
6
Q0.0 p4 p9 t4
t7
T2 p10
4
7
Q0.1 p5
p6
t5
T3
5
Control Policy
5. Discussion In this section three issues are considered and discussed. The first issue is about the similarities of the results obtained in this paper with the ones obtained in Uzam et al. (2000). The second issue concerns the simplified (reduced) supervisor for the problem considered in the previous section. Finally, some problems associated with the PLC implementation of DES supervisors are considered and how these problems are tackled in this paper is discussed. Firstly, the results obtained here are in full agreement with the ones obtained in Uzam et al. (2000). In particular, ‘‘the APN model supervisor’’ in Fig. 10 of Uzam et al. (2000) is identical to that of ‘‘AUTONET’’ in Fig. 11 within this paper. The control policy, given in Table 4 of Uzam et al. (2000) is also identical to that of ‘‘SUPDAT’’ computed in this paper, with only one exception that there are two timed transitions defined for the uncontrolled APN model in Uzam et al. (2000) while there are three timed transitions defined for the uncontrolled APN model in this paper. The controlled model obtained in Fig. 12 of Uzam et al. (2000) is also identical to that of the controlled model in this paper. The results obtained in Uzam et al. (2000) are based on a heuristic
1187
T3 t8
5
t9
6
p12 p17
t16
t17
1
2
T2
t10 t11
4
t18
2
T3
p16
t22
t23
t13
t12
T3
5
6
t14 p14
7
p11 t15
5
T2 4
1
T3
t25
t24 2
1
5
T1
t20
t19 1
3
2
t26 t27
t21 T1 3
7
p15
p13 t28 T3
5
Reduced Auto-net Fig. 15. The closed-loop (controlled) compiled hybrid model obtained for the reduced auto-net.
ARTICLE IN PRESS 1188
M. Uzam, G. Gelen / Control Engineering Practice 17 (2009) 1174–1189
supervisor. The reduced supervisor with a strictly minimal state size is control-equivalent to the original supervisor. For example when comparing the auto-net shown in Fig. 12 and the one shown in Fig. 15, it can be seen that they have 12 and 7 places (states), respectively. From the practical point of view it is desirable to implement a supervisor with the least possible number of places (states), because for every state it is necessary to use a memory bit. In this respect it is better to implement the closed loop model shown in Fig. 15 instead of the one shown in Fig. 12. However, the closed loop model shown in Fig. 15 has not yet been implemented properly with a PLC using the TPL methodology because of the avalanche effect as explained in the next issue. Finally, some problems associated with the PLC implementation of DES supervisors are considered. There are a number of problems associated with the PLC implementation of DES supervisors. Some generic problems were reported in (Fabian and Hellgren, 1998), e.g.: a. Asynchronous event-driven nature of the supervisor versus synchronous signal-based PLC, b. ordering of the alternative paths in a single state of the automaton because of the sequential evaluation of PLC, c. avalanche effect, d. inexact synchronization in Supervisor, e. PLC and the plant interactions as a result of the communication time delay, and f. causality in the closed loop plant. These problems are considered and discussed in conjunction with the implementation carried out in this paper. To start with, it is important to point out the fact that the structure of the closed-loop compiled hybrid model implemented in this paper is much more complex than the ones considered for the PLC implementation of RW supervisors within the literature. For the PLC implementation of a monolithic RW supervisor there is only one automaton to be implemented, while in the hybrid method considered here in addition to a monolithic RW supervisor there is also an APN model to be synchronized with the monolithic RW supervisor. Now the above problems are considered: a. Asynchronous event-driven nature of the supervisor versus synchronous signal-based PLC: In the implementation carried out in this paper there is no problem encountered due to synchronously updated input signals. This is mainly due to the fact that the plant controlled is very slow when compared with the PLC scan cycle. b. Ordering of the alternative paths in a single state of the automaton because of the sequential evaluation of PLC: The alternative paths in a single state of the automaton are chosen by different firing conditions. c. Avalanche effect: there is no such problem faced with the implementation of the model shown in Fig. 12, but the avalanche effect is a problem with the reduced RW supervisor (auto-net) shown in Fig. 15. Normally the APN model and the reduced Auto-net must be synchronized on the shared events. This means that with the occurrence of an event they both change state at the same time so that one can follow the other. Due to the avalanche effect in LLD code, at one particular instant the occurrence of an event causes only one transition firing in APN model but it causes more than one transition firings in the reduced auto-net. This problem does not allow the system work properly. In Fig. 15, assume that there is a token in p12. Normally the occurrence of w1 (firing of t11) should let the system move the token only from p12 to p11, but since there is another w1 assigned to transition t25 the token even moves from p11 to p15. On the other hand in the APN model only one transition will fire. As a result the reduced auto-net cannot follow the APN model in synchrony and thus the implementation fails. Similarly, in the reduced auto-net a token in p16 first moves from p16 to p11 and then from p11 to p14 because the occurrence of w5. Current research effort has been put on solving this problem. d. Inexact synchronization in supervisor: the controlled model implemented runs in synchrony with the plant with no problem, but the order of the implementation is important in LLD. For a proper operation it is important to put the LLD code in the
following order: initialization code goes first. This is followed by the LLD code for the auto-net. Next, LLD code for the plant must be entered. Then, the LLD code for the controlled transitions takes place. Finally, actions are issued at the end of the LLD code. If the order of this code is changed, the synchrony is destroyed between the auto-net and the plant and the controlled model does not function as it should. e. PLC and the plant interactions as a result of the communication time delay: since the PLC and the plant are connected directly through input-output points without any network, no such problem has been encountered. f. Causality in the closed loop plant: in the closed-loop (controlled) compiled hybrid model APN model represents the uncontrolled behavior of the plant. The behavior of the APN model is restricted by means of the auto-net, Petri net representation of the RW type supervisor, based on the specifications. The control policy establishes the decision when to switch on or off the actuators through the controllable transitions t6 and t7. In the PLC implementation of this controlled model, the sensory feedback coming from the plant to the PLC is used to update the current state of the auto-net and the plant. When the controllable transitions fire, the respected actions are activated through the output signals.
6. Conclusions and future research In this paper, a hybrid (mixed PN/automaton) approach to supervisory control of discrete event systems has been successfully applied to PLC based real-time supervisory control of an experimental manufacturing system. The method proposed in this paper is entirely straightforward logically, graphically, and technologically. As the supervisory control theory is used to obtain the supervisor, the methodology offers the following advantages: the compiled supervisor and control policy obtained are correct by construction, i.e., controlled behavior of the system is nonblocking and does not contradict with the forbidden state specifications. All events that do not contradict the forbidden state specifications are allowed to happen, i.e., the controlled behavior of the system is maximally permissive within the specifications. The results obtained can be applied to systems that require untimed or timed, safe APNs, i.e., an APN model in which a place can have only one token at most, as well as APN models that can accommodate more than one token in a place. Ladder logic diagram code has been used to implement the supervisor obtained. This paper has particularly shown the applicability of a hybrid (mixed PN/automaton) approach to low-level real-time control where the role of the supervisor is to arrange low level interaction between the control devices, such as motors, actuators, etc. The RW supervisor obtained in this study is of a monolithic type. This means that when this method is used for complex systems the state space and therefore the number of the states within the RW supervisor would get very large. This is a problem when implementing each state by means of a memory element in a commercial PLC, because there are a limited number of such elements. To solve this problem, further studies will be carried out to obtain modular supervisors as oppose to monolithic supervisors for the same type of problems. In addition, further studies will be carried out to find a method in order to implement the closed loop compiled hybrid models obtained by using the reduced RW supervisors.
Acknowledgments This work was supported by the research grant of The Scientific ¨ rkiye Bilimsel ve and Technological Research Council of Turkey (TU
ARTICLE IN PRESS M. Uzam, G. Gelen / Control Engineering Practice 17 (2009) 1174–1189
¨ BI˙TAK) under the project numTeknolojik Aras-tırma Kurumu-TU ¨ BI˙TAK-107E125. The authors would like to thank the ber TU Associate Editor and anonymous reviewers for their thoughtful comments and suggestions that greatly helped to improve the presentation and technical quality of this paper. References Cassandras, C. G., & Lafortune, S. (1999). Introduction to discrete event systems. Kluwer Academic Publishers. David, R., & Alla, H. (1992). Petri nets and grafcet: Tools for modeling discrete event systems. Prentice-Hall International (UK) Ltd. Fabian, M., & Hellgren, A. (1998). PLC-based implementation of supervisory control for discrete event systems. In Proceedings of the 37th IEEE conference on decision and control (pp. 3305–3310), Tampa, FL, USA. Falkman, P., Lennartson, B., & Tittus, M. (2009). Specification of a batch plant using process algebra and Petri nets. Control Engineering Practice, doi:10.1016/ j.conengprac.2009.03.006 Guia A. (1996). Petri net techniques for supervisory control of discrete event systems. In Proceedings of the first international workshop on manufacturing and Petri nets (pp. 1–21), Osaka, Japan. Guia, A., & DiCesare, F. (1991). Supervisory design using Petri nets. In Proceedings of the 30th conference on decision and control (pp. 92–97), Brighton, UK. Giua, A., DiCesare, F., & Silva, M. (1992). Generalized mutual exclusion constraints on nets with uncontrollable transitions. In Proceedings of the IEEE international conference on system man and cybernetics (pp. 974–979), Chicago, IL, USA. Jones, A.H., Uzam, M., Khan, A.H., Karimzadgan, D., & Kenway S.B. (1996). A general methodology for converting Petri nets into ladder logic: The TPLL methodology. In Proceedings of the Rensselaer’s first international conference on computer integrated manufacturing and automation technology—CIMAT’96 (pp. 357–362), France, May 29–31. Millan, J. P., & O’Young, S. D. (2008). Online discrete event supervisory control of hybrid dynamical systems using embedded simulation. Control Engineering Practice, 16(8), 1004–1021. Morel, G., Valckenaers, P., Faure, J.-M., Pereira, C. E., & Diedrich, C. (2007). Manufacturing plant control challenges and issues. Control Engineering Practice, 15(11), 1321–1331.
1189
Peng, S., & Zhou, M. C. (2004). Ladder diagram and Petri net based discrete-event control design methods. IEEE Transactions on Systems, Man and Cybernetics Part C—Applications and Reviews, 34(4), 523–531. Petri, C. A. (1962). Kommunikation mit automaten schriften des rheinisch. Westfalischen Inst. fur Intrumentelle Mathematik and der Universitat Bonn. Translation by C. F. Green, Applied Data Research Inc., Suppl 1 to Tech report RADC-TR-65-337, NY. Ramadge, P. J., & Wonham, W. M. (1987). Supervisory control of a class of discrete event processes. SIAM Journal on Control and Optimization, 25(1), 206–230. Ramadge, P. J., & Wonham, W. M. (1989). The control of discrete event systems. Proceedings of the IEEE, 77(1), 81–98. TCT. (2008). A software tool supporting supervisory control theory. Systems Control Group, ECE Department, University of Toronto, Posted at URL: /www.control. utoronto.ca/DESS. Uzam, M. (1998). Petri-net-based supervisory control of discrete event systems and their ladder logic diagram implementations. Ph.D. Thesis, University of Salford, Salford, UK. Posted at URL: /http://host.nigde.edu.tr/muzam/S. Uzam, M., & Jones, A.H. (1996). Design of a discrete event control system for a manufacturing system using token passing ladder logic. In Proceedings of CESA’96 IMACS multiconference, symposium on discrete events and manufacturing systems (pp. 513–518), Lille, France, July 9–12. Uzam, M., & Jones, A. H. (1998). Discrete event control system design using automation Petri nets and their ladder diagram implementation. The International Journal of Advanced Manufacturing Technology, 14(10), 716–728. Uzam, M., Jones, A. H., & Yu¨cel, I˙. (1999). A rule based methodology for supervisory control of discrete event systems modelled as automation Petri nets. International Journal of Intelligent Control and Systems, 3(3), 297–326. Uzam, M., Jones, A. H., & Yu¨cel, I˙. (2000). Using a Petri-net-based approach for the real-time control of an experimental manufacturing system. The International Journal of Advanced Manufacturing Technology, 16(7), 498–515. Uzam, M., & Wonham, W. M. (2006). A hybrid approach to supervisory control of discrete event systems coupling RW supervisors to Petri nets. The International Journal of Advanced Manufacturing Technology, 28(7–8), 747–760. Wonham, W.M. (2008). Supervisory control of discrete event systems. ECE Department, Universty of Toronto, 1997–2008, /http://www.control.utoronto. ca/DES/Updated2008.07.01S. Wonham, W. M., & Ramadge, P. J. (1987). On the supremal controllable sublanguage of a given language. SIAM Journal on Control and Optimization, 25(3), 637–659.