A language for real time simulation of processes with boolean inputs and outputs
Abstract
This paper deals with the problem of real time simulation of processes with boolean inputs and outputs. A language for this purpose and the programs that processes it is presented. The language allows the description of processes with simultaneous evolutions as a timed petri net type of description is used. Random failures can also be Introduced in the behaviour of the model. The language allows the control of a semlgraphic CRT in order to facilitate the task of following the model behaviour.
Full text
;' " .. IMACS International Association for Mathematics and Computers . in Simulation AFCET ENSM SYMPOSIUM INTERNATIONAL LA SIMULATION DANS LES SCIENCES 'POUR L'INGENIEUR SIMULATION IN ENGINEERING SCIENCES Mai 9-" 1983 . May NANTES (France) PRETIRAGES . PREPRINTS EDITEURS / EDITORS Jacques BURGER Yvon JARNY Laboratoire d'Automatique ENSM - NANTES·
TABLE DBS MATmRES -CONTEN'I'S 1OUTILS DE SIMULATION -Loglciels I SIMULATION TOOLS - Software 1 J -A language for real time Simulation of processes with Boolean inputs l ~~ I 1l.P. Camacho, L.G. F.anquelo, J. Lozano (E) ••••••••••••••••••••••••••••••••••••••••• 3 -Computer aided modelling of complex processes, a program package L .. Marcocei, S .. Sp.e1ta (0 .................................. ............... ~ .................. ~ .............. " ..... 9 -Flexible software package fo. railcar design R.C. Wbite, A.A. Me.abet (CON) ••• 15 ...•..•.••.••••.......•..•...•••••••••••••..• IS -CATPAC ,a software package for computer-aided control engineering M. Barthelmes, P. Breseier, D. Biinz, K. GUtschow, J. Heeger, H.J.Lemke •••••••••••••••• 21 (FRG) II -METHODES DE SIMULATION -METHODES NUMERIQUES SIMULATION METHODS -NUItHlRICAL METHODS -Simulation of on-line state estimation for distributed dynamic systems A. Maslowski (PL) ...... ,.." ......................................... ........ '" ................................. ' .......... • 29 -The use of numerical simulation to verify the efficiency of new PWM strategies for the feedback control of a. D.C. motor drive L. Fortuna, A. Gallo, M. La Cava (J) •••••••••••••••••••••••••••••••••••••••••••••••• 35 -Programmation dynamique differentielle, mise en oeUvre dfalgorithmes et applications J. Lopez Coronado, L. La Letty (1') ................................................. 41 -Linear approximation of nonlinear systems based on least squares methods J.G. den Hollander, J.A. Hoogstraten and G.A.J. van deMoesdijk (NL) •••••••••••••••••• 53 -Simulation of engineering problems USing boundary elements C .. A .. Brebbia (GB}- .. "" .. ~ .... ". ~ ~ ..... " ... " ...... + ...... ~ ... ~"""""",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, .59 1lIOUTILS DE SIMULATION -Materiels I SIMULATION TOOLS -liardware -Graphic model building system - GMBS - Y .. Yamamoto, M. Lenngren (S) ..... " ~ .... "" ................... " .... " ......... "" ...... " .... " .... " ...• 71 -The sole simulation package in Pascal J.E. Rooda, S. Joosten (NL) ••••••••••••••••••••••••••••••••••.••••••••••••••••••••• 71 -UNlSYS -Computer assisted modelling and simulation system . , K.A. Grabowiec:ki (PL) ... " .... ...... " " ...................... ; ...... " " • " ..... " " ......... " " . " ... " " " " ......... " . 83 -Dynamic system simulation in designing computer peripherals M.H. Dcst (USA) " . " ......... ...................... " ............... " ......... * " .................................. " • .. 89 IV - METHODES ET TECHNIQUES DE SIMULATION ET DE COMMANDE SIMULATION AND CONTROL METHODS AND TECHNIQUES -Application d'un outil de simulation II la conception des surfaces geuches , notion de processus interpolateur R.. Haj Nassar, D. Meizel, P. Bielec (P) ................ " ....... ................... " ................ * ..... : 91 -Simulation - Aid to process interaction D. de Buyset-, L. de Wael, G.Co Vansteenklste (B) ••••••••••••••••••••••••••••••••••••• 103 VII
A LANGUAGE FOR ,REAL TIME SIMULATION OF PROCESSES WITH BOOLEAN INPUTS AND OUTPUTS E.F.Camacno, L.G.Franquel0 and J.Lozano E.T.S. Ing. Industriales Univ. Sevilla This paper deals with the problem of real time simulation of processes with boolean inputs and outputs. A language for this purpose and the programs that processes it is presented. The language allows the description of processes with simultaneous evolutions as a timed petri net type of description is used. Random failures can also be Introduced in the behaviour of the model. The language allows the control of a semlgraphic CRT in order to facilitate the task of following the model behaviour. 1. INTRODUCTION Simulatio~ is a fdndamental,todl .~hen ~e. veloping logical automatas, especially,= when those automata~ are d~signed to can trol complex processes or proceises whe= re testing is expensive. As an example - the starting up and shutting'down procedure of a hydroelectric power unit or -- controlling substation operations, where on-line testing of the automata should be avoided as much as possible due to -- the risk of damaging expensive equipement while running the experiment. The simplest of all pOssible boolean si~ mulators consists of a set of switches, simulating process inputs, and lights, simulating process outputs. The automata is connected to these and a human operator moves the switches as the plant wo-- ula do according to the sequence of or-- ders received from the automata. The.human operator is in this way simulating - the behaviour of the plant. This method of testing an automata has tree major -- drawbacks. The first one is that human - operators are very slow; it can take 15 seconds or more for the operator to de-- cide which switches must be changed if - the process he is simulating is complex enough. The second disavantage is that due to frequent errors the system is not properly simulated. Finally it is very dolfficult to carry out systematic tests with this method. Therefore only very -- slow or simple processes can be .imula-- ted with thl s method in real time. A hardware model of the plant overrides all these problems.but it is normally very costly and unflexible. This paper presents a software simulator implemented in a POP 11/23 computer. The simulator consists of a language and a - collection of programs for processing it The language Is based on the Petri Nets approach for describing automatas. The overall system structure is descri-- bed in the next section. The language Is . treated in section 3 and some.examples '. are given in section 4. 2. SYSTEM STRUCTURE AND FUNCTIONING The structure chosen for the simulator - can be seen in figure 1. It consists of a computer connected to the automata to be tested and to a semi-graphic CRT that allows an interactive simulation. The au tomata is connected to the computer vla- ,parallel input-output digital ports. Serial Computer ~ Line /) • 7 Automata F1qure 1. System structure Once the model is running, manual operations can be introduced easily using the keyboard attached to the CRT. As an exa~ ple, when simulating an electrical substation a breaker can be manually opened or closed by the operator While the mo-- del is running. A mimic can be related to the model and it will appear on the screen as soon as the simulation program begins. Up to 128
active points can be defined for each -- application. These points are related to 4 boolean variables t>lO of which are asSOciated to the keyboard (inputs for the simulator) and the other two to the scr~ en (outputs for the simulator). ' The keyboard signals are activated positioning the screen cursor on the active position and pressing one of the four -- predefined keys that are associated with the values 00, 01, 10, 11 for the two keyboard signals mentioned above. As was mentioned before, these keyboard yaria-- bles will simulate manual operations and wll1 be considered as input signals for the model. In the example of the circuit breaker mentioned above, an active point could be related to it and the open and , close would be associated to the two keyboard signals corresponding t6 that active point with values 10 and 01 respectively. The non logical conditions (11) of these signals can be used wi~hln the model to declare a defective breaker -- whiCh can be useful to 'test 'the automata under malfuncti~ning of the process. > The two screen signals'mentioned before are output variables for the model. Up to four symbols can be associated t~ the four possible values of these two s~g-- nals. The simulator will represent ln -- the related active point the symbol corresponding to ,the values of the varla---, bles. These variables are very useful -- for'an interactive simulation of the pr~ cess, as the model behaviour can be eas~ ly followed on the screen. Besides the keyboard and screen varia--- bles.mentioned above, the simulator allows the use of 512 input-output Signals connected to the automata. Internal boolean variables (up to 256) can also be used. These internal signals are useful for connecting Petri Nets. In order to simulate stochastics failu-- res or evolutions In the model, up to 32 randomly generated boolean signals are provided. The first 16 of these signals a~e generated by a 1 second clock whilst th'e other 16 with a 1 minute clock. The way of operating the simulator can be seen in figure 2. The model is defi-- ned in a simulation language that will be described in the next section. The model is compiled and the tables and code necessary for the simulation program are produced as is shown in figure 2. The slm~latlon program reads the output data of the compiler and the graphic representing the process from a ~isk. . With this information and the lnput Slgnals (external , internal • keyboard and random) the simulator moves the output signals (external, internal an~ s~reen) according to the process descrlptlon and its actual state. A matrix method (2) Is used to compute - 4 the marking of the nets. The amount of memory and the computation required decrease considerably if instead of using a single big net for modelling the system, various small nets are used. Tables and Code '. , ... , Net Processo Figure 2. System operation. 3. SIMULATION LANGUAGE. To facilitate the task of modelling, a simulation language has been defined and its processor implemented. The language uses the Petri Nets approach all~ wing a model to contain several Petri Nets. ' Each net defined In the model begins and finishes with reserved words. La--- bels can be associated with the boole-- ans v4riables described in the previous section. The labels can be then used as outputs associated to the marking of any place or can be used as part of an expression in a transition. Labels can be global, valid for all --- nets or local to a net. Labels can be asso~iated with a boolean signal specifying type and number of signal o~ Indi cating only type. The processor wl11 associate the next free signal of that - type in this last case. This and the p~ ssibility of using local labels allows the effective use of a macro processor, which is implemented within the program, thus facilitating the modelling of systems with repetitive parts (see example of substation given below). Four labels can be assigned to a screen active point, giving the coordinates. - The first two correspond to the keyb~- ard and the last two to the screen Slgnals. The four graphic simbols associated with the screen labels must be gi-- ven in the asignation instruction.
Transitions are defined indicating their number (within the nft), the places entl ring and leaving the transition and a b~ olean infix expression associated with it. The expressions can contain any la-- bel previously defined, the boolean operators NOT, AND, OR and parenthes;s. The net structure ;s defined onCe all -- the transitions have been specified. Ou! puts are, ;n this mOdel, associated to - the marking of the places. Therefore it is necessary to use another type of instruction speCifying the init;al marking of the places and the outputs related to them if any. It is also possible to in-- traduce timed Petri Nets. this is achieved by specifying the time delay associ~ ted with each place-if .ny;,The marking' of a place Is not effective (for outputs or validating transitions) until this dl lay time has elapsed. 4. EXAl~PLES To illustrate the scope of the language. two of the applications where the simul! tor has been used are described. The --- first one is a model for an elect.'ical - substation. The'second example is a .hy-- droturbine generation unit. Awtomatas to control some functions of-these two systems are being developed and the simulatoris being used to test the behaviour of the automatas. 4.1 Electrical substation This example shows how easily systems -- with repetitive parts can be described with the language presented. As was mentioned in the previous para--- graph. an automata for controlling cert! in aspects of the operation of electrl-- cal substations is being developed. This automata is based on microprocessors and has three main functions: load shedding, automatic reclosure and faulty ground -- detection. The model of the SUbstation - should therefore reproduce in its behav! our those aspects of the behaviour of .- the substation which are relevant to the functions mentioned above. The two main elements In a substation are circuit breakers and line switches - as a substation contains several of these elements, they will be defined as macros. The program listing for the macro deseri !ring the circuit breaker is the, fOllON~:-' ing: 01 .MACRO BREAK XX,VV 02 NET 03 !!'<!.=:X+ 04 &SA=O'" 05 &;SC=O+ 06 &E:A=I ... 5 07 ~<EC=I'" 08 ~(TA7&TC.,&PA,~(PC=XX.,yy '.7'6,97,OlX 0';>· TR 1 FROM 1 TO 2 EX &TC*'&TA ... ~,EC*·'~<EA 10 TR 2 FROM 2 TO 3 EX '(&TC*&TA) 11 TR 3 FROM 3 TO 4 EX '&TC~&TA""&EC*&EA 12 TR 4 FROM 4 TO 1 EX r (~,TC"$<TA) 13 PL 1 M 1 &PA,&SA 14 PL 2 T S :2 15 PL 3 &PC.&SC.&I -16 PL 4 T S 2 17 ENDNET 18 .ENDM &TC*'&TA+ &Ee*-&EA - (&TC*&TA) '&PA,&SA ~(&TC*&TA) T=2 sec. -&Te*&TAt -&Ee*&EA Figure 3 Cir6uit breater Petri Net. Lines 2 and 17 correspond to the instru~ tions specffying the begining and end of a Petri Net. Lines 3 to 7 are label definitions, the symbol & specifies that these labels are local to the net. The label &1 will be associated with the next available Inte~ nal signal, the labels following.&SA,&Se &EA and &EC will be associated with-- the following two available output and input signals respectively. Signals &EA and &EC are aSSOCiated to the open and closure orders to the circuit breaker,whilst the local labels &SA and &se are associated to the open and closed position switches of the circuit breaker. The internal signal &I will be used inother nets where the circuit bre~ ker position needs to be known, as is -- the case of the faulty ground detection where topological considerations are nel ded. Line 8 of the listing corresponds - to the definition of an active point on the screen. In this case only One active point is associated with the circuit bre aker. The signals &TA and &Te correspond to the teyboard signals associated with the breaker. simulating as was mentioned before. manual operation on the circuit breaker. &PA and &pe correspond to the screen variables for the active point and the four parameters at the end to -- the symbols that will be associated with the four possible values of the signals
&PA and &PC.The parameters XX and yy are the relative x-y position of the active point On the screen. Lines 9 to 12 describe the transitions - of this particular net. As it can be seen, they are defined by the"iii-put and output places and by the associated boolean expression. Lines 13 to 16 define the initial marking of the places. the associated output and time-lag. Line 14 specifies that a 2 second time delay should be Observed for - place number 2. A line switch can be modelled using an identical net tO,the one described above except for the external input' signals. which are non existent as the automata Is not going to alter line switches,and the screen representation which is also di - fferent. Figure 4 shows the screen repres~ntatio. of a coupling cell and a line cell.The~e types of cells can be defined as follows .MACRO CELLIN OX,OY X=OX' Y=Oy LINE CELL POS. OX.OY ; LINE BREAKER POS. OX+5,OY+4 BREAK 5,4' LINE SWITCH IlllS 1 POS. OX+7,OY+2 SWITCH 7,2 ; . LINE SWITCH BUS :2 POS .. IJX+~h OY+2 SWITCH 3.2 ; SWITCH BYPASs pas. OX, 0'1'+2 SWITCH 0,2 ' LINE SWITCH pas. OX+5,OY+6 SWITCH 5-,6 VL 5,9 .ENDM LINE VOLTAGE pOS. OX+5,OY+9 .MACRO COUPL OX,OY , COUPLING CELL POS. OX.OY X=OX '1'''''0'1' , COUPLING eREAKER POS OX+2.0Y+4 SWITCH 2.4 SWITCH BUS 1 POS. OX+4.0Y+2 SWITCH 4.2 SWITCH ElIJ:; 2 POS. OX,OY+2 SWITCH 0,2 .ENDM The program line with VL is a macro call to a Petri Net where the line voltage is simulated. The general program of a mo - del that only takes into account the behaviour of the switches and breakers is given in the following listing. 6 o 1. 2 ,3 4 5 6 7 8 9 0074 0075 0076 0077 0078 0079 0080 0081 0082 00$3 0064 0085 0086 0087 OOss 00S9 0090 0091 0092 0093 0094 0095 0096 0097 0 1. 2 'I L_, , COllF"L CELLIN CELLIN CELLlN CELLIN CELLIN CELLIN COUPLU CELLlll CELLIU CELLIU CELLIU CELLlIJ CELLIU X=O ¥=O SWITCH , SWITCH END 3 4 / I - .J PROGRAM 3.12 11712 22 .. 12 33,.12 44,.12 55,12 66,12 3.10 11 .to 22,10 3::-!~ 10 44,10 55,10 66.10 SwITCH ells 1 76,.11 SWITCH BUS 2 78,1l o 1. 2 3 4 5 6 ,/ " I + Figure 4. Coupling and 1.ine cel1.s SCreen representations 7 / The mlmlC representation associated to' this program can be seen in figure 5.As it can be observed this model only considers the isolated functionihg of the main elements of the substation_ More Pe tri Nets have been developed to simu1a-- te other aspects of the behaviour of the process. As an example. let us consider the faulty ground signals generation, These signals are obtained at transformers and should be computed (by the simulator) taking into account the faulty lines and busbars (declared by the operator via keyboard Signals) and topological considerations (depending on the status of the circuit breakers and line switches). For this purpose four internal signals are defined. These signals represent a faulty ground transm1ted to one of the four busbars. and are set if one or more faulty grounded lines are -
connected to the respective busbar or if a busbar ground signal has been set by-the operator. To obtain these signals a trivial Petri Net with four places is associated with each line cell. The faulty ground signals on the trans - formers are then easily computed from the busba,s faulty ground signals and ve ry simple topological considerations on the transformer cells status. 4.2. Hydroturbine power unit. A model of a hydroturbine power unit has been developed to test on automata con - trolling its star.ting up .and shutting - down procedures. TO show'the scope of t~ model let us sumarize the starting up p~ cedure taken from (3}. After a local or remote start up order has been received and once the security conditions have been checleedthe star-· ting pltot valve is operated. After that. the limiter of the hydraulic actuator is reset to the no-load position, the gate apparatus is opened and control is tran~ fered to the automatic synchronization - equipment once the generator speed is :- o.ver a porcentage of. its nominal value. Thesecuence of operations In the normal shutting down procedure is practically the same but in reverse order. In the ca se of an emergency shut down the secuen~ ce is simpler as most of the elements of the unit are turned off at the same tima From the automata pOint of view, the hr droturbine power unit consists of a set of elements that behave as logical systems. For example the oil system with two inputs (activating and disactivating the oil pumps) and one output that is - set after a time lag which depends on - the oil preassure is adecuate. This behaviour Is very easily mOdelled with a two places Petri net. The behaviour of the hydroturbine is mo delled with a Petri Net composed of a doubled linke~ chain of timed places. - The outputs of these places correspond to the speed relays of 0.5, 20, 90 % , and overs peed and the evolution of the marks depending on the valves positions. . Various types of failures can be intro~. duced in the behaviour of the model via keyboard signals. For instance keyboard signal is used in the transition between places with outputs associated - with 20 and 90 %. When this keyboard - signal is set the transition .is not va lldated and a time out alarm should be produced In the automata. Other aspects of the unit are modelled this way. The • 11 {{ I Figure 5. Substation Screen ~1imic. 7
screen mimic associated with the model - can be seen in figure 6. For thele two examples presented, the c1 cle time has been smaller then 0.2 se -~, conds. 60th of them containing over 400 places and about the same numbe~ of traa s1tions. CONCLUSIONS. A software simulator for modelling boolean systems bases'on the Petri Nets - description approach has been implemented. The simulator ,allows an interactive operation via a CRT, which has pro - ved very helpful in the cases simulated to increase the description power of the' lenguage, output functions are now befng Impl emented. , ."-' . -.: ,- ACKNOWLEDGEMENT. The authors would like to acknowledge - the help of the Cia. Sevillana de Electricidad for supporting this project.Co mments by Mr. J.C. Serrano, J. Colmener~ F. Mateo and J.'·Montaner were especially helpful. REFERENCES: 1 Peterson,J.L. Petri Nets, A.C.M.Comp. Surveys, vol. 9, n03 (1977), 223-251. 2 Oacl!n, E. and Blanchard,M., Synthese des Systemes Logiques (Cepadues, 1976). 3 Barzan A., Automation in Electrical POwer Systems.(Mir, MoscOW, 1981). , .... ~ , . • . I ---------------0-- -- ------ ---- - -- - , I'SYN~l" .',', I~ "OHVAR . ( 'CALE. >TEHP. 'DESL ••• 5X '20. '907aSI'REC 'FRENOS;[~~~§~:;:=====~ 'V.RIECO I111II111II .CIRCUL. -IHUND. :::::::: ::: = 'PRESION ~ . ____ .....,n-_~.ELECTRO 11111111111 -SOH BAS - 'B.REFR. -LIHITADOR _CARCA VELOC. Figure 6. Hydroturbine Screen Mimic. 8