© Strojni{ki vestnik 50(2004)10,469-486 © Journal of Mechanical Engineering 50(2004)10,469-486 ISSN 0039-2480 ISSN 0039-2480 UDK 658.52.011.56:681.51 UDC 658.52.011.56:681.51 004.42 004.42 Kratki znanstveni prispevek (1.03) Short scientific paper (1.03) Napredni mehatronski postopek na~rtovanja odprtega krmilja strojev An Advanced Mechatronic Approach to Open Machine-Control Design Ale{ Hace - Ale{ Poli~ - Karel Jezernik Prispevek posega na področje proizvodne avtomatizacije v okviru prilagodljivih proizvodnih sistemov. Predstavljen je nov mehatronski postopek snovanja krmilja strojev, ki uvaja interdisciplinarni način celovitega načrtovanja strojev, pri katerih so mehanski, elektronski in informacijski vidiki proizvodnega sistema obravnavani sinergijsko. V prispevku je opisan krmilnik rezalnega stroja, ki je zasnovan na porazdeljeni zgradbi krmilja in z novimi postopki snovanja krmilnih funkcij. Zgrajen je na arhitekturi osebnega računalnika z odprtim operacijskim sistemom realnega časa QNX. Široko razširjeno grafično okolje Microsoft Windows rabi kot vmesnik človek - stroj. Krmilnik in uporabniški vmesnik sta povezana s protokolom Ethernet TCP/IP in se tako lahko povezujeta tudi na pisarniško raven omrežja avtomatizirane proizvodnje. Za opis logičnih krmilnih funkcij je predstavljena nova metoda, ki temelji na matričnem opisu Petrijevih mrež. Omogoča simulacijo in analizo sistema s čimer se lahko bistveno skrajša razvojni cikel izdelave krmilja stroja, obenem pa je združljiva s običajnimi načini za programiranje logičnih krmilnikov. Krmilje je tako bolj zanesljivo in učinkovito ter prijazno do uporabnika. © 2004 Strojniški vestnik. Vse pravice pridržane. (Ključne besede: avtomatizacija proizvodnje, RNK-PLK, sistemi operacijski časovno realni, sistemi vodenja, mreže Petrijeve) This paper addresses the field of factory automation within the scope of flexible production systems. It presents a new mechatronic approach to machine control, which introduces an integrated and interdisciplinary method to holistic machine design. The mechanical, electronic and informatics aspects of a production system are involved synergistically. The paper describes a distributed control architecture for a cutting machine. In addition, it applies a new approach to the development of control functions. The controller was built on the open QNX real-time operating system for the PC architecture. The commonly accepted graphical-user-interface environment of Microsoft Windows serves as the front-end of the HMI The controller and the HMI are interconnected by an Ethernet TCP/IP link that is extended to the office-level of factory automation. A new method for describing logic control functions introduces a modular logic controller that is specified and formalized using a matrix representation of Petri nets. It allows a system simulation and an off-line analysis that can significantly shorten a machine control development cycle. The new method is compatible with standard programming languages for logic controllers. Furthermore, it represents a basis for the design of more efficient, reliable, and user-friendly machine control. © 2004 Journal of Mechanical Engineering. All rights reserved. (Keywords: factory automation, CNC-PLC, real-time operating systems, embedded systems, Petri nets) 0 UVOD Sodobni stroji so tehnološko zelo zahtevni, avtomatizirani, v prihodnosti pa se bodo morali bolje prilagoditi proizvodnji na zahtevo. Zato se v zadnjem času raziskave in razvoj na področju proizvodnih sistemov usmerjajo k takšnim rešitvam, ki bodo izboljšale prestrojlivost (rekonfigurabilnost), prilagodljivost, hitrost in točnost, z namenom skrajšanja razvojnih ciklov izdelkov in odzivnih časov na nove zahteve trga. Za uresničitev teh ciljev je treba razviti: 0 INTRODUCTION Modern machines are technologically very demanding and highly automated. However, in the near future they will improve in terms of production-on-demand performance. Therefore, the research and development goals in the field of production systems involve solutions that will allow for the creation of production systems with a higher degree of reconfigurability, flexibility, speed, and precision, in order to improve the response to new market demands and to cut the time-to-market. In order to achieve stran 469 bcšd04 Hace A., Poli~ A., Jezernik K.: Napredni mehatronski - An Advanced Mechatronic - inteligentne proizvodne postroje z novimi mehatronskimi moduli, ki se bodo zmožni prilagoditi na procesno usmerjene proizvodne zahteve, - prestrojlive inteligentne krmilne zgradbe in sisteme za krmiljenje takih postrojev, - metode in vtične enote za komunikacijo med postroji, - inteligentne vmesnike človek - stroj za enostavnejše upravljanje postrojev, - mrežna orodja za porazdeljeno proizvodno avtomatizacijo, - inženirska orodja za oblikovanje krmilnih sistemov, simulacijska orodja in okolja, komunikacijske algoritme, protokole in jezike. Naštete komponente lahko razdelimo na komunikacijske module, module za vodenje procesov in krmilne module ter module z dodatnimi procesnimi funkcijami. Dodatne procesne funkcije lahko vključujejo tako strojne kakor programske rešitve za izvedbo večfunkcijskih strojev, ki se bodo znali prilagoditi zahtevani nalogi. Krmilni moduli vsebujejo odločitveno logiko, usmerjanje prenosa materiala, polizdelkov in izdelkov, nadzor in zančno krmiljenje procesov, proizvodne informacije ter dodatno še komunikacijske funkcije. Tako se lahko stroj prilagaja spremembam proizvodnih parametrov, pri čemer proizvodno strategijo lahko izbiramo tudi v skladu z drugimi stroji. Odprta porazdeljena zgradba vodenja mora torej podpirati funkcije krmiljenja strojev, komunikacije med stroji in optimizacije proizvodnje. Uporabniški vmesnik pa mora operaterju omogočati simulacije proizvodnih postopkov, nadzor in morebitne intervencije med izvajanjem, logistično podporo ter e-podporo in e-vzdrževanje. Nova shema proizvodne avtomatizacije mora biti izoblikovana, izvedena in testirana v industrijskih uporabah. Mehatronika uvaja nov, integriran in interdisciplinarni način celovitega načrtovanja izdelkov, kjer so mehanski, elektronski in informacijski vidiki proizvodnega sistema obravnavani sinergijsko. Pomeni osnovo za nove inteligentno krmiljene naprave z napredno funkcionalnostjo, večjo zanesljivostjo in boljšo učinkovitostjo. Prispevek je metodološko osredinjen na praktični inženirski temelj za načrtovanje, oblikovanje, izvedbo in delovanje inteligentnih proizvodnih sistemov. Je uporabno naravnan in uvaja mehatronski način načrtovanja funkcij računalniškega numeričnega krmilnika [5] in logičnih krmilnih funkcij [12]. Načrtovanje krmilja stroja poteka takole: najprej so predstavljeni tehnologija tipičnega sodobnega rezalnega stroja in načelo delovanja ter glavne strojne funkcije. Sledi zasnova grafičnega uporabniškega vmesnika za učinkoviti nadzor in krmiljenje stroja, določena je zgradba strojne opreme za krmilje stroja, na koncu pa so razviti algoritmi krmiljenja stroja in predstavljeni nekateri rezultati. 0 srinatäieflMliBilrSO | ^BSfirTMlliC | stran 470 this improved performance, the following technical items need to be delivered first: - intelligent production machinery with smart mechatronic modules capable of adapting to process-oriented manufacturing requirements - re-configurable intelligent-control architectures and systems - methods and plug-in units for intermachine communication - human-machine interfaces for collaborative production automation - networking tools for distributed production automation - engineering tools like control-system configurator, simulation environment, communication algorithms, protocols and languages The components can be classified as communication/control modules and modules with additional process functions. These additional functions can consist of both hardware prototypes and software solutions to realize multifunctional machines, self-adapting to the required task. The control modules contain decision making, routing control, process control, and production information. Further extensions can make possible machines that communicate with each other, with the product, and with resources. The machine can smoothly adapt to changing manufacturing parameters by negotiating the best manufacturing strategies with other machines and/or other products. An open, distributed control architecture must be developed to manage control & communication and optimization. However, human– machine interaction will involve process monitoring, e-assistance, logistics, coaching of external experts, e-maintenance, simulation presentation and process intervention. The new production automation scheme must be configured, implemented, and tested in industrial applications. Mechatronics introduces a new, integrated and interdisciplinary approach to the overall design of products in which mechanical, electronic, and informatics aspects are treated synergetically. Mechatronics presents a basis for a new, intelligent controlled product with advanced functionality, higher reliability and better efficiency. This paper focuses methodologically on the engineering platform for the design, configuration, implemention and operation of intelligent production systems and describes an application of CNC control [5] with a matrix logic controller [12]. It enters the mechatronic design of the machine-control as follows: a typical modern cutting machine and its purpose are presented as well as outlining the technology, the main machine functions and the operation principle. Further more, a graphical user interface for efficient machine management is designed. An appropriate hardware platform is determined and finally, control algorithms are developed and some results presented. Hace A., Poli~ A., Jezernik K.: Napredni mehatronski - An Advanced Mechatronic 1 REZALNI STROJ Nova tehnologija rezanja z vodnim curkom je v primerjavi s sedanjimi tehnologijami veliko bolj prožna in zato bolj prilagodljiva sodobnim tržnim razmeram, omogoča pa tudi hitro izdelavo prototipov in razvoj popolnoma novih izdelkov. Obravnavani rezalni stroj je namenjen razrezu usnja, tekstila in sintetičnih materialov, uporaba te tehnologije je mogoča tudi na drugih področjih, npr.: kamnoseštvo, steklarstvo, lesarstvo, papirništvo, gumarska industrija, obdelava pločevine, živilska industrija itn. XY sistem XY system 1 THE CUTTING MACHINE New waterjet-cutting technology is, in comparison with existing technologies, more flexible and therefore more favorable to market demands. It enables high-speed prototyping, just-in-time production and the development of new products. The presented cutting-machine paradigm can be used for cutting leather, textiles and synthetic materials; however, the technology potential extends to the cutting of stone, glass, sheet metal, paper, rubber, it is also applicable in the food industry, etc. Izhodna sekcija Output section Vhodna sekcija Input section Podajalni valji Feeding rollers Prenosni sistem Transport system Sl. 1. Rezalni stroj Fig. 1. Cutting machine VT črpalka^ HP pump Stroj sestavljajo trije poglavitni deli: prenosni sistem, sistem XY in visokotlačni rezalni sistem. Shematsko je stroj prikazan na sliki 1. Prenosni sistem podaja material v rezalno sekcijo in ga drži v času rezanja. Sestavljata ga prenosni trak in podajalni valji. Podajalni valji dozirajo material za razrez na prenosni trak. Prenosni trak prepelje material v rezalno sekcijo, odrezke pa iz rezalne v izhodno sekcijo, kjer jih operater pobere in odloži na paleto. Taka zasnova prenosnega sistema omogoča zvezno podajanje materiala v rezalno sekcijo. Omogočeno je tudi rezanje delov, ki so daljši od rezalne sekcije stroja. Sistem XY predstavljata medsebojno pravokotno nameščeni osi, ki ju poganjata zmogljiva servomotorja. Os X sestavljata dve vzporedno ležeči vreteni, ki ju poganjata ločena servomotorja. Vreteno osi y leži na obeh vretenih osi x. Rezalna šoba je nameščena na osi y, z visokotlačno hidravlično črpalko pa je povezana prek prožne cevi. Takšna razporeditev koordinatnih osi omogoča optimalen dostop do rezanega materiala ne glede na položaj rezalne šobe. Osnovni režim obratovanja stroja je avtomatski cikel. Funkciji prenosa materiala in rezanja The machine consists of three main parts: the transport system, the XY system and the high-pressure cutting system. Figure 1 presents the machine schematically. The transport system passes the cutting material into the cutting section and holds it during the cutting period. It consists of a belt conveyer and feeding rollers. The feeding rollers pass the cutting material on the belt conveyer. The belt conveyer transports the cutting material into the cutting section, while the cut pieces are transported to the output section simultaneously. The cut pieces are then picked up by the operator and put onto a pallet. Such a transport-system construction makes possible the continuous cutting-material feed, which is important for cutting pieces longer than the cutting section itself. The XY system is a two-axis coordinate table. The axes are perpendicular to each other and powered by high-performance servo drives. The x-axis consists of two parallel ballscrews, driven by separate drives, while the y-axis lies over the x-axis ballscrews. The cutting nozzle of the high-pressure cutting system is placed on the y-axis and connected to a high-pressure hydraulic pump with a highly flexible pipe. The basic operation mode of the machine is within an automatic cycle. The functions of material gfin^OtJJlMlSCSD 04-10 stran 471 |^BSSITIMIGC Hace A., Poli~ A., Jezernik K.: Napredni mehatronski - An Advanced Mechatronic se izvedeta zaporedno znotraj posameznega cikla. transport and cutting are performed sequentially Med rezanjem stoji operater pri izhodni sekciji in within a single cycle. The operator is standing at the pobira odrezke predhodnega rezanja. Po koncu rezanja output section and taking out the cut pieces. In the in po spraznitvi izhodne sekcije se izvede nova faza meantime, the cutting procedure is continuing. As prenosa materiala. soon as the cutting is finished and the output section is empty, a new transport phase is executed. 2 KRMILNIK 2 CONTROLLER Sl. 2. Splošna krmilna shema Fig. 2. General machine-control scheme Krmilnik stroja skupaj s konstrukcijsko The machine and controller must be zasnovo stroja mora zagotavljati želeno designed so as to ensure the desired functionality, funkcionalnost, hkrati pa mora omogočiti varno in as well as safe and efficient machine management učinkovito upravljanje stroja (sl. 2). Krmilje tako (Figure 2). Such machine control is composed of vsebuje več funkcij, ki jih lahko v grobem razdelimo functions divided into machine technology functions, na tehnološke funkcije, funkcije upravljanja in machine management functions and machine auxiliary pomožne funkcije. Med tehnološke funkcije štejemo functions. The machine technology functions cover tiste, ki so povezane z osnovnim namenom stroja, the machine’s elementary purpose, such as drilling, npr.: vrtanje, rezanje, varjenje ali zgolj pozicioniranje. cutting, welding or positioning. The machine’s Med pomožne funkcije uvrščamo tiste splošnega auxiliary functions are general purpose functions, namena kakršen je nadzor delovanja stroja, varnost such as monitoring operating conditions, machine ljudi in opreme, razpoznavanje napak in odpravljanje and operator safety, fault diagnosis and fault motenj v delovanju. Funkcije upravljanja so recovery. The machine management functions are usmerjene k operaterju, da dosežemo učinkovito operator-oriented functions for efficient machine uporabo in upravljanje stroja. Namenjene so usage and managing. They are intended for the user komunikaciji človek - stroj in so navadno izvedene to communicate with the machine and are usually na tekstovnih ali grafičnih opravilnih panelih z implemented on textual or graphical operating panels dodanimi krmilnimi gumbi. Opravilni panel je priključen supplemented with pushbuttons. The operating panel na programljivi logični krmilnik (PLK) ali računalniški is connected to the programmable logic device and numerični krmilnik (RNK), ki izvajata algoritme numeric control, which implement control algorithms. krmiljenja stroja. Ti se lahko razdelijo na vrednostno The control algorithms can be divided into value-in dogodkovno naravnane algoritme. Vrednostno handling algorithms and event-handling algorithms. naravnani algoritmi (numerično krmilje) kakršno je The value-handling algorithms, such as positioning, pozicioniranje, so navadno izvedeni na RNK. are usually implemented on computer-numerical-Dogodkovno naravnani algoritmi (logično krmilje), ki control (CNC) devices. The event-handling vključujejo funkcije, kakor so zagon in zaustavitev, algorithms, such as start/stop, are usually so navadno vgrajeni na PLK. Izvedba tako obsežne implemented on programmable logic controllers in zahtevne strukture krmilnih funkcij je mogoče le z (PLCs). In order to implement such a complex and zahtevno krmilniško zgradbo. Pri gradnji zanesljivih extensive set of machine-control functions, a complex in zmogljivih strojev z zahtevno tehnologijo, visoko control architecture is necessary. This demands an stopnjo samostojnosti ter prijaznim upravljanjem, je integrated design approach that considers treba uporabiti integriran postopek načrtovanja complicated technology, a high machine performance, krmilja. V svetu še vedno prevladujejo sicer zelo high level of autonomy, short recovery times and zmožni, a zaprti RNK/PLK sistemi, vendar pa se v user-friendly management. Capable hardware-based zadnjih letih v praksi vse bolj uveljavljajo tudi krmilja, proprietary CNC/PLC systems still dominate the world ki uporabljajo tehnologijo osebnih računalnikov (OR). of machine control; however, a PC-based control 0 srinataleflMllBilrSO | ^BSfiTTMlliC | stran 472 i Hace A., Poli~ A., Jezernik K.: Napredni mehatronski - An Advanced Mechatronic Programska oprema za nadzorni vmesnik človek - stroj (VČS), za upravljanje stroja, logične krmilne postopke in krmilne algoritme je zgrajena modularno ter na voljo za sprejemljivo ceno. Sistemski integratorji lahko preprosto kombinirajo strojne in programske komponente za gradnjo učinkovitih, standardnih in odprtih rešitev krmilnih sistemov, s tem pa se izognejo uporabi dragih zaprtih sistemov z omejeno funkcionalnostjo. Pri načrtovanju odprtih sistemov, ki uporabljajo standardne strojne in programske rešitve, so manjši stroški, takšen sistem je mogoče razširiti in dograditi ter omogoča izboljšave v prihodnosti. Koristi vključujejo ne le nižje stroške, pač pa tudi boljšo funkcionalnost sistema in komunikacijsko povezavo s podjetjem. Poleg tega je mogoče skrajšati razvojni cikel, z uporabo simulacijskih orodij in orodij za razpoznavanje napak pa se skrajša tudi čas zastojev v proizvodnji, s čimer se poveča produktivnost in zmanjšajo vzdrževalni stroški. 2.1. Vmesnik človek - stroj Grafični uporabniški vmesnik (GUV), ki je predstavljen na sliki 3, je glavni del VČS na rezalnem stroju. GUV je izveden na zaslonu osebnega računalnika krmilnega sistema in združuje vse prikaze ter funkcije, ki so potrebne za upravljanje stroja. Namen GUV je, da zagotovi uporabniku prijazen nadzor nad delovanjem stroja. Uporabniku sporoča vse koristne strojne informacije na zaslonu nadzorne plošče, to so: - splošne informacije, ki vključujejo režim in način obratovanja stroja (avtomatsko/ročno, izvajanje/ ustavitev), ime in stanje trenutnih tehnoloških technology has become a widely used industry practice in recent years. Software for a human– machine interface (HMI), machine-control, sequence control, logic control and motion control has been modularized and is now available at a reasonable cost. System integrators can now easily package hardware and software components when building effective open-standard control systems and eliminate the dependence on costly, low-function proprietary systems. An open-system design that uses standard hardware and software minimizes cost, permits system scalability, and ensures future performance enhancement. Benefits include, not only cost reduction, but also improvement in the functions and communication to the enterprise. Moreover, it allows for faster design cycles, lower downtime using diagnostics and simulation tools, increased productivity and decreased maintenance costs. 2.1 Human–Machine Interface The main module of the cutting machine HMI is the graphical user interface (GUI), which is presented in Figure 3. The GUI brings together all of the displays and functions for the management of the cutting machine. It provides user-friendly machine-operation control and has all the relevant machine information on the monitor screen, this includes: - general system information, which comprises the machine operation mode (auto/manual), the execution mode (running/stopped), the name of the procedure that is actually performed, and other MENJAVAMI? t/ Varnostna rtalaZAFRIA X 5rro;VKiOFUEIJ X PnemiskiasleriiVKLOPLJEN X PnewiK^isisLardPRIFRÜVUEM ÜAPAJANJE PRIPRAVLJENO H es FRIFRSMJEWE ZA MEHJJMTJ PogwTS FfilPRAVUEH Vamoslna zra;a püdapUraSlOE MJEHA Vaingilna zax::a atfemaplire SKLENJENA X Gumb PftlTISiilEN okno procedure procedure window kontura rezanja cutting contour V -¦= - = n -jkÜ&Roanift^ <*l UpojLevEfjprc^r-EriiBiOi-iaiia^ne hftiosil O Spreniani hi:o:li na "-' f/ogs-n-I.T- ,.s.i' osü r---------------J------------------- 20 MD O Eprcrrwni piorjianskc lihosli w yisdmst f—J---------------------------- IMUN 'fi ' Fiiniiii ; -We3Hsin9: V-80,01*1681100 X=E16.93:Y=727 29 I i^l^vHtS J ^ j: Ü^ ® E Šli I1235.52I2112J Reian lL35KI2131JPJa»; ' ¦ fiii: 23421 \----\W: kronologija sporočil message history ,napake "faults Za^i Sl. 3. Grafični uporabniški vmesnik Fig. 3. The graphical user interface gfin^OtJJlMlSCSD 04-10 stran 473 |^BSSITIMIGC Hace A., Poli~ A., Jezernik K.: Napredni mehatronski - An Advanced Mechatronic postopkov, ter druge informacije o stanju stroja, - informacije o hitrosti rezalne glave, ki vključuje želeno in dejansko vrednost, - podatki o posameznih oseh, to so položaj in druge informacije stanja, - podatki o delovnem programu (ime, trenutni blok, stanje), - podatki o orodju (curek odprt / zaprt), - podatki o stanju postopkov na PLK (avtomatsko obratovanje stroja zagnano / v teku / ustavljeno), - podatki o dodatnih oz. pomožnih napravah na stroju (visokotlačna črpalka, napajanje stroja, varnostni krog), - razne druge informacije (izklop v sili, stanje na mreži, briši napako), - različna sporočila, ki vključujejo več stopenj opozoril in druga sporočila operaterju, ki se prikažejo sproti kakor nastajajo ustrezni dogodki na stroju; za ponovni zagon po napaki na stroju mora operater opozorila zbrisati ročno. GUV omogoča nadzor, programiranje in oblikovanje stroja, podpira pa tudi večfunkcijske programske krmilne gumbe. V osrednjem področju zaslona nadzorne plošče vključuje polje, v katerem izriše geometrijsko obliko obrisov rezanja. Ko se delovni program naloži, se načrtovani obris rezanja prikaže v celoti. Posamezni segmenti, ki se režejo, in tisti, ki so že bili odrezani, so označeni z različno barvo. Hkrati se na načrtovanem obrisu s križcem označuje dejanski položaj rezalne glave. Informacija o položaju rezalne glave se osvežuje v relativno kratkih časovnih intervalih. Okna uporabniškega vmesnika so krmiljena interaktivno glede na trenutno stanje stroja oziroma postopka. V primeru spremembe režima obratovanja GUV samodejno ustrezno zamenja okna. GUV vsebuje različna okna, nekatera med njimi se pojavljajo na vmesniku dinamično. Okno postopka se pojavi na zaslonu samodejno, ko se postopek na stroju zažene. Okno pokaže vse korake postopka med izvajanjem. Operater je tako ves čas natančno voden skozi postopek, prikažejo pa se tudi navodila za morebitne ročne posege operaterja. Takšen način naredi delovanje stroja pregledno, omogoča pa tudi hitro odkrivanje napak in ponoven zagon stroja v primeru zastoja. Uporabniško prijazno upravljanje olajša določanje napak na stroju, s tem pa je tudi vzdrževanje lažje. Prepoznava napak je mogoča s sporočili, ki jih GUV sporoča operaterju. Sporočila o napakah so prikazana na lahko razumljiv in primeren način. Medtem GUV nadaljuje spremljanje in zapisovanje vseh novih opozoril. Informacije o stanju stroja se zbirajo ciklično, z relativno daljšo periodo osveževanja, reda ene sekunde, kar omogoča sprotno poročanje sporočil in primerno hiter odziv na stroju. 0 srinatäieflMliBilrSO | ^BSfirTMlliC | stran 474 general machine-state information - feedrate information, which includes commanded, actual and override values - axis details, which comprise position and other related status information - program information (program name, program block, program status) - tool information (jet start/stop) - PLC information (automatic operation stopped, started, running) - auxiliary devices information (HP pump state, mains state, safety-circuit state) - miscellaneous information (emergency-stop pressed, network alive, reset fault) - message information, which includes various levels of alarm and operator messages that appear as they occur; however, to recover from a failure the alarms must be cleared manually by the operator. The GUI provides monitoring, programming, configuring, and multifunction software-buttons support. Furthermore, it contains the contour-geometry field that occupies the central area of the screen. It shows up a whole program with a planned cutting contour when loaded, however, during the program execution the cutting head path is redrawn in real-time while traveling. The contour segments that are cutting and those that have already been cut are marked differently. The actual position of the cutting head on the planned cutting contour is marked with a cross. The GUI has a window structure, which is driven on the basis of the machine’s and/or the procedure’s actual state, e.g., when the machine changes the operation mode the GUI simultaneously swaps the pre-defined windows accordingly. Some GUI windows perform their operation dynamically, i.e., a procedure window appears on the operator screen when a certain machine-control procedure is started. It displays all the procedure steps that are to be executed to accomplish the procedure. The operator is carefully guided through the procedure; instructions are displayed for manual interventions, if necessary. This approach makes the machine’s operation transparent. Consequently, the potential fault can be clearly identified and the operation can be recovered quickly. The user-friendly approach isolates faults and so incorporates easy maintenance diagnostics. The faults are identified by messages displayed on the GUI. Error messages are displayed in an easily understandable and correct manner. Furthermore, the operator is able to display a message-history list to address an alarm condition. Meanwhile, the GUI continues to monitor and record all the new alarm events. The machine state information is acquired cyclically with a relatively slow refresh period with respect to fast position measurement; however, the cycle rate is less than a second in order to ensure a prompt machine response and to serve messages as they occur. Hace A., Poli~ A., Jezernik K.: Napredni mehatronski - An Advanced Mechatronic 2.2. Strojna oprema krmilnika Če želimo vgraditi funkcionalnost RNK/PLK v osebni računalnik (OR), mora ta delovati v realnem času. Še več, za izvedbo krmilnih algoritmov servomotorjev se mora OR odzivati v strogem realnem času. Odziv OR mora biti tako logično in povrhu tega še časovno pravilen - odzivati se mora sproti, pravočasno in napovedljivo, časovni odziv mora biti vnaprej določljiv za najslabši primer. Operacijski sistem za OR, ki omogoča delovanje v realnem času, je QNX [14]. Operacijski sistem QNX je primeren tudi za uporabo v robotiki in avtomatizaciji [4], o čemer so že poročali številni avtorji ([1], [2], [7] in [15]), saj ima prilagodljivo zgradbo, ki zagotavlja robustno in zanesljivo delovanje vgrajenih sistemov. Zelo natančni programski časovniki omogočajo delovanje v strogem realnem času na poceni in razširjeni strojni opremi. Tako je lahko z uporabo sodobnih enoprocesorskih osebnih računalnikov, ki se dobijo na tržišču, mogoč razvoj takšnih sistemov, ki imajo v istem računalniku vgrajene krmilne algoritme, mrežno podporo in grafični uporabniški vmesnik. S takšno zgradbo krmilnika je mogoče zamenjati običajno večprocesorsko zgradbo “gostitelj/DSP”, ki se pogosto uporablja v sistemih vodenja. Takšen sistem je drag in ni tako prilagodljiv, programska oprema pa je zelo zahtevna. Prednosti enoprocesorskega sistema tako vključujejo nižje stroške in manjšo zahtevnost sistema, večjo prilagodljivost in dogradljivost. V predstavljeni uporabi upoštevamo še združljivost s sedanjo programsko opremo RPN/RPI, razvito v okolju Microsoft Windows, zato je krmilni računalniški sistem zasnovan z dvema osebnima računalnikoma (sl. 4): - VČS računalnik z okoljem Microsoft Windows na katerem teče grafični uporabniški vmesnik in komunikacijska podpora za povezavo s sedanjo tovarniško programsko opremo RPN/RPI. 2.2 Hardware In order to implement CNC/PLC functionality on a PC platform it must operate in real time. Moreover, a hard real-time feature is a prerequisite for motion control. The QNX real-time operating system [14] can be a good candidate for use in the field of robotic and automation applications [4]. Many authors have reported on PC-based control applications with QNX ([1], [2], [7] and [15]). It is attractive, particularly for embedded systems, since it provides flexible software architecture, as well as a robust and reliable implementation. Such embedded systems with high-accuracy timers enable hard real-time performance implemented on a cost-effective and widely supported hardware platform. Therefore, modern high-speed consumer-grade PCs are capable of implementing the motion-control algorithms as well as the networking and the user interface on a single CPU. This architecture replaces the traditional multiprocessor “host/DSP” board architecture often used in control applications, which suffers from the high cost of the hardware, the limited flexibility of the system, and the complexity of the software. The advantages of a single-processor system include reduced cost and lower complexity, as well as increased flexibility and upgradeability. However, in order to achieve interoperability of the already existing CAD/CAM software that has been developed in the Microsoft Windows environment, we suggest a computer-control architecture with two PCs (Figure 4): - The HMI computer with the Microsoft Windows environment implements the user interface package and network support for existing CAD/CAM software. krmilni sistem control system < industrijski LAN . factory LAN ,)NX ethernet vmesnik interface RNK računalnik CNC computer sei. vmesnik interface krmilni vmesnik control interface RS232 TCP/IP ethernet vmesnik/ interface V H TCP/IP --------1 etlieiuet vmesnik / interface ČS rač unalnU"1 HI I c o m p u t enJ Wiudows2000 dig. ser. p | |f I/O vmesnik vmesnik interface " l C interface močnostni krog power circuit varnostni krog safety circuit K Sl. 4. Krmilni sistem Fig. 4. The control-system block diagram I isfinHi(s)bJ][M]ifln;?n 04 stran 475 I^SIflTTMlDC Hace A., Poli~ A., Jezernik K.: Napredni mehatronski - An Advanced Mechatronic - Krmilnik RNK je osebni računalnik z operacijskim sistemom QNX za izvajanje funkcij RNK/PLK v strogem realnem času. Programski paket RNK/PLK je nameščen na osebnem računalniku in obsega krmilne algoritme za sistem XY, osnovne nadzorne rutine za vodni curek, krmilne postopke in komunikacijske module. Končna oblika sistema je načrtovana brez uporabniškega vmesnika (tipkovnice, miške in zaslona), torej kot vgrajen sistem. Računalnik z nameščenim okoljem Microsoft Windows ima nameščen programski paket z grafičnim uporabniškim vmesnikom, gosti pa tudi programsko opremo RPN/RPI z zunanjo povezavo Ethernet na tovarniško lokalno omrežje. Na uporabniški vmesnik so priključene še običajne vhodno/izhodne enote. Računalnika sta med seboj povezana z standardnimi vmesniškimi karticami Fast Ethernet. Računalnik RNK je opremljen z vhodno/ izhodno vmesniško kartico, ki predstavlja krmilni vmesnik. Krmilni vmesnik povezuje krmilni računalnik s strojem. Priključen je na servomotorja in na zunanji PLK, ki je dodan za razširitev sistema z ločeno inteligentno I/O okolico. Glavne naloge PLK so krmiljenje prenosnega sistema in visokotlačne črpalke. Povezava RS-232 omogoča prenos večje množice podatkov med krmilnikom RNK in zunanjim PLK. Močnostni in varnostni algoritmi krmilja so izvedeni z relejsko logiko. 2.3 Programska oprema 2.3.1 Računalniški numerični krmilnik RNK izvaja različne naloge, potrebne za vodenje stroja: osnovne krmilne logične postopke, časovno kritične algoritme položajne krmilne zanke, pospeševanje/zaviranje in generiranje poti, interpretiranje delovnih programov, vmesnik za programiranje stroja, upravljanje s programi z datotečnim sistemom, obdelava drugih strojnih podatkov in mrežna podpora. Z zunanjim PLK skrbi za usklajeno delovanje sistema XY, prenosnega sistema in visokotlačne črpalke. Vse uporabniško pomembne informacije, ki so povezane s strojem, morajo biti prenesene do uporabnika. Tako RNK sporoča uporabniškemu vmesniku informacije o položaju in hitrosti rezalne glave, o izvajanju delovnega programa za rezanje, različna sporočila in opozorila. Nadalje krmilnik vzdržuje informacijski most, ki povezuje zunanji PLK z uporabniškim vmesnikom, s čimer je omogočen prenos podatkov o delovanju prenosnega sistema in visokotlačne črpalke. Da je mogoče izvajati vse te naloge, mora programska oprema krmilnika RNK delovati v realnem času, pri čemer so pogoji strogega realnega časa povezani s krmilnimi algoritmi servomotorjev, medtem ko se informacijska podpora uporabniškega vmesnika lahko izvaja v mehkem realnem času. V večprocesnem konkurenčnem enoprocesorskem računalniškem okolju programski model odjemalec - 0 srinatäieflMliBilrSO | ^BSfirTMlliC | stran 476 - The QNX computer responds deterministically in hard real-time to serve for the CNC/PLC functionality. The CNC/PLC package is hosted by the PC platform. The package comprises the XY control algorithms, the basic water-jet control routines, the operator level control procedures, and the communication modules. The end-user installation of the CNC controller is designed as an embedded system without a keyboard, a mouse and a display device connection. The Windows computer implements the GUI as well as hosting the CAD/ CAM software with a link via an additional Ethernet connection to the factory LAN. The GUI connects the user input/output devices. Both PCs are interconnected by standard Fast Ethernet interface cards. The control interface, which utilizes the highperformance multifunction I/O board for the PC motion-control applications, connects the CNC controller with the XY system. The control board is linked with XY servo drivers as well as with the external PLC, which is added for dislocated intelligent I/O expansion. The PLC’s main tasks are to control the transport system and the HP pump. The RS-232 line allows for information flow between the CNC controller and the external PLC. The power and safety circuits are implemented by relay logic. 2.3 Software 2.3.1 Computer Numerical Controller The CNC performs the various tasks necessary for the machine-control: basic logic control procedures, time-critical position-control loops, acceleration/deceleration, NC path generation, program loading and interpreting, machine programming interface, graphical user interface, file management, data processing, and networking. Additionally, it provides for interoperability with the external PLC in order to synchronize the operation of the XY system, the transport system, and the HP pump. All user-important information related to the machine must be passed to the operator. Thus, the CNC controller supplies the GUI with the position/speed of the cutting head, the cutting program execution information, the messages and the alarm conditions. Furthermore, the controller forms an information link that connects the external PLC with the GUI. The link enables the transfer of the transport system and the HP pump operation data. In order to accomplish all the tasks cited above, the CNC software-package architecture must allow for realtime operation: hard real-time requirements are associated with motion-control algorithms, while the GUI overall messaging scheme needs soft real-time Hace A., Poli~ A., Jezernik K.: Napredni mehatronski - An Advanced Mechatronic strežnik omogoča izvedbo takšne arhitekture procesov, ki ustreza naštetim zahtevam. Ta model je v QNX mogoče zelo preprosto izvesti z uporabo takšne medprocesne komunikacijske sheme, pri kateri je strežni proces blokiran, medtem ko čaka na sporočilo od odjemalca. Predlagana arhitektura procesov krmilnika je strukturirana kakor kaže slika 5. Procesi so načrtovani tako, da izvajajo naslednje naloge: - Strežnik krmilnega vmesnika izvaja naloge na nizkem novoju: dostopa do vmesniške kartice I/O in tako omogoča zajemanje in izdajanje digitalnih ter analognih signalov. - Interpolator, vmesni pomnilnik referenčnih točk, XY krmilnik, krmilna logika skrbijo za izvedbo uporabniških nalog: interpolator na osnovi delovnega programa generira želeno vrednost, ki se shrani v podatkovnem vmesniku; ta zagotavlja nemoten sprotni pretok podatkov do krmilnega modula, ki izvaja krmilne algoritme servomotorjev v strogem realnem času. Ti moduli skrbijo tudi za začetno inicializacijo servosistema, če je ta opremljen z prirastkovnimi položajnimi merilniki. Krmilni modul vključuje algoritme za varno in zanesljivo ustavitev ob pojavu napak na servosistemu, kakor so: prevelik sledilni pogrešek, nalet na programske oziroma strojne položajne omejitve, napaka na motorjih ipd. Modul krmilne logike izvaja logične krmilne funkcije ciklično. - Podatkovni strežnik omogoča drugim procesom uporabo skupnih podatkov, ki so shranjeni v execution. The architecture scheme that complies with such requirements implements the client/server send-driven model. It can be easily applied by the QNX synchronous messaging scheme. The send-driven model assumes that the server is blocked while it is waiting for a message from the client, i.e., the server process is in a receive-blocked state. The proposed control-application process architecture is structured as shown in Figure 5. The processes are designed to perform the following tasks: - the hardware server performs access to the low-level I/O board facilities and thus provides a digital and an analog signal interface. - the interpolator, the setpoint buffer, the XY controller, and the logic control execute user-level tasks: the interpolator generates setpoints on the basis of user path requests, passes them to the buffer, which ensures continuous data flow to the XY controller that implements the position-control algorithms in hard real time, thus performing motion-control tasks involving incremental measurement system initialization, safe and reliable emergency stop at fatal errors such as: following error, software and hardware limits, servo fault, etc. The logic control module cyclical runs logic control procedures. - the data server allows other processes to use the common data that are stored in the shared memory po'slji send odgovori reply i upravitelj vtičnic socket manager .n odgovori reply A__ pošlji send TCP/IP odjemalec / client poilji odgovori send reply —'-----------------------*-----------------------¦> uporabniški - poslji - vmesnik user interface < pos'lji odgovori send reply ¦ \ pošiljatelj ^j ser.kom. kanala posreduj ser.com. sender proxy send , odgovori ¦" reply " TCP/IP strežnik / server odgovori polji reply send _____I______I____ podatkovni strežnik data server reply send r ~\ krmilna logika ' logic control p s o end' odgovori I reply f \ strežnik krm. vmesnika hardware server pollji odgovori send reply T 1 deljen pomnilnik XY krmilnik / shared memory controller / posreduj I- proxy -i časovnik timer / posreduj *- proxy j ,prekinitvena / rutina / irq handler / sprejemnik ser.kom. kanala ser.com. receiver h ^__ odgovori čas. / r"eply timer / pošlji send I___ upravitelj naprave device manager odgovori - reply pošlji odgovori send reply pošlji send ______I odgovori ~ reply ~ pošlji send " interpolator interpolator send '¦vmesni pomnilnik ref. točk. orepovloy0" setpoint server Sl. 5. Programska zgradba RNK/PLK Fig. 5. The CNC/PLC software architecture gfin^OtJJIMISCSD 04-10 stran 477 \^BSSITIMIGC Hace A., Poli~ A., Jezernik K.: Napredni mehatronski - An Advanced Mechatronic skupnem deljenem pomnilniku. - Uporabniški vmesnik izvaja funkcije, kot so sporočanje informacij operaterju, ročni vnos krmilnih ukazov, vnos in interpretacija delovnega programa, na podlagi katerega se krmilijo interpolator, XY krmilnik in krmilna logika, ter nadzor sistema; podpira vhodno/izhodne naprave, to so tipkovnica, miška in monitor, nadalje pa tudi mrežni protokol uporabniške ravni, ki je zgrajena na skladu TCP/IP. - TCP/IP odjemalec/strežnik skrbita za mrežno Ethernet povezavo z računalnikom VČS. Protokol TCP/IP omogoča povezavo več oddaljenih računalnikov in hkrati relativen varen prenos podatkov. Protokol uporabniške ravni, ki določa pomen komunikacijskega sporočila, je v osnovi ukazni interpreter. Podatki se izmenjujejo na zahtevo strežnika na računalniku VČS ciklično. Tako se zagotovi zvezno osveževanje podatkov na uporabniškem vmesniku. Za primerno kratko periodo in dovolj hitro odzivnost sistema na posredovanje operaterja pa mora biti informacijski paket čim manjši glede na pasovno širino komunikacijskega kanala. Zato je k periodičnemu informacijskemu paketu, ki vsebuje osnovne informacije o stanju stroja, dodana še dogodkovno krmiljena informacijska shema. Ta zbira krajša sporočila, ki imajo pogosto prednost in vsebujejo informacijo o drugih dogodkih na stroju (npr: napake, opozorila) ter morajo biti samodejno obdelana ali sporočena operaterju. - Pošiljatelj in sprejemnik serijskega komunikacijskega kanala komunicirata z zunanjim PLK prek serijske povezave RS232. PLK odgovarja na zahteve pošiljatelja in se odziva z ustreznimi sporočili, ki jih pošilja sprejemniku. Sporočila so sestavljena iz spremenljivk s preddoločenim pomenom, da so lahko čim krajša, saj je hitrost prenosa po serijskem kanalu razmeroma majhna. Eksperimentalni rezultati Krmilni računalnik RNK je bil izveden na osebnem računalniku z AMD ATHLON 800MHz Thunderbird procesorjem na GA-7IXE4 matični plošči z 64MB RAM. Na računalnik VČS je bil priključen s povezavo Fast Ethernet (100Mbps), s serijsko povezavo RS232 pa na zunanji PLK. Na tem sistemu so se lahko krmilni algoritmi položajne zanke izvajali s kratko periodo 200us, tipična nastavitev je bila 1ms, kar je omogočalo veliko natančnost položajnega vodenja pri velikih rezalnih hitrostih do 1m/s. Postopki krmilne logike so se izvajali s periodo 4ms, kar je dovolj hitro za razmeroma počasne procese, ki jih nadzirajo logične krmilne funkcije. Podatki na uporabniškem vmesniku so se osveževali s periodo 0,5s. Na to je vplivala razmeroma počasna serijska povezava z zunanjim PLK, ki je s 19200 Baudov prenosne hitrosti podatkov omejila komunikacijsko periodo na 200ms. 0 srinatäieflMliBilrSO | ^BSfirTMlliC | stran 478 area. - the user interface implements the user input/output module and the G-code program interpreter that issues path requests and logic control commands, and system monitoring; it supports input and output devices such as a keyboard, a mouse and a monitor as well as the application-layer protocol that is stacked on the TCP/IP. - the TCP/IP client/server deals with the Ethernet network communication link to the HMI computer. The TCP/IP protocol makes possible the connection to remote computers and a reliable communication link. A dedicated application-layer protocol essentially presents the command interface. The data transfer is performed cyclically on the basis of the HMI computer requests, thus having contiuous data displayed on the GUI. However, the information scheme has to be as tiny as possible to achieve a high refresh rate and a rapid response to operator interventions. Therefore, only the main machine-status information is included in the communication packet, and a so-called eventdriven messaging scheme with small packets is added to support sporadic events (such as faults and alarms) on the machine that must be or automatically processed either passed to the operator promptly in order to provide user-friendly machine management. - the serial comm. sender/receiver provide data exchange between the external PLC and the CNC controller via a serial RS232 communication link. The PLC responds to sender requests. It sends data to the receiver and thus supplies the requested data that consists of variables with a predefined meaning in order to have short messages and so preserve a relatively high update rate due to the low communication bandwidth. Experimental results The CNC controller was implemented on a PC with AMD ATHLON 800MHz Thunderbird processor on a GA-7IXE4 motherboard with 64MB of RAM, connected via a Fast Ethernet (100Mbps) link to the HMI computer and the RS232 connection with the external PLC. The positioncontrol period achieved by the proposed system ranges from 200us, but is typically 1ms, which allowed highly accurate position control at a high speed of 1m/s. The control logic process was executed during a 4ms period, which was fast enough for the relatively slow processes controlled by the logic control functions. The GUI data was cyclically refreshed during a 0.5s period due to the slow PLC communication bandwidth of 19200 Baud transfer rate; this gave a communication period of 200ms. Hace A., Poli~ A., Jezernik K.: Napredni mehatronski - An Advanced Mechatronic 200 180 160 140 120 100 - 340 I500 500 0. 1 0.05 0 .05 0.1 5 A7 W V 0 /V A V A A A/\ \A/ "\/ 500 /A A vA/" v V 0 0. 1 0.05 0 05 360 380 400 420 X (mm) 440 460 /\ -AA V/ A \A/ " v V Sl. 6. Krmilni rezultati Fig. 6. Control results Na sliki 6 so prikazani rezultati položajnega krmiljenja rezalnega sistema.Krmilni signal na izhodu RNK je predstavljal referenčno hitrost servomotorjem. Krmilni algoritem je bil v tem primeru računan s periodo 250us. Na diagramu levo je prikazan testni obris v ravnini XY, desna diagrama pa trajektorije posameznih osi z referenčno hitrostjo zgoraj, sledilnim položajnim pogreškom v sredini in krmilnim izhodnim signalom spodaj. 2.3.2 Načrtovanje programljive krmilne logike Osnovni namen PLK je izvajanje dogodkovno naravnanih logičnih funkcij, kakor so vklop/izklop stroja, izbira avtomatskega cikla oziroma ročnega upravljanja, zagon/zaustavitev cikla, nadzor aktuatorjev, zaznavanje napak in spremljanje obratovalnih razmer. Klasično se programiranja krmilnih funkcij lotimo na podlagi časovnega diagrama izvajanja tehnoloških funkcij stroja in na podlagi krmilne sheme elektroožičenja [9]. S tem so podane tehnološke funkcije stroja in zgradba njegovega krmilja. Izvedba funkcij za upravljanje, nadzor in varovanje stroja ter funkcij za samodejno zaustavljanje, razpoznavo in odpravo napak, pa je prepuščena presoji in izkušnjam programerja. Zaganjanje takšnih strojev se po navadi lahko prične šele po končanju vseh strojnih in elektromontažnih del. Krmilna logika se v obliki programa naloži na PLK, nakar se prične s Figure 6 shows the control results. The output of the CNC position controller was the speed-command signal transmitted to the servomotors. The position-control algorithm was executed at 250us intervals. The left diagram presents the test contour in the XY plane, the right diagrams present the response of the X and Y axes, respectively, showing the reference speed signal, the following error and the control signal. The results show high-performance position tracking. 2.3.2 Programmable logic control design The basic task of the PLC is to run event-handling logic functions, such as operation mode selection, machine start/stop/pause, manual operation, supervision of actuators, error detection, operating condition monitoring, etc. In practice, the programming of logic control functions is based on a timed bar-chart of technological functions and on the control wiring diagram [9]. This specifies the technological functions of the machine and the control architecture. The implementation of the functions for the management, control and protection of the machine and the functions for automatic-stop, diagnosis and error recovery are dependent on the logic control designer’s experiences, and the dependency between the different control functions cannot be verified until the target system is built and tested. The testing of such a machine starts after the assembly is finished and is based on a try-and-fix approach. The control program is loaded into the controller and the start-up procedure gfin^OtJJIMISCSD 04-10 stran 479 |^BSSITIMIGC 0.5 1.5 2.5 3.5 0.5 1.5 2.5 3.5 -5 0 0.5 1 1.5 2 2.5 3 3.5 time (s) 500 0.5 1.5 2.5 3.5 0.1 0.5 1.5 2.5 3.5 -5 0 0.5 1 1.5 2 2.5 3 3.5 time (s) Hace A., Poli~ A., Jezernik K.: Napredni mehatronski - An Advanced Mechatronic testiranjem osnovnih funkcij v ročnem režimu obratovanja, sledi testiranje avtomatskih funkcij in na koncu še optimizacija delovanja stroja. Za skrajšanje razvojnega cikla načrtovanja krmilnih funkcij je bil razvit nov način obravnave dogodkovnih sistemov ([11] do [13]), ki omogoča načrtovanje in analizo pravilnosti zasnovanih krmilnih funkcij ter simulacijo zmogljivosti ciljnega sistema še pred izvedbo, vključujoč mehanske, elektronske in informacijske komponente. Na ta način je mogoče preveriti konstrukcijske in funkcionalne rešitve ciljnega sistema že v zgodnji fazi razvojnega cikla, kar bistveno skrajša trajanje in zmanjša stroške projekta v primerjavi z ugotavljanjem funkcionalnih pomanjkljivosti že zgrajenega ciljnega sistema. Metoda temelji na predpostavki, da logične krmilne funkcije predstavimo kot dogodkovne sisteme, za katere so značilna specifična stanja. Sistem v vsakem trenutku zavzame le eno diskretno stanje, prehod v novo stanje pa se zgodi ob pojavu dogodka pri izpolnjenih pogojih. Stanja krmilnih funkcij so pogosto povezana s stanji aktuatorjev, ki jih funkcija krmili, ali pa s stanji delovnega postopka. Prehod krmilne funkcije med stanji se zgodi ob pojavu dogodka, npr. pritisk na gumb, aktiviranje zaznavala ali doseganje mejne vrednosti. Novo stanje, ki ga bo funkcija zavzela po pojavu dogodka, je odvisno od trenutnega stanja funkcije in dogodka ter od trenutnega stanja preostalih funkcij na stroju in od vhodnih krmilnih signalov. Petrijeve mreže (PM) ([5] in [10]) so med pogosteje uporabljanimi orodji za obravnavo dogodkovnih sistemov ([16] in [17]). Ena od njihovih prednosti je, da jih je mogoče hitro spremeniti v enega od standardiziranih načinov za programiranje PLK-jev [3]. Petrijeve mreže so v osnovi dvodelni graf, ki premore dve vrsti vozlišč, po navadi predstavljenimi s krogi in pravokotniki. Stanja funkcij prikazujejo krogi, trenutno delujoče stanje označuje krožec. Pravokotniki simbolizirajo dogodke, ki povzročijo prehode med stanji. Dopustne prehode med stanji funkcije begins by checking the manual control functions first, the automatic functions next, and then finally the performance optimization. To shorten the development cycle of the logic control design, a new matrix-based approach for the handling of the event-driven systems was introduced ([11] to [13]). It enables the design and analysis of the proposed logic control functions and a performance analysis of the target system, even before it is actually built, including machine construction, electronics and information technology. This enables the verification of the construction and the functionality of the target system in the early development phase. Possible modifications of the solutions involve relatively small costs compared to late-development-phase modifications on the actually built system, which is of great importance for the project’s timing and costs. The method is based on the assumption that the logic control functions are considered as discrete event-driven systems that are characterized by specific discrete states. In every instance the system occupies only a single discrete state. The state transition is triggered by a specific event and under predefined conditions. Each control function’s discrete state is related to the state of the controlled actuators or with the state of the controlled process. The transition of the control function between the states happens if an event such as a button being pressed, a sensor being activated, a threshold value being reached, etc., occurs. The new state of the control function depends on the current state of the control function, the occurred event, the state of the other control functions in the system and the control input signals. Petri nets (PNs) ([5] and [10]) are a widely used tool for the treatment of event-driven systems ([16] and [17]). They can be easily converted into standardized PLC programming languages [3]. A PN net is a bipartite graph with two types of nodes, usually represented by circles and rectangles. The circles stand for function states; a currently active state is indicated by a token. Rectangles symbolize events that cause state transitions. The allowed transitions between function states are determined by directed arcs. An additional arc, which is fcfiYPripravljen za Nazaj Vrezanje Backwards Backward Y I u(2,4) Discret- e v entsyi Korak1 u(2 Discret- e ventsy1_________A Stop QStep1 ------'-'---- u (1,2) T3i-----1 r— T1 u(2,3) -Dis cre-t e ve ntsyf V tStop u(2,1) Dis centsystem 1 Korak2 tStep2 u(1,3) Pomik traka (2) T3±* Belt conveyer (2) 1 Korak3 Q Step3 T4 c*zf Prenos materiala (1) Transport material (1) T1 T3 u(3,2) u(3,1) Dis crete-ev ent sI CW u(3,3) CCW9u(3, 4) T4 0u(3 Nazaj Reverse" 1 y— u(4,4) T2 syste m MT4 u(4,2) %Stop V redu \y— u(5,1) ntsystem 1 Napaka OError/Fault Y7- u(5,2) Naprej Forward u(4,3) Pogon potiskalca (3) Pusher (3) L>—"—1 u(4,1) T3rj-n r^T1 T2 Start Zaznavanje napak (5) Upravljanje (4) Error-handling (5) User start/stop (4) u(1,4) Sl. 7. Petrijeve mreže krmilnih funkcij postopka prenosa materiala Fig. 7. Petri Nets of the control functions for the transport-of material procedure 0 BnnBjfokJ][p)l]Olf|ifrSO I I ^SSfiflMffiC I stran 480 Hace A., Poli~ A., Jezernik K.: Napredni mehatronski - An Advanced Mechatronic ponazarjajo usmerjene črte. Dodatna puščica, povezana v pravokotnik, pomeni zunanje pogoje, ki vplivajo na prehod med stanji ob pojavu dogodka [9]. Nekaj primerov PM, ki pomenijo krmilne funkcije rezalnega stroja s slike 1, prikazuje slika 7. Strukturo grafa PM lahko predstavimo z vpadnostno (incidenčno) matriko M [10]. Stolpci matrike M pomenijo stanja krmilne funkcije, medtem ko vrstice pomenijo dogodke. Komponente matrike M(ij) lahko zavzamejo vrednosti: f+1, /-stanje je posledic a /-dogo dka M(i,j) = •! 0. /-stanje ni povezano z [-dogodkom [-1, /-stanje je pogoj za ^dogodek (1). Vpadnostne matrike PM s slike 7 predstavlja (2): Stanje sistema po k dogodkih predstavlja vektor m(k). Njegove komponente so razpoložljiva stanja funkcije, pri čemer velja: m(k)-- ;'1. stanje delujoče [0, stanje ni delujoče (3). Vektorje stanja PM s slike 7 predstavlja (4). Imena komponent ustrezajo imenom prostorom PM s slike 7. Pripravljen na rezanje = Korak1 1 Korak2 Korak3 ,m2 = Stop Naprej Nazaj ,m3 = ¦ Stop ¦ CW CWW ,m4 = Stop Start Nazaj V redu ,m5=\ m _ [Napaka] RdyToCit Srepl Step 2 (4). connected to a rectangle, adds an external condition that has an affect on a state transition when an event occurs [9]. Some examples of PNs representing the logic control functions of the cutting machine from Figure 1 are presented in Figure 7. A pure PN-graph structure can be presented by the incidence matrix M [10]. The columns of the matrix M represent the states of the function, whereas the rows represent the events of the function. The component M(ij) can have the values: I +1. /-state is a consequence of /"-event M{i.j) = ¦ 0. /-state is not related to /-event 1-1. j -state is a condition for /-event (1). Equation (2) represents the incidence matrices: (2). The state of the function after the k-th occurrence of events is denoted by the vector m(k). Its components represent the states of the function where: m(k) = il ^teactivs (3). '0. state inactive The state vectors of the PN from Figure 7 are represented by (4). The name of the component corresponds to the PN place. OK m; = 1 En or: Fault Si-op Stop Stop III: = Forward ,Ht3 = cw III A = Start Backward C CIV Revoke Podobno kakor trenutno stanje krmilne funkcije m(k) so z uporabo vektorjev zapisani tudi dogodki in zunanji pogoji, ki vplivajo na sistem. Komponente vektorja x(k) predstavljajo dogodke za krmilno funkcijo, komponente vektorja u(k) pa predstavljajo zunanje pogoje za pojav dogodkov. 1. doeodekje '1. poaoj je izpolnjen x{k) = < ' . u(k) = ¦'. '0. dogodka ni '0. pogoj ni izpolnjen (5). Vektorje dogodkov za PM s slike 7 predstavlja (6), zunanje pogoje zanje pa opisuje (7). (4). Similar to the control function’s current state m(k), the control function’s events and external conditions are described using vectors. The components of the vector x(k) represent the events for the control function, while the components of the vector u(k) represent the external conditions for the occurrence of the events. ' 1. event occurred ' 1. condidtion met x(k) = i , u(k) = J ' 0. event not occurred ' 0. condition not met (5). The event vectors for the PN from Figure 7 are described by (6). Equation (7) represents the external conditions for the appearance of these events. (6). I isfinHS(s)bJ][M]ifln;?n 04 stran 481 I^HSfTflMlDC Hace A., Poli~ A., Jezernik K.: Napredni mehatronski - An Advanced Mechatronic "1 < Čas < 3 m3,2 m1,3 &m42 & pos <10 m5 ,1 1 Čas>3 m&m&pos> 10 65 ,u2 = ,u3 = m4,1&m13 & pos > 5 ,u4 mz Čas>7 .m 3,1 _ Čas>7 s>7 1 n0 ' 6i 1 ¦-:.: 1 ";-.i wi;&pöj>5 . "Hj [ ™«>7 _ _'¦¦¦-'-_ taw > 7 _ time>l J r3.8<ä-ww<5.5l (7). Predstavljen način omogoča formalen opis prehajanja stanj logičnih krmilnih funkcij. Formalizem je sestavljen iz dveh delov: najprej so glede na trenutno stanje krmilne funkcije m(k) določeni vsi dogodki xe(k), ki jih trenutno stanje omogoča [8], [16]. Iz nabora omogočenih dogodkov je nato s pomočjo pogojev u(k) izbran en dogodek x(k), kakor kaže enačba (8), ki bo spremenil stanje krmilne funkcije [12]: (7). The presented approach enables a formal description of the logic control functions’s state evaluation. The formalism consists of two parts: firstly, all the enabled events xe(k) according to the current state m(k) of the control function are determined [8], [16]. From the set of enabled events xe(k), a single event is selected according to the current conditions vector u(k) using (8) as suggested by [12]: .v(/f) = (F0M(fr))&w„(Ar) (8). Matrika F je del vpadnostne matrike M, ki predstavlja pogoje za prehajanje v novo stanje. Novo stanje krmilne funkcije m(k+1) je nato izračunano z enačbo (9) glede na trenutno stanje m(k) in dogodek, določen z vektorjem x(k): The matrix F is part of the incidence matrix M and represents the conditions for a transfer into a new state. The selected event x(k) occurs and changes the current state of the control function m(k) into new state m(k+1) using (9): m(k + 1) = m(k) + MT x{k) (9). Znak 8 pomeni Boole-ov skalarni zmnožek. Računa se kot navadni skalarni zmnožek, le da sta množenje in seštevanje zamenjana z logičnima ALI in IN. Shematično je formalizem prikazan na sliki 8. Modularni logični krmilnik [12] omogoča algebrski način določanja prehajanja stanj dogodkovno vodenega sistema glede na strukturo sistema M, trenutno stanje m (k), trenutne dogodke x(k) in trenutne zunanje pogoje u(k). Rezultati The 8 symbol denotes an inner product conjunction, which is calculated like an inner product, but logical OR and AND are used instead of multiplication and addition, respectively. Figure 8 shows the formalism schematically. The modular logic controller was introduced by [12]. It enables an algebraic description of the state evaluation of the event-driven system according to the structure of the system M, the current state of the system m(k), the current events x(k), and the current external conditions u(k). Results Zamisel matričnega modularnega logičnega To illustrate the idea of the matrix-based krmilnika je prikazana na primeru postopka prenosa modular logical controller, the functions for the materiala, ki obsega naslednje krmilne funkcije: material transport procedure are presented: u & x Dogodkovno voden sistem Event driven system M m(k + 1) = m(k)+ MT x(k) T4 Discrete-event syste P3 m Sl. 8. Modularni logični krmilnik Fig. 8. Modular logic controller 0 BnnBjfokJ][p)l]Olf|ifrSO | | ^SSfiflMlGC | stran 482 Hace A., Poli~ A., Jezernik K.: Napredni mehatronski - An Advanced Mechatronic Pripravljen na rezanje RdyToCut Korak1 Step1 Korak2 Step2 Korak3 Step3 Pomik traka Belt conveyer Upravljanje User start/stop Zaznavanje napak Error-handling Start Nazaj Reverse V redu OK Napaka Err Čas (s) Time (s) Sl. 9. Časovni diagram stanj krmilnih funkcij Fig. 9. States’ evaluation diagram - Prenos materiala predstavlja osnovno tehnološko funkcijo. Sestoji se iz izhodiščnega stanja in treh zaporedno izvršenih korakov. - Potiskalo je uporabljeno za pomikanje prenosnega traka. Vpeljan je kot elektromotor s tremi specifičnimi stanji: (i) vrtenje v smeri urnega kazalca (pomik naprej), (ii) vrtenje v nasprotni smeri urnega kazalca (pomik nazaj) in (iii) mirovanje. - Pomik traka predstavlja funkcijo pomikanja prenosnega traka. Funkcija lahko zavzame tri stanja: prenosni trak se pomika naprej, nazaj ali pa miruje. - Upravljanje je uporabniško usmerjena funkcija za upravljanje postopka. - Zaznavanje napak je nadzorna funkcija za zagotavljanje varnosti uporabnika in stroja. Z uporabo vpadnostnih matrik M1 do M5 iz enačbe (2), enačbe izbora dogodkov (8) in enačbe prehajanja stanj (9), je obravnavan sistem mogoče simulirati s programskim paketom Matlab. Namen simulacije je analiza delovanja zasnovanega logičnega krmilja in odziva logičnega krmilja na kritične dogodke. Slika 9 prikazuje diagram prehajanja stanj posameznih krmilnih funkcij med postopkom prenosa materiala v stroj. Diagram opisuje potek naslednjih krmilnih funkcij: prenos materiala, potiskalo, pomik traka, upravljanje in zaznavanje napak Spremenljivki pos iz krmilnih funkcij potiskalo in pomik traka sta zvezni in označujeta trenutni položaj potiskala in prenosnega traka. Dovoljeni prehodi med posameznimi stanji so razvidni s slike 7. - - - The transport material represents the main technological function. It consists of the initial state “Ready to Cut” and three sequentially executed Steps 1 to 3. The pusher is used for moving the belt conveyer. It is implemented as an electrical motor with three states: (i) rotating clockwise (belt forward), (ii) rotating counter clockwise (belt return) or (iii) it can be stopped. The belt conveyer represents the function of moving the belt conveyer. Three states are available: moving forward, backward or it is stopped. User start/stop is a user-oriented function for process management. Error-handling is a supervision function for user and machine safety. By using the incidence matrices M1 to M5 from (2), the equation (8), and the PN next state equation (9), the transport system of the machine from Figure 1 can be simulated with Matlab. The aim of the simulation is an analysis of the designed logic control and its response to critical events. Figure 9 presents the states’ evaluation diagram of the control functions after a failure during the transport of material. The diagram involves the following control functions: Transport material, Pusher, Belt conveyer, User Start/Stop, and Error Handling. The Pos variables from the Pusher and the Belt conveyer control functions are continuous and denote the current position of the pusher and belt conveyor, respectively. The allowed transitions of the states can be interpreted from Figure 7. stran 483 bcšd04 Hace A., Poli~ A., Jezernik K.: Napredni mehatronski - An Advanced Mechatronic Nazaj Backward T2 u(2,2)____Ž u(2,4) Stop Stop T3 i pT1 u(2,3)___/\ nr As Naprej --------\_J Forward Naprej Forward Petrijeva mreža Sekvenčni funkcijski diagram (IEC 1131) Petri net Sequential function chart (IEC 1131) Sl. 10. Pretvorba Petrijeve mreže v SFD Fig. 10. PN-to-SFC conversion Potek, prikazan na sliki 9 je naslednji: v koraku 2 (1) se prične potiskalo vrteti v smeri urnega kazalca (2), kar pomakne prenosni trak naprej (3). Ob pojavu napake (4) se mora potiskalo takoj ustaviti (5), s čimer se zmanjša možnost poškodbe stroja. Zaradi tega se ustavi tudi prenosni trak (6). Napako odpravi operater s sprostitvijo potiskanja (7). Pri tem se potiskalo (8) in prenosni trak pomakneta nazaj v izhodišče (9). Ko je napaka odpravljena, lahko operater ponovno požene avtomatsko izvajanje prenosa materiala (10). Za programiranje logičnih krmilnikov so uporabljeni jeziki v skladu s standardom IEC 1131, predvsem stikalni načrt in sekvenčni funkcijski diagram (SFD). Predstavljena metoda je skladna z uporabo standardiziranih programskih jezikov. PM s slike 7 je mogoče preprosto spremeniti v SFD ([3] in [9]). Prostori Petrijeve mreže v tem primeru kar ustrezajo korakom SFD-ja, prehodi Petrijeve mreže pa ustrezajo prehodom SFD-ja. Primer spremembe Petrijeve mreže v sekvenčni funkcijski diagram prikazuje slika 10. Koraki v SFD-ju so prikazani z okvirčki, izhodiščni korak pa je označen z dvojnim okvirčkom. 3 SKLEP V tem članku je predstavljen mehatronsko usmerjen način načrtovanja odprtega krmilja stroja, ki sinergijsko obravnava mehanske, elektronske in informacijske vidike proizvodnega sistema. Na začetku sta določena tehnologija stroja in načelo delovanja. Nadalje je predstavljen primerni uporabniški vmesnik, ki omogoča učinkovito obvladovanje tehnologije stroja in uporabniku prijazno upravljanje stroja. Strojna oprema krmilja temelji na standardni tehnologiji OR, dopolnjeni z učinkovitim operacijskim sistemom za delo v realnem času in Ethernetni komunikacijski tehnologiji. Takšna zasnova omogoča izvedbo različnih krmilnih algoritmov, uporabniškega vmesnika in mrežnih opravil na enem samem procesorju. Vrednostno naravnani algoritmi za pozicioniranje so vpeljani na klasični način: interpretiranje delovnega programa, interpolacija, ki generira trajektorije gibanja, in končno položajno krmiljenje. Za dogodkovno naravnane algoritme je uveden nov matrični način. Modularni logični krmilnik The procedure in Figure 9 is as follows: After Step2 is started (1), the pusher starts rotating clockwise (2) and the belt conveyer starts moving forward (3). When a failure is detected (4), the pusher is immediately stopped (5) to prevent further damage. The belt conveyer is stopped as a result (6). To recover from the failure, the operator chooses the reverse command (7) and the pusher is returned (8) until the initial position is reached (9). The process is continued when the operator executes the start command (10). For the programming of logical controllers, standardized programming languages conforming to IEC 1131 can be used, especially the ladder diagram and the sequential function chart (SFC). The logic control functions presented in Figure 9 can be simply converted to the SFC ([3] and [9]). The PN places correspond to the SFC steps and the PN transitions correspond to the SFC transitions. The PN-to-SFC conversion is illustrated in Figure 10. The SFC steps are represented by the rectangles, the double rectangle denotes the initial step. 3 CONCLUSIONS This paper presents a mechatronic-oriented approach to open machine-control design that covers mechanic, electronic and informatic aspects of a production system. Firstly, the machine technology and operation concept was determined. Then a proper, user-friendly HMI design was described, which enables efficient machine technology handling and user-friendly machine control. The control hardware is based on consumer-grade PC technology, supplemented with an efficient real-time operating system and Ethernet network technology. The suggested concept allows the implementation of diverse control, a user interface, and networking tasks on a single processor platform. Value-handling algorithms for servo tasks are implemented using a classic approach from program interpreting, interpolating that generates motion trajectories and finally position control. For event-handling algorithms, a new matrix-based approach was 0 S3"in3(šul[M]! ma stran 484 Hace A., Poli~ A., Jezernik K.: Napredni mehatronski - An Advanced Mechatronic omogoča ločeno načrtovanje in analizo logičnih krmilnih funkcij, njihovo modularno povezljivost in ponovno uporabnost v drugih sistemih. Tak način omogoča analizo vrednostno in dogodkovno naravnanih algoritmov še preden je ciljni sistem dejansko zgrajen. To je še posebej pomembno pri načrtovanju dragih in namenskih sistemov ter strojev, pri katerih podrobnih testiranj ni mogoče izvesti na ciljnem sistemu. Na področju običajne gradnje strojev prinaša predlagani način koristi za načrtovalca stroja in za končnega uporabnika: omogoča skrajšanje razvojnega cikla ter integrirano načrtovanje tehnologije stroja in njegovega krmilja, ki pa je bolj zanesljivo, učinkovito in prijazno do uporabnika. examined. The modular logic controller enables the design of separated control functions, their separated analysis, modularly linkage and the reusability in other systems. Such an approach allows for system analysis, including both value- and event-handling algorithms, even before a target system is actually built. This is of great value in designing expensive dedicated systems and machines, where the target system is not available for the performance of detailed tests. In the field of regular machinery building, a proposed approach enables shortened development cycles, the integrated design of machine technology and machine control, which is more reliable, efficient and user-friendly. 4 LITERATURA 4 REFERENCES [I] Arutunian, E.B., D.R. Meldrun, NA. Friedman, & S.E. Moody (1998) Flexible software architecture for user-interface and machine control in laboratory automation. BioTechniques 25-4, 698-705. [2] Bezi, I., & G. Tevesz, (1994) PC based robot controller for advanced control algorithms. Proc. of the Joint Hungarian - British International Mechatronics Conference, Budapest, Hungary, 1994. [3] Frey G., M. Minas, K.H. John, (2001). Integration von Petrinetzen in den Steuerungsentwurf nach IEC61131, Proc. of the SPS/IPC/Drives, Nürnberg, Germany, 197-205 [4] GM Powertrain Group, Manufacturing Engineering Controls Council (1996). Open, modular architecture controls at GM Powertrain. Whitepaper available at http://www.arcweb.com/omac/Techdocs/ Open_at_GMPTG.pdf [5] Hace, A., K. Jezernik (2003) The open CNC controller for a cutting machine. Proc. of IEEE ICIT 2003, Maribor, Slovenia, 1231-1236 [6] Jensen, K. (1997) Coloured Petri nets. Basic concepts, analysis methods and practical use. Volume 1. Basic concepts. Monographs in theoretical computer science, 2nd corrected printing. Springer-Verlag. [7] Loffler, M.S., V.K. Chitrakaran, & D.M. Dawson (2002). QMotor 3.0 and the QMotor robotic toolkit: A PC-based control platform. IEEE Control Systems Magazine 22-3, 12-26. [8] Mireless J. Jr. & FL. Lewis (2001) Intelligent material handling: Development and implementation of a matrix-based discrete-event controller. IEEE Trans. on Industrial Electronics. 48-6, 1087-1097. [9] Park, E., D.M. Tilbury, & P.P. Khargonekar (1998) A formal implementation of logic controllers for machining systems using Petri nets and sequental function chart. Proc. of the 1998 Japan-USA Symposium on Flexible Automation, Otsu, Japan. [10] Peterson J.L. (1981) Petri net theory and the modeling of systems, Prentice-Hall, New Jersey. [II] Polič, A (2003). Matrični opis diskretnega dogodkovnega sistema. Zbornik tretje konference AIG’03, Maribor, Slovenija, 179-184 [12] Polič, A., A. Hace, K. Jezernik (2003) Matrix based logic controller. Proc. of IEEE ICIT 2003, Maribor, Slovenia, 370-374 [13] Polič, A., A. Hace, K. Jezernik (2003) System specification, performance analysis and control implementation using matrix-based approach. Proc. of 12th International Workshop on Robotics in Alpe-Adria-Danube Region, Cassino, Italy. [14] QSSL, Kanata, Ontario K2M 1W8 Canada [On-line]. Available at: http://www.qnx.com [15] Sukhatme, G.S., J.E. Montgomery, & M.J. Matarič (1999) Design and implementation of a mechanically heterogeneous robot group. Proc. of the SPIE conference, Boston, Massachusetts. [16] Tacconi D.A. & F.L. Lewis (1997) A new matrix model for discrete event systems: Application to simulation, IEEE Trans. on Control Systems, 17-Oct, 6271. [17] Zhou, M., F DiCesare & A. A. Desroches (1992) A hybrid methodology for synthesis of Petri net models for manufacturing systems. IEEE Trans. on Robotics and Automation, 8-3, 350-361. gfin^OtJJlMlSCSD 04-10 stran 485 |^BSSITIMIGC Hace A., Poli~ A., Jezernik K.: Napredni mehatronski - An Advanced Mechatronic Naslov avtorjev: Aleš Hace Aleš Polič prof.dr. Karel Jezernik Fakulteta za elektrotehniko, računalništvo in informatiko Univerza v Mariboru Smetanova ulica 17 2000 Maribor ales.hace@uni-mb.si Athors’ Address: Aleš Hace Aleš Polič Karel Jezernik Faculty of Electrical Engineering and Computer Science University of Maribor Smetanova ulica 17 SI-2000 Maribor, Slovenia ales.hace@uni-mb.si Prejeto: Received: 22.7.2003 Sprejeto: Accepted: 30.9.2004 Odprto za diskusijo: 1 leto Open for discussion: 1 year 0 S3"in3(aül[M]! ma stran 486