epics ioc module development and implementation for the isttok machine subsystem operation and...

6
Fusion Engineering and Design 86 (2011) 1085–1090 Contents lists available at ScienceDirect Fusion Engineering and Design journal homepage: www.elsevier.com/locate/fusengdes EPICS IOC module development and implementation for the ISTTOK machine subsystem operation and control Paulo Carvalho a,, André Duarte a , Tiago Pereira a , Bernardo Carvalho a , Jorge Sousa a , Horácio Fernandes a , Carlos Correia b , Bruno Gonc ¸ alves a , Carlos Varandas a a Associac ¸ ão EURATOM/IST, Instituto de Plasmas e Fusão Nuclear–Laboratório Associado, Instituto Superior Técnico, P-1049-001 Lisboa, Portugal b Grupo de Electrónica e Instrumentac ¸ ão–Centro de Instrumentac ¸ ão, Departamento de Física, Universidade de Coimbra, P-3004-516 Coimbra, Portugal article info Article history: Available online 6 May 2011 Keywords: EPICS Nuclear Fusion Control Data Acquisition Communication Protocol Software abstract This paper presents a developed, tested and integrated EPICS IOC (I/O controller) module solution for the ISTTOK tokamak machine operation and control for the vacuum and gas injection systems. The work is organized in two software layers which communicate through a serial RS-232 communication protocol. The first software layer is an EPICS IOC module running as a computer server application capable of receiving requests from remote or local clients providing driver interface to the system by forwarding requested commands and receiving system and control operation status. The second software layer is the firmware running in Microchip dsPIC microcontroller modules which performs the interface from RS-232 optical fiber serial protocol to EPICS IOC module. The dsPIC module communicates to the ISTTOK tokamak sensors and actuators via RS-485 and is programmed with a new protocol developed for this purpose that allows EPICS IOC module command sending/receiving, machine operation control and monitoring and system status information. Communication between EPICS IOC module and clients is achieved via a TCP/IP and UDP protocol referred as Channel Access. In addition, the EPICS IOC module provides user client applications access allowing operators to perform remote or local monitoring, operation and control. © 2011 Published by Elsevier B.V. 1. Introduction Enhanced Physics and Industrial Control System (EPICS) [1–5] is a set of tools working together in order to provide a distributed software solution for Control, Data Access and Communication (CODAC). It provides channel access (CA) communication protocol with TCP/IP and UDP connections between EPICS systems for: transfer process variable (PV) values across the computer network; data access and network topology configuration. It is composed by: a processing database with some Graphical User Interface (GUI) tools for PV configuration; a sequencer module which can be pro- grammed using the State Notation Language (SNL) to provide a Finite State Machine (FSM) and other ready to compile and use software modules and extensions. Several open-source development tools can be used to pro- vide operator interface (OPI) such as Motif Editor and Display Manager (MEDM) [6] and Java [7]. Channel Archiver extension [8] provides an archiving system for PV data storage and alarm handler [9] a monitoring tool to detect and send warning mes- Corresponding author. E-mail address: [email protected] (P. Carvalho). sages and alarms when PV values fall out of normal operating conditions. The present work describes how an EPICS IOC module environ- ment was developed, tested and integrated for the ISTTOK tokamak slow control sensors and actuators operation providing a low cost and time reduced software development platform for CODAC pur- pose. 2. System description The ISTTOK slow control [10] is composed by the gas injection and vacuum systems, Fig. 1. 2.1. Gas injection system From the functional point of view, the hydrogen gas flows from the cylinder until the vacuum chamber under two regimes: (i) continuous, which goes through the flowmeter controller and (ii) pulsed, which passes through the piezo valve. The needle valve manually controls the hydrogen gas flow to maintain the pres- sure between 500 mbar and 1000 mbar at that point checked through the Edwards EPS 10 sensor read. Electric and manual valves near the tokamak chamber provide security for system oper- ation and isolation for vacuum chamber maintenance. The reducer 0920-3796/$ – see front matter © 2011 Published by Elsevier B.V. doi:10.1016/j.fusengdes.2011.03.100

Upload: paulo-carvalho

Post on 25-Nov-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: EPICS IOC module development and implementation for the ISTTOK machine subsystem operation and control

Es

PHa

b

a

AA

KENCDCS

1

is(

TpaatgFs

vM[h

0d

Fusion Engineering and Design 86 (2011) 1085–1090

Contents lists available at ScienceDirect

Fusion Engineering and Design

journa l homepage: www.e lsev ier .com/ locate / fusengdes

PICS IOC module development and implementation for the ISTTOK machineubsystem operation and control

aulo Carvalhoa,∗, André Duartea, Tiago Pereiraa, Bernardo Carvalhoa, Jorge Sousaa,orácio Fernandesa, Carlos Correiab, Bruno Goncalvesa, Carlos Varandasa

Associacão EURATOM/IST, Instituto de Plasmas e Fusão Nuclear–Laboratório Associado, Instituto Superior Técnico, P-1049-001 Lisboa, PortugalGrupo de Electrónica e Instrumentacão–Centro de Instrumentacão, Departamento de Física, Universidade de Coimbra, P-3004-516 Coimbra, Portugal

r t i c l e i n f o

rticle history:vailable online 6 May 2011

eywords:PICSuclear Fusionontrolata Acquisition

a b s t r a c t

This paper presents a developed, tested and integrated EPICS IOC (I/O controller) module solution for theISTTOK tokamak machine operation and control for the vacuum and gas injection systems. The work isorganized in two software layers which communicate through a serial RS-232 communication protocol.The first software layer is an EPICS IOC module running as a computer server application capable ofreceiving requests from remote or local clients providing driver interface to the system by forwardingrequested commands and receiving system and control operation status. The second software layer is thefirmware running in Microchip dsPIC microcontroller modules which performs the interface from RS-232

ommunication Protocoloftware

optical fiber serial protocol to EPICS IOC module. The dsPIC module communicates to the ISTTOK tokamaksensors and actuators via RS-485 and is programmed with a new protocol developed for this purposethat allows EPICS IOC module command sending/receiving, machine operation control and monitoringand system status information. Communication between EPICS IOC module and clients is achieved via aTCP/IP and UDP protocol referred as Channel Access. In addition, the EPICS IOC module provides user clientapplications access allowing operators to perform remote or local monitoring, operation and control.

. Introduction

Enhanced Physics and Industrial Control System (EPICS) [1–5]s a set of tools working together in order to provide a distributedoftware solution for Control, Data Access and CommunicationCODAC).

It provides channel access (CA) communication protocol withCP/IP and UDP connections between EPICS systems for: transferrocess variable (PV) values across the computer network; dataccess and network topology configuration. It is composed by:processing database with some Graphical User Interface (GUI)

ools for PV configuration; a sequencer module which can be pro-rammed using the State Notation Language (SNL) to provide ainite State Machine (FSM) and other ready to compile and useoftware modules and extensions.

Several open-source development tools can be used to pro-ide operator interface (OPI) such as Motif Editor and Display

anager (MEDM) [6] and Java [7]. Channel Archiver extension

8] provides an archiving system for PV data storage and alarmandler [9] a monitoring tool to detect and send warning mes-

∗ Corresponding author.E-mail address: [email protected] (P. Carvalho).

920-3796/$ – see front matter © 2011 Published by Elsevier B.V.oi:10.1016/j.fusengdes.2011.03.100

© 2011 Published by Elsevier B.V.

sages and alarms when PV values fall out of normal operatingconditions.

The present work describes how an EPICS IOC module environ-ment was developed, tested and integrated for the ISTTOK tokamakslow control sensors and actuators operation providing a low costand time reduced software development platform for CODAC pur-pose.

2. System description

The ISTTOK slow control [10] is composed by the gas injectionand vacuum systems, Fig. 1.

2.1. Gas injection system

From the functional point of view, the hydrogen gas flows fromthe cylinder until the vacuum chamber under two regimes: (i)continuous, which goes through the flowmeter controller and (ii)pulsed, which passes through the piezo valve. The needle valvemanually controls the hydrogen gas flow to maintain the pres-

sure between 500 mbar and 1000 mbar at that point checkedthrough the Edwards EPS 10 sensor read. Electric and manualvalves near the tokamak chamber provide security for system oper-ation and isolation for vacuum chamber maintenance. The reducer
Page 2: EPICS IOC module development and implementation for the ISTTOK machine subsystem operation and control

1086 P. Carvalho et al. / Fusion Engineering and Design 86 (2011) 1085–1090

ction

var

2

bMeapco

3

Fcss

Fig. 1. ISTTOK gas inje

alve near the gas cylinder manually asserts the pressure, beforend after it, within the values 344.74 mbar and 689.48 mbar,espectively.

.2. Vacuum system

The vacuum system is organized in two similar branches. Eachranch is composed by: a rotary primary vacuum pump; a Turbo-olecular (TM) high vacuum pump and a set of two valves, one

lectric and other manual, connected to a Pirani sensor to monitornd to control the pumping operation. Values provided by the Piraniump sensors and gauges (MPT 100 and HTP 100) near the vacuumhamber allow detection of emergency situations from gas leakageccurrences.

. Slow control operation

The slow control system operates as a finite state machine,

ig. 2. The state machine is organized in 3 major stages: vacuum,leaning and power discharges, each one divided in several simpleteps. This section makes a short description of each one of theseteps.

and vacuum systems.

3.1. State machine description

• Vacuum◦ Offline: All systems offline.◦ Primary Vacuum: Rotary pumps turned on to start pumping

gas until primary vacuum state achieved. Pirani pressure sensorreading equals 10−3 mbar.

◦ High Vacuum: Turbo molecular pumps turned on to pump theair until high vacuum achieved. Pirani and gauges sensors read-ing equals 10−7 mbar. Rotary and turbo molecular pumps keeppumping gas to maintain high vacuum state and system is readyfor cleaning or power discharges.

• Cleaning Discharges◦ Standby: All systems initiated and status verified.◦ Glow discharge: Glowing plasma obtained by the passage of

the current from the transformer primary to the low pressureconfined hydrogen gas.

• Power Discharges◦ Standby: All systems initiated and status verified.

◦ Pre-Shot: System configuration.◦ Ready: All systems ready status checked.◦ Shot: Automatic time table sequence initiated by single trigger.

Discharge procedure initiated.

Page 3: EPICS IOC module development and implementation for the ISTTOK machine subsystem operation and control

P. Carvalho et al. / Fusion Engineering and Design 86 (2011) 1085–1090 1087

ntrol s

3

p

bItgrentdtt

Fig. 2. ISTTOK slow co

◦ Post-Shot: Shot data collected. Data files created and storagedin local database.

◦ Abort: Any non-normal operation detected causes an interruptprocedure and system returns to the standby state.

.2. CODAC system operation

The ISTTOK current CODAC system is displayed in Fig. 3.The operator sends a console command to change system from

rocess to power discharge stage.The experience cycle is initiated by software, about 60 seconds

efore discharge, through an optical fiber signal generated in/O port and transmitted to a Vacuum Control Unit (VCU). Sys-em passes to L I F S C stage where it is possible to perform aroup of procedures: i) power on Laser beam; ii) start Ion cur-ent measurement; iii) turn on Filament lamp; iv) initiate Softwaremergency protocol v) Charge capacitors bank and prepare allecessary equipment for discharge. A second optical fiber signal

riggers the VCU 50 seconds later. The tokamak is then ready toischarge over a 17 seconds time window. Meantime, the systemiming unit sends a clock signal to trigger the pre-programmed timeable sequence to control the power discharge. Plasma is created

ystem state machine.

through an ignitron single shot which closes the capacitors bank tothe transformer primary discharge circuit. The VCU automaticallypasses to PAUSE and to WAIT-VME stages and the experience cycleterminates.

4. Implementation and software architecture

To implement the EPICS IOC [11] solution a hardware and soft-ware environment was created. The hardware system is composedby a standard computer with an RS232 serial port for serial com-munication. Attached to the serial port is an interface modulewhich provides system and IOC interaction. The operating systeminstalled is the Scientific Linux v5.4 distribution. Plus, the installedEPICS software packages: EPICS base v3.14.11, the extensions,Motif Editor and Display Manager (MEDM v3.1.4), Channel Archiverand Alarm Handler (ALH v1.2.25) and the modules, AsynchronousDevice Driver (ASYN v4.12) [12] for serial RS-232 communicationcapability and Sequencer (SNCSEQ v2.0.12) to provide the FSM

model. The EPICS IOC software module architecture is displayedin Fig. 4.

In the old architecture some system components like electricvalves and some state machine steps were manually con-

Page 4: EPICS IOC module development and implementation for the ISTTOK machine subsystem operation and control

1088 P. Carvalho et al. / Fusion Engineering and Design 86 (2011) 1085–1090

data acquisition stage diagram.

tii

4

soAAimcaIras

4

gcT

Fig. 3. ISTTOK control and

rolled and initiated by the operator. The software architecturemplemented performs these tasks automatically without humanntervention.

.1. EPICS IOC

EPICS IOC communicates with remote and local EPICS clients,equencer module and PV database using the CA gateway. More-ver, the IOC interaction with system is achieved through thesynDriver module Application Programming Interface (API) [13].ll slow control system components have an associated PV created

n the PV database. The sequencer module is programmed to imple-ent the system state machine steps described earlier, update and

heck PV values and status while Operator Interface (OPI) requestsre sent from clients to IOC to be dispatched. Consequently, theOC triggers the associated PV database process and transmits theequired operation to the system interface module which takes theppropriate action to execute the requested command. The IOC andequencer modules are started by running a script file.

.2. Interface module

This module directly communicates with the system vacuumauges, pump controllers, some electric valves and other systemomponents in order to read from sensors and write to actuators.he interface module used, is the dsPIC node board developed at

Fig. 4. EPICS IOC software module architecture.
Page 5: EPICS IOC module development and implementation for the ISTTOK machine subsystem operation and control

P. Carvalho et al. / Fusion Engineering and Design 86 (2011) 1085–1090 1089

Table 1Query.

tAdoRbTLvicfiactusp

4

pnm

Table 2Response.

OP ID DATA CKS CR

3 Bytes 1 Byte N Bytes 3 Bytes 1 Byte

he Instituto de Plasmas e Fusão Nuclear (IPFN - EURATOM/ISTSSOCIATION) [14]. This module is composed by: a microcontroller,sPIC30F4013 from Microchip, with 48 Kbytes of program mem-ry; a ROM with 2048 bytes; an EEPROM with 1024 bytes; optical,S-232 and RS-485 serial interfaces; a 200 KSamples/s ADC with 12its resolution; general purpose digital I/O and interrupt sources.he module also contains: 1 push button for firmware reset; 2EDs for operation monitoring and a 7.3728 MHz crystal to pro-ide timing and clock capabilities. The developed firmware allowsnteraction with the IOC through an in-house developed communi-ation protocol described in the next section. The microcontrollerrmware is organized in 4 important functional modules: (i) timingnd interrupts to provide system time and to perform requestedommand interrupt routines; (ii) digital I/O port communicationo provide onboard LED signaling operations; (iii) packing andnpacking functions for send/receive data messages and systemensors and actuators signals read and (iv) convert functions torovide overall system interaction.

.3. Communication protocol

Table 1 and Table 2 displays the serial RS-232 communicationrotocol developed and implemented between EPICS IOC and dsPICode board through AsynDriver module. The query command wordinimum size is composed by 8 bytes (no DATA field required)

Fig. 5. Java operat

OP ID STAT DATA CKS CR

3 Bytes 1 Byte 1 Byte N Bytes 3 Bytes 1 Byte

while the response command word is 9 bytes minimum. Each com-mand word is a packed message string containing: the operator(OP) to be executed; a command caller identifier (ID); a commandchecksum (CKS) to verify successful communication between partsand carriage return (CR) as string terminator.

The response command differs from the query by adding a status(STAT) field which contains the result returned by the commandservice routine function.

4.4. Sequencer

The EPICS sequencer module [15] was programmed with theslow control state machine to execute all required steps automat-ically. Each 200 ms, the PV database is processed and all PV valuesare checked, updated and optionally displayed.

4.5. Operator interface

The Motif version of the extensible display manager is designedto minimize network throughput using event driven method tocommunicate with the EPICS IOC. A Motif user interface was devel-

oped using the MEDM extension. In addition, an open-source tool,Control System Studio (CSS), can also be used to develop EPICSbased motif graphical user interfaces [16]. A Java GUI, Fig. 5, was alsodeveloped and implemented using the Java Channel Access (JCA)

or interface.

Page 6: EPICS IOC module development and implementation for the ISTTOK machine subsystem operation and control

1 ring a

Aiow

5

omrE

Efl

6

iTsocswear

[[

[[

090 P. Carvalho et al. / Fusion Enginee

PI for command sending to the IOC and data receiving for visual-zation. Compared to Motif, Java offers a more attractive solutionnce it is provided by a cross-platform wide range of well designedidgets library.

. Results

The EPICS environment and all software modules were devel-ped and implemented. Tests to the communication protocol wereade to verify RS-232 read and write operations, query and

esponse command words checking and data integrity within thePICS sequencer module 200 ms periodicity.

The Linux serial port was exclusively locked for thePICS IOC communication to avoid possible errors and con-icts.

. Conclusions

By implementing the EPICS IOC solution in the vacuum and gasnjection systems the ISTTOK machine achieved several advantages.he most important and relevant are: proven technology in largecale experiments; high performance in control and monitoringperations; wide range of already developed solutions ready toompile and use providing an open-source system with reducedoftware development time and low cost capabilities. Future work

ill require: I/O controller optimized operation, acquired knowl-

dge applied to other communication protocols and architecturesnd development of EPICS-based software compliant with ITER [17]equirements and specifications.

[[[[

nd Design 86 (2011) 1085–1090

Acknowledgments

This work has been sponsored by the Contract of Associationbetween European Atomic Energy Community and Instituto Supe-rior Técnico (IST) and by the Contract of Associated Laboratorybetween Fundacão para a Ciência e Tecnologia (FCT) and IST. Thecontent of publication is the sole responsibility of the authors andit does not necessarily represent the views of the Commission ofthe European Union or FCT.

References

[1] http://www.aps.anl.gov/epics/.[2] M. Kwon, I.S. Choi, J.W. Choi, J.S. Hong, M.C. Keum, K.H. Kim, et al., The control

system of KSTAR, Fusion Eng. Des. 71 (2004) 17–21.[3] K.H. Kim, et al., Software development of the KSTAR Tokamak Monitoring Sys-

tem, Fusion Eng. Des. 83 (2008) 291–294.[4] M.K. Kim, et al., EPICS implementation for the KSTAR vacuum control system,

Fusion Eng. Des. 81 (2006) 1823–1827.[5] K.H. Kim, C.J. Ju, M.K. Kim, M.K. Park, J.W. Choi, M.C. Kyum, et al., The KSTAR inte-

grated control system based on EPICS, Fusion Eng. Des. 81 (2006) 1829–1833.[6] http://www.aps.anl.gov/epics/extensions/medm.[7] http://www.sun.com/java.[8] http://ics-web.sns.ornl.gov/kasemir/archiver.[9] http://www.aps.anl.gov/epics/extensions/alh.10] B.B. Carvalho, ISTTOK Tokamak Real Time Control, Phd Thesis, 2003.11] R. Kraimer, J. Anderson, A. Johnson, E. Norum, J. Hill, R. Lange, EPICS:

Input/Output Controller Application Developer’s Guide.12] http://www.aps.anl.gov/epics/modules/asyn.13] http://www.aps.anl.gov/epics/modules/soft/asyn/R4-

14/HowToDoSerial/tutorial.pdf.14] http://www.ipfn.ist.utl.pt.15] http://www.slac.stanford.edu/comp/unix/package/epics/sequencer.16] http://css.desy.de/content/index eng.html.17] http://www.iter.org.