Discrete Event Systems -An Aproach to Education

Discrete Event Systems -An Aproach to Education

Copyright ID IFAC Advances in Control Education, Istanbul, Turkey, 1997 DISCRETE EVENT SYSTEMS - AN APPROACH TO EDlTATION B. Hriz, J. OndniS, J. Flo...

2MB Sizes 1 Downloads 106 Views

Copyright ID IFAC Advances in Control Education, Istanbul, Turkey, 1997

DISCRETE EVENT SYSTEMS - AN APPROACH TO EDlTATION

B. Hriz, J. OndniS, J. Flochova

Automatic Control Systems Department Faculty of Electrical Engineering and Information Technology Slovak Technical University Jlkovicova 3, 812 19 Bratislava, S/ovak Republic phone: + 421- 7- 791698, e-mail: hruz@}wsr.elfstuba.sk

Abstract: An educational approach to the modelling and control of the discrete event dynamic systems (DEDS) is treated in the paper. After summarizing importance of the field an outline of the lecture course is presented. The role of the Petri nets for the DEDS as well as for education is emphasized. Three laboratory works supporting the subject education are further described. They are simulated robotic cell controlled by means of the program based on the Petri nets and written in the real-time programming language PEARL, manufacturing line model controlled by the PEARL program based also on the Petri nets and the same model controlled by the ladder logic program.

Copyright ID 1998 IFAC Keywords: Discrete event dynamic systems. control engineering education. Petri nets, real-time programming language. ladder logic program.

I. INTRODUCTION

the combination logics and simple finite automata. This is more not sufficient for the DEDS. The main problems in the DEDS can be characterized as complicated concurrency, synchronisation and possible conflicts of events.

Continuous and discrete systems are two basic abstractions in presenting material and energetic or immaterial objects to be learned. Our knowledge about the world is mediated through perception and imagination. On this track the continuous systems are specified by percei\-ing continuous variables and discrete ones by discrete variables both being mathematical abstractions, as well.

Petri nets proved to be an effective tool for the system modelling and control design in DEDS (David and AlIa, 1994; Murata, 1989; Zhou et al., 1992). They possess a modelling and design power to cope with the above indicated problems. Petri nets are used as an interstage specification support standing between functional requirements on a system and their realization.

Many man-made systems are discrete in their nature. Digital computers are the most widely spread ones. Since very beginning their development is accompanied with use of the logic variables and functions based on the Boolean algebra. Static dependencies of the logical variables can be expressed by combinational logics and the dynamic ones by finite automata. Present man-made discrete systems like flexible manufacturing systems, computer networks, transportation and logistic systems bring about new problems by their modelling, analysis and governing (Ho, 1990; Rarnadge and Wonham, 1989). Such systems are called today the discrete event dynamic systems DEDS. Decomposition into modules was sufficient in the design of digital computers because it led to

It is unavoidable that the new field of modelling and control design associated with the DEDS has a corresponding echo in the university engineering education process. The subject of this paper is to describe some approach and experiences in the process. 2. OUlLINE OF THE LECTURE COURSE ON DEDS The Petri nets are, as it is very often with the system specification tools. special classes of the

This research was supported by ;\ational Grant NO.95!5195 /198.

237

mathematical graphs. Therefore to include some chosen parts of the applied mathematical graph theory as an introduction into the education process seems to be highly substantiated. Then it is useful to compare various system specification means and to study their mutual transformations. This track naturally disembogues into the Petri nets theory and applications. The Petri net classes are introduced so as their usability to model real systems. Specific Petri nets approaches to the modelling and control of the discrete systems and especially of the flexible manufacturing systems are embedded into the course in correspondence with the scope and control of our department engineering orientation educational program.Petri nets design and analysis can be supported ~ith available programming packages equipped with graphical editors.

1. Control design of the computer simulated robotic cell with help of the real-time programming language PEARL. 2. Design of the control of the scaled manufacturing line model with help of a process control computer and the real-time programming language PEARL. 3. Design of the control of the same model by means of the Allen-Bradley system SLC-500 and the Advanced Programming System (APS) supporting ladder logic off-line and on-line programs. 4. Control design of the various technological cells using Allen-Bradley systems. The control problems are based on the real technology from the automobile factory Volkswagen Ltd. Bratislava, Slovak Republic. The reqiured work in the frame of the course is to formulate the control algorithm by means of a Petri net and then to program the algorithm with help of the real-time prograrnrning language PEARL (HrUz, 1995 ; 1996a) or ladder logic. Prior to description of the Petri net construction we recall the Petri nets interpreted for control. Definition 1. DThe Petri net PNC interpreted for control is the 5-tuple PNC = (PN, A, L, r , Y,lNH,lND)

The next and by our opinion important area of the education are methods for development of the control software for the DEDS. The methods are influenced by the hardware basis of the control system. There are two mostly used ways: utilizing the process control computers and utilizing the programmable logic controllers produced e. g. by the worl-wide recognized companies Allen-Bradley and Siemens. In the former case a real-time programming language for coding control programs is used, while in the latter case a ladder logic programming system.

where

1. PN is an ordinary Petri net consisting of the set of places P, the set of transitions T, the set of oriented arcs F s;; (P x T) v (T x P) ,the mapping W : P ~ 1+ (positive integers) and the initial marking Mo. 2. A is the mapping of the subset T' s;; T of the PN transition set T to the set of logical conditions L . 3. is the mapping of the subset pI s;; P of the PN place set P to the set of the control variable values settings Y . If a place is marked the corresponding values are set up. 4. INH (IND) is the binary relation INH s;; P x T (IND s;; P x T) . Its elements are called 0 inhibitors (incidentors). Definition 2. DLet a PNC Petri net be given. A marking M of the C - Petri net is a mapping

To the conclusion of the curriculum analysis an outline of the lecture can be formed as follows : l. Chosen parts of the mathematical graph theory. 2 . Graphical system specification tools: real-time flow diagrams, context diagrams, finite automata, logic diagrams. ladder logic programs and other. 3. Hardware means: process control computers, programmable logic controllers, components for the realization of real-time function of the control system. 4. Real-time operating systems and real-time programming languages and the related software engineering methods for the control design. 5. Petri nets theory and application. 6. Petri nets classes useful for the modelling and control design in the flexible manufacturing systems. 7. Computer aided design and analysis of the Petri nets. 8. Supervisory control design methods.

r

M:

P~N

where N is the set of the natural numbers. Marking of a separate place p will be denoted by M(P) . 0 Definition 3. DA transition of the Petri net PNC is fireable iff it is fireable in the underlying Petri net and additionally iff all logical conditions mapped to the transitions are true and iff the places of all inhibitors (incidentors) pertaining to the transition are marked so that M(P) = 0 (M(P) > 0). A given transition t in an ordinary Petri net is fireable if for '\I(p , t) E F, W(p. t) ::; M(P) (t is fixed). 0

3. LABORATORY PART OF THE LECTURE COURSE ON DEDS The laboratory part of the lecture course on DEDS modelling and control design wll be described in this section. The part consists in the following topics:

238

robotic cell is to generate commands for the robotic arm, to achieve maximum efficiency of the flexible cell. In a simple case flexible robotic cell can produce two different semi products from the same input work pieces in parallel on two machines Ml and Ml, respectively. A very good methodology for

The control program can be written in the real-time programming language PEARL. The main idea is that 'with each Petri net transition is associated a TASK. The TASK is periodically activated when the corresponding transition can be fired because of the appropriate marking of the places. After firing of the transition is the TASK desactivated by means of the PREVENT instruction. It "Will be described in the next section in more details.

Table I. Meanings of the main signals Signal

3.1. Control design of the computer simulated robotic cell with PEARL

A very typical part of a flexible manufacturing system is in Fig. I. The robotic flexible cell on the Fig.l consists of two numeric controlled machines ML M2, a robotic arm R, an input conveyor belt BL an output conveyor belt B2 and a buffer place BP. Workpiece, entered on the conveyor belt Bl from some previous part of technology is transported to

o

o

B2

OF2

ID

0

Meaning

Signal Meaning

R=O ready for command

R=l

robot busy

Fl= 0 nothing for processing

Fl= 1 work piece on input

F2=O output is free

F2= 1 output is ocupated

Ml=O machine Ml is free

Ml=l M I is ocupated

Ml=O machine M2 is free

M2=1 M2 is ocupated

Al= 0 Ml finished oper.

Al= 1 Ml busy with oper

A2=O M2 finished oper.

A2= 1 M2 busy with oper

the analysis of parallel control problem is using PNC Petri net. The PNC for modelling of the control problem can be designed as in Figure 2. This PNC eliminates all the uncertainties of this control problem and evades control program dead-locks and hazards.

B1

o

Figure 1. Scheme of the simulated robotic cell. the end of conveyor Bl and the sensor Fl signalises the event that the work piece is waiting for an operation. The robot arm R has to transport the work piece from the input conveyor to the machine Ml or M2 respectively, in case it is free. Following processing depends on the technology demands. Each of the machines can do several types of operations and each type of operation takes different time. Sometimes the technology needs to produce two different semiproducts from the entered work pieces processing them on one of the machines. Another technology demands can lead to the following change of processing at the robotic cell: Each working piece must be processed by operation on the M 1 and consequently on the M2 or in a reverse order. Serniproduct is transported by robot arm to the free (signal F2) output conveyor belt B2, in both described situations after finishing operations. Both machine, as well as robot arm have their own microcomputer controllers. Operation on any machine starts automatically after workpiece is placed on it and continues during the different time,

The analysis of control problem by using Petri nets is a good basis for programming the control algorithm in real-time multitasking system. In case we use PC with DOS only, there is a very good solution using a multitasking language PEARL (Werum and Windauer, 1989). Comparing PEARL with other common languages, the basic differences are in task control. Especially the keyword 'TASK' is new. Each task unit written in PEARL program Table 2. Meanings of the main commands

Dior D2. respectively. Signal Al or A2 resp. indicates that the operation on machine is active (Table I and 2). The task for control program of the 239

BIMl := 1

transfer command - work piece fromBl to Ml

BIMl := 1

transfer command - work piece from Bl to M2

MIB2:= 1

transfer command - work piece from Ml to B2

MlB2 := 1

transfer command - work piece from M2 to B2

Other:

MIM2, M2Ml. MlBF, M2BF. BFM I. BFM2, BFB2

module, after loading into memory and after starting, operates as an autonomous process and competes with another tasks to get the processor. The following command constructions are available to define the time or event condition for activating the task as well as the task priority for the competition of getting the processor: - task definition : TASK [pRIORITY ]: .... ..task commands ... ... END; - task activation and control ACTIVATE ; SUSPEND []: CONTINUE []; AFTER RESUME; - task termination PREVENT []; TERMINATE []:

introduced Petri net in Fig. 3. Each transition in the Petri net is realized as a task in the PEARL control program including the conditions of the Petri net ransitions firing . Inhibitor arcs in the PN prefer the MIB2 and M2B2 transfers before BIMl and BIM2, and the service of Ml machine before the service of M2 . 3.2. Manufacturing line model control with PE4RL

A laboratory manufacturing line scaled model is built up from the building blocks and functional and units produced by Fischertechnik Ltd. Staudinger Ltd. Companies ( Germany). It was possible thanks to the support, collaboration and kind help of the Institute for Machines and Processautomation, head Prof. Dr. H.-P. Jorgl, Technical University Vienna, Austria. Fig. 4 shows schematically the model layout. The workpieces come separately and irregularly into the manufacturing line. A row of the workpieces stopped at the gate Gt being down. The gate is operated down and up by a pneumatic cylinder C11 . When there is a sufficient stock of the parts at the input a workpiece is pressed down by the cylinder Cl l on the metal plate located between the belt conveyors B 1 and B2. The sufficient stock of the parts is assumed if all 5 photosensors PI through P4 are signaling a workpiece presence at the same time. It follows the number of parts is minimally 4. The associated variables with the photosensors PI through P4 are denoted as F I through F4. In the case of the sufficient stock the gate Gt goes up and the pair of the workpieces moves on the conveyor B2. If it reaches the inductive sensor IS a manipulator Sb shifts the pair aside onto the conveyor B3 which is started to move. When the pair is passing the photosensor P5 the gate goes down and the pairing cyclus can start again. A collision can occur if the manipulator is not in the basic back position while a pair is at the sensor P5, the motor M2 stops and the pair should wait until the manipulator comes back. Then B2 is started again. The paired workpieces move into the working space of the 3 - axial Cartesian robot which magnetically picks up the pair and put it into the one of two machines or into the buffer.

The follo\\-ing program written in PEARL language shows how the mentioned above control problem can be solved. Whole program consists of two program moduls and each program modul keeps several task. Program modul "TECHNOL" supports simulation of the flexible robotic cell on the screen of PC and all process states from this simulation are available as global input variables with the names defined in the Table 1. This program module keeps the tasks for robot moving simulation and work pieces transfer. Program modul "CONTROL" inspects the global input variable from "technology part" then sets the control output variable by means of the Table 2 and consequently activates the task TRANS. There is a part of PEARL program in Fig. 2 linked with the MODULE CONTROL; SYSTEM; PROBLEM; STRT:TASK PRIO 10; ALL 1 SEC ACTIVATE P11; END; P11 : TASK PRIO 11; IF Fl=1 AND P11=1 AND P22=1 AND P20=1 A]\"D P5=O A..l'IJD Pl(Fo() A..l'IJD P12=O THEN BIM2:=I; P11 := 0; P22:= 0; P20:=O; P12:= 1; PREVENT; ACTIVATE TRANS; AFTER 2 SEC ALL 1 SEC ACTIVATE P12;

Students identify the manufacturing process on the Fischertechnik model and put together the system variables table (see Table 3) and a Petri net interpreted for the control (Fig. 3) which specifies control of the model manufacturing line. The meaning of the places and transitions of the Petri net (binary) is given in Table 4. Layout of the partial state of the control associated with particular place is active if the place is marked. Some of the transitions have added logical variables or functions which should be true in order to admit the transition firing. Inhibitor coming of the place P12 removes the conflict at the marked place P6. If P12 is marked

FI]\";

END; P12 : TASK PRIO 11; IF P12=1 AND P19=O AND P13=O A..l'IJD THEN P12 := 0; PI3:= 1; PI9:= 1; PI :=1; PREVEl'oj; ALL 1 SEC ACTIVATE P13; ALL 1 SEC ACTIVATE P19;

M2=1

FIN;

E:"D;

etc. in the same ,",ay.

Figure 2. Part of the control program in PEARL 240

Table 4. Definition of the Petri net places and transitions PI P2 P3 P4 P5 P6 P7 P8 P9 PlO Pll Pl2 P13 P14 Pl5

P 16 TI

Figure 3. Petri net of the control problem

T2

initial state before start of the operation waiting for the input of the workpieces command state: break down, gate up wait for sufficient workp. stock or STOP open the break and close the gate interstate after a pair is at the sensor P5 manipulator was free and a pair moves toward the sensor IS command for the manipulator forward manipulator backward start of the conveyor B3 conveyor B3 free manipulator free stop conveyor B3 because the manip.is busy start B3 again after STOP signal time delay during which no new workpieces are paired and the line is emptied all drives off transition from the initial state when it was waited for the START signal to the state in which the needed drives are set on if there is sufficient stock of the workpieces and P2 was active (marked) passage into the state in which is the break pressed down and the gate opened the meaning of the other transitions is clear from the place definitions and Fig. 5.

T 11 is inhibited and only T6 can fire. In the contrary if Pl2 is not marked T6 cannot fire (token flow rule) but TII is not inhibited and it can fire.

etc.

As described earlier the program is written in the language PEARL and practically tested on the controlled manufacturing line (HrUz, 1994).

3.3. Manufacturing line model control with Allen Bradley system SLC 500

After finishing identification and control of the Fischertechnik model with help of the real-time programming language PEARL students control the same model with the Allen-Bradley system SLC 500, the Advanced Programming System (APS) supporting ladder logic off-line and on-line programs and l\.1MI software Control View.

Table 3. Meaning of the control input and output variables

Input variables Meaning (to the process computer) START=1 start from the operator STOP=1 stop the input and empty the line Fl = I (0) a workpiece is (is not) at sensor PI F2=1 (0) a workpiece is (is not) at P 2 etc.up to F6 ISP= I (0) a workpiece is (is not) at ind. sens. IS PF=1 (0) manipulator Sb is (is not) shifted out PB=1 (0) manip. Sb is (is not) in the basic position Output \"ariables Meaning

Software modules for the projects of studensts require PC AT 486, 8 Mbytes of RAM. DOS version 3.1 or higher, Windows 3. L modular 110 controller with SLC 5/02™ processor communicating across DH 485 network, 1747 AlC isolated link coupler, 1770-KF3 interface module and different modules of the SLC 500™ family. The equipment was built with support of the Allen-Bradley Company represented by SPEL-PROCONT Ltd., Presov, Slovakia to which we express our sincere gratitude.

(commands)

(from the control computer) MDI=1 (0) the belt conveyor Bl on (off) MD2=1 (0) the belt conveyor B2 on (off) MD3=1 (0) the belt conveyor B3 on (off) Vl=l and V2=O cylinder Cl l pushes the the break and V3=O up and the gate Gt down Vl=O and V2=1 cylinder Cl l down Vl=O and V3=1 gate Gt up MF=1 (0) manipulator Sb go forward MB=1 (0) manipulator Sb go back

A control algorithm for designing ladder logic program with help of a Petri net interpreted for control was used (Joms et. al., 1995; HrUz, 1996b). The algorithm consists of four following steps: 1. A ladder rung for each transition ~ is created. The variables that represent a 241

-y

81

Fig. 4. Layout of the Fischertechnik model. marking of the Petri net places and conditions for the transition firing are inputs in the ladder rung. 2. A group of ladder rungs for each place Pj is created. The variable that represents the marking of the place is input in the rungs and the control actions (commands) associated with this place are outputs of these ladder rungs. 3. The initialization operations are represented by a special initialization block that runs only once. 4. The conflicts and unstable situations have to be solved. In our laboratory the control algorithms with inhibitors arcs and timings associated with places were designed.

v, :=,

START V2.V3 :=O MD' .MD2:= ' MD3:=O. MF :=O.MB:='

Fig. 5. Petri net for the manufacturing line.

HrUz,

B. (1994). Discrete event systems modelling and reI-time control. Journal of Electr. Engineering. 45, 363-370. HrUz, B. (1995). Control of discrete event dynamic systems in the context of the flexible manufacturing systems and Petri nets. Report no. 100, Helsinki University of Technology, Control Engineering Laboratory, June 1995. HrUz, B., A. Nierni, and T. Virtanen (1996a). Composition of conflict-free Petri net models for control of flexible manufacturing systems. Proc. of the 13th World Congress of IFAC, June 3~-July 5, 1996, San Francisco, Vol. B. HrUz, B. (1 996b). DeSign of process control based on and Petri nets and Allen-Bradley hardware software components. Proc. of the Workshop on

4. CONCLUSION

An approach to the education of the modelling and control methods of the discrete event dynamic systems were presented in the paper. Some laboratory works were described in more details. The use of the Petri nets as an effective tool for the support of the control design and programming was shown on the chosen laboratory examples.

Petri

5. REFERENCES David. R. . and H. AlIa (1994). Petri nets for modeling of dynamic systems - a survey. Automatica. 30. 175-202 . Ho, Y. C. (1990). Analyzing complexity and performance in a man-made world. An introduction ti discrete event dynamic systems.

Proc. of the

Nets in Industrial Automation, Eds.

M.C.Zhou et al., June 29, 1996, San Francisco. Jams, C. et al.(1995). Automatishe Erzeugung von SPS-Programmen auf der Basis von PetriNetzen. A utomatisierungstechnischepraxis, 37, 10-14. Murata, T (1989). Petri nets properties, analysis and applications. Proc. IEEE, 77, 541-580. Ramadge, P. 1. , and W. M. Wonham 9!989). The IEEE. control of discrete event systems. Proc. 77.81-98. Werum, W., and H. Windauer (1989). Introduction to PEARL. Vieweg, Braunschweig. Zhou, M. c., F. DiCesare, and A. A. Desrochers (1992). A hybrid methodology for synthesis of Petri net models for manufacturing systems. IEEE

11th IFAC World Congress,

Trans.

Tallinn, August 13-17, 1990, Vol. L 66-70.

350-361. 242

on

Robotics

and

Automation,

8,