Tokamak TCABR: Acquisition system, data analysis, and remote participation using MDSplus

Tokamak TCABR: Acquisition system, data analysis, and remote participation using MDSplus

Fusion Engineering and Design 87 (2012) 2199–2202 Contents lists available at SciVerse ScienceDirect Fusion Engineering and Design journal homepage:...

494KB Sizes 0 Downloads 36 Views

Fusion Engineering and Design 87 (2012) 2199–2202

Contents lists available at SciVerse ScienceDirect

Fusion Engineering and Design journal homepage: www.elsevier.com/locate/fusengdes

Tokamak TCABR: Acquisition system, data analysis, and remote participation using MDSplus W.P. de Sá ∗ Instituto de Física, Universidade de São Paulo, Rua do Matão, Travessa R, 187, CEP 05508-090 Cidade Universitária, São Paulo, Brazil

a r t i c l e

i n f o

Article history: Received 20 July 2011 Received in revised form 24 November 2011 Accepted 19 April 2012 Available online 4 July 2012 Keywords: MDSplus Remote participation Data acquisition Control Tokamak TCABR

a b s t r a c t Each plasma physics laboratory has a proprietary scheme to control and data acquisition system. Usually, it is different from one laboratory to another. It means that each laboratory has its own way to control the experiment and retrieving data from the database. Fusion research relies to a great extent on international collaboration and this private system makes it difficult to follow the work remotely. The TCABR data analysis and acquisition system has been upgraded to support a joint research programme using remote participation technologies. The choice of MDSplus (Model Driven System plus) is proved by the fact that it is widely utilized, and the scientists from different institutions may use the same system in different experiments in different tokamaks without the need to know how each system treats its acquisition system and data analysis. Another important point is the fact that the MDSplus has a library system that allows communication between different types of language (JAVA, Fortran, C, C++, Python) and programs such as MATLAB, IDL, OCTAVE. In the case of tokamak TCABR interfaces (object of this paper) between the system already in use and MDSplus were developed, instead of using the MDSplus at all stages, from the control, and data acquisition to the data analysis. This was done in the way to preserve a complex system already in operation and otherwise it would take a long time to migrate. This implementation also allows add new components using the MDSplus fully at all stages. © 2012 Elsevier B.V. All rights reserved.

1. Introduction Nowadays science has the participation of many scientists from different countries working together on joint research projects. The scientists belong to different laboratories and each of these laboratories has its own way of controlling the experiments and retrieve data. Scientists in this complex environment, have to learn different approaches, programs and access codes to experimental data and doing their analysis. That means they have to adapt themselves to each experimental setting. There are two other problems: the system of data acquisition and control are closed behind a firewall and data analysis is, in almost all cases, a proprietary system that was developed by the laboratory. The TCABR tokamak (Tokamak Chauffage Alfvén Brésilien – R = 0.61 m, a = 0.18 m, Bt = 1.0–1.4 T, IP ≤ 120 kA, n0 ≤ 4 ×1019 m−3 ) [1], was installed at the Laboratory of Plasma Physics of the Institute of Physics of the University of São Paulo, Brazil. This medium sized laboratory has contributed with relevant scientific papers to the community of plasma physics and nuclear fusion, and the remote participation plays an important role in the relationship between

∗ Tel.: +55 11 30916630; fax: +55 11 30917014 E-mail address: [email protected] 0920-3796/$ – see front matter © 2012 Elsevier B.V. All rights reserved. http://dx.doi.org/10.1016/j.fusengdes.2012.04.022

scientists. We are developing and implementing technologies for remote participation, which preserves the control and data acquisition techniques that have been well working at a long time, but allow a transparent access to experimental data. The goal of remote participation is to hide all the complexity of the methods of the laboratory storing and retrieving the data and controling the experiment from the end-users. A client/server system has proven the most efficient way to isolate these users from the system that controls the experiment and manages the data access. The MDSplus [2,3] is a set of programs and tools for data acquisition, storage and control of the experiment with a methodology for managing the complicated environment of research in the plasma physics and nuclear fusion. MDSplus is the mostly widely used software package in these laboratories. Currently, it is used in more than 30 institutions around the world, it is extremely well documented, it has a quick resolution of problems and it is distributed freely to various platforms. Another important point is that the MDSplus has a library system that allows communication between different types of language (JAVA, Fortran, C, C++, Python) and programs such as MATLAB, IDL, OCTAVE. The implementation of MDSplus in TCABR tokamak, however, requires construction of interfaces between the system already installed and the MDSplus. The implementation of this interface is the subject of this article.

2200

W.P. de Sá / Fusion Engineering and Design 87 (2012) 2199–2202

Fig. 1. TCABR Control and Data Acquisition System before upgrade.

2. Early TCABR Control and Data Acquisition System (TCAqs) The complete system that forms the TCABR Control and Data Acquisition System (TCAqs) [4–6] before the implementations of the remote participation technologies is shown in Fig. 1. The TCAqs refers to all the devices, computer and computing schemes that support and register the TCABR tokamak activity. It is based on the instrumentation standard VME [7], with Motorola 68040 and Motorola 68060 CPU and OS9 operating system, an ATCA (advanced telecom computing architecture) [8] crate with Intel Core 2 Duo CPU and Linux operating system, computers with PCI boards and oscilloscopes. ADCs modules of 12-bit resolution are available for data acquisition. The Linux operating system is used in the workstation at Control and Data Acquisition System room. The TCAqs is centered around a Database Management System (the MySQL has been chosen for the TCABR), allowing to store, manipulate and retrieve data in table structures, that contain all information necessary for TCABR activities. This database is called DBTCAqs. All software needed to control and the data acquisition system have been developed locally [4,5]. The data are compressed. The method chosen was an adaptation of Lempel–Ziv–Welch (LZW) [5]. This process reduces transmission errors, increases storage efficiency and provides faster access to data. Before implementation of MDSplus, in order to access the data and the information in the database, a set of software was written using the languages C/C++and Perl. This system is behind a firewall and the access from outside this firewall is not allowed. All data analysis performed by the user has to be performed in the control and data acquisition room. It is possible to record this analysis on removable media or send information and data from the local network to the world. It is clear that this is no longer compatible with the environment of collaboration between the various scientists and laboratories around the world.

Fig. 2. Flow diagram showing the implementation of the new TCABR data acquisition system – TCAqsUP.

the new features. For the new system, now called TCAqsUP, the solution that has been adopted is based on MDSplus. The first step in the process of remote data access was to create a logbook, outside the firewall, to the shots of the TCABR tokamak with viewing by web browsers. Web pages were developed in PHP language to write the information in the database (The PostgreSQL has been chosen for storage the TCABR shot information. This database is called DBLoogBk.), and user-friendly pages to view this information. This step is already in full operation. The second step, which is partially implemented, is to use the MDSplus. The MDSplus stores the information, as well as data, in a hierarchical tree structure, like the organization of files on a file system with directories and subdirectories. The proposed system for the TCABR data acquisition system (TCAqsUP) is to transform data and information stored in the old scheme in the MDSplus tree hierarchical structure. The second step consists in developing two processes. One process is the access to new shots and another process represents access to the old shots, already stored in the DBTCAqs database. Fig. 3 shows two diagrams showing how the data and information flow to the formation of MDSplus Server for both processes. 3.1. Process to implement new shots to MDSplus The process of storing information and data of a shot is shown in Fig. 3 (left). A shot has engineering information, that is the

3. New TCABR Control and Data Acquisition System (TCAqsUP) The TCAqs system was designed as a security solution, isolating the area of the tokamak and the control and data acquisition room from the world network, by a firewall. The software that was developed, permits only that the users perform the data analysis at the control and data acquisition system room. For remote access participation, the TCAqs has been redesigned by adding new functionalities instead of complete changes in the system. Fig. 2 shows a flow diagram with the implementation of

Fig. 3. Flow diagrams showing the creation of the MDSplus server in the case of new shots (left) and old data (right), already stored in the DBTCAqs database.

W.P. de Sá / Fusion Engineering and Design 87 (2012) 2199–2202

conditions of tokamak configuration for the specified shot, all information of diagnostic signals and all the data for these signals. The diagnostic signals have information regarding the status of ADCs, sampling, scales, filters used, etc., information required for the reconstruction of the signal. The informations are saved directly in the DBTCAqs database. The data signals are processed in a compression system. Then, the information and the compressed data are archived into a single file that represents the shot. The implementation of TCAqsUP consists of a set of programs, called layer interface, written in C++and Python to do the following operations: • Read the shot file and the DBTCAqs database. • Get the information of the shot, and create a hierarchy tree MDSplus, using a template. • Write this hierarchy tree MDSplus in MDSplus Server. • Write the information and data for this shot in MDSplus Server.

This process is automated. Instructions added to the control, data acquisition and analysis system, TCAqs, sends information to the layer interface programs that performs the operations described above in the process of acquisition of new shots. In addition, the external database (this database is called DBTCAqsUP) is updated (Fig. 2).

3.2. Process to implement old shots to MDSplus The old shots, already stored in the DBTCAqs database and at the archives of shot, follow a different path to be accessed from the MDSplus system, than that was implemented for new shots. As we have seen before, new shots have the information as well as data stored in the structure of MDSplus. However, for the amount of shots, already stored, it would require a large amount of CPU time for this implementation. Thus, we choose only save the information of the shots in the structure of MDSplus. Data is not included. The process is shown in Fig. 3 (right). Here, the layer interface is responsible for creating the MDSplus hierarchy tree of the shot and put the information in this tree. In the analysis of an earlier shot, the user has available all the information of the shot at the hierarchy tree MDSplus. To access the data, codes written in TDI (Tree Data Interface) and languages like Python and C++, are used to access the DBTCAqsUP database (who has, also, a copy from DBTCAqs database), read the data file, choose the signal of interest, decompress the signal file and let it available for viewing through MDSplus system.

3.3. Data retrieval The MDSplus has the ability to export the contents of MDSplus trees on the network in such a way that it is possible to see the data on any networked computer in the same way as the computer that hosts the trees. With the implementation of the hierarchical data structure MDSplus, users now have several options for access data from the TCABR shots. They have the option of using the old system or the MDSplus Application Programming Interfaces (APIs) that support a variety of options using JAVA, Fortran, C, C++, Python, MATLAB, IDL, Octave, Labview and jScope. jScope [2] is a sophisticated Java graphical interface program for viewing MDSplus data. One of the advantages of using jScope is that several signals can be seen in a single window for one or more shots. jScope can act as a client and retrieve data from remote MDSplus servers.

2201

4. Comparison with other solutions There are several methods for remote data access system used in fusion research. One solution, SDAS (Standard Data Access) [9], proposed and already being used at ISTTOK tokamak installed at Instituto de Plasmas e Fusão Nuclear (IPFN) of Instituto Superior Técnico, Universidade Técnica de Lisboa, Portugal, is based on Remote Procedure Call (RPC) that allows the execution of function on a remote server and to receive values from it. The SDAS server is formed by a XML-RPC and by the connector to the storage mechanism. The SDAS has a complex system of indexing the shots, and the data. It has an excellent system of security and authentication. Based on the solution of the SDA-IPFN, a simplified system was developed to the TCABR [6]. This system, written in Java, using XML technology and XML-RPC, allows access to data, but the whole process of analysis is done on remote servers. The authentication of users is held at this server. The simplicity of the method allows a fast implementation, however, it has many weaknesses. The study of these solutions shows to us that we would always have a very particular system for the activities of the tokamak, even allowing for easy remote access. A detailed study of MDSplus, shows a universalized situation, with little effort of the users in their learning and use, with equal access to different laboratories. Another important issue lies in the implementation. It is easier than implementing the system that was developed for the TCABR. Moreover, it has much more resources available,and its stability is already guaranteed by the use in many laboratories. 5. Future enhancements The implementation of the interface between the current system and data acquisition system formed by MDSplus is partially operational. The use and testing phase by users must start soon and we are going to refine the programs that have been developed. The third phase of TCAqsUp implementation will be the construction of a code for handling the data, especially built for the structure of MDSplus. At this stage, authorized users may include information about the shot, based on analysis of data postprocessed. These users can create their own trees in MDSplus, which are of interest for the experiments. As the systems of control and data acquisition are being updated and implemented, they will be included directly in the structure of MDSplus. 6. Summary Remote participation is critical at joint experiments in a nowadays science, and in the integration of small laboratories with these joint experiments. At the TCABR we are adopting the MDSplus tools for analyzing data. To keep the old system, interfaces were built connecting the systems in operation and the functionalities of a MDSplus server. Two solutions were presented to the interface: one for the shots that will happen after the implementation of the new data acquisition system (TCAqsUP) and old shots already stored in the database. The tests to be performed by users are going to begin soon. However we already can realize better efficiency and performance in data analysis. This has been observed in tests in the implementation process. Acknowledgements This work has been supported by The National Council for Scientific and Technological Development (CNPq), The State of São Paulo

2202

W.P. de Sá / Fusion Engineering and Design 87 (2012) 2199–2202

Research Foundation (FAPESP), and National Network of Fusion (RNF). The author W.P. de Sá would like to thank the Instituto de Plasmas e Fusão Nuclear, Instituto Superior Técnico, Lisboa for fruitful discussions during several visits. References [1] R.M.O. Galvao, Yu.K. Kuznetsov, I.C. Nascimento, E.K. Sanada, D.O. Campos, A.G. Elfimov, J.I. Elizondo, A.N. Fagundes, A.A. Ferreira, A.M.M. Fonseca, E.A. Lerche, R. Lopez, L.F. Ruchko, W.P. de Sá, E.A. Saettone, J.H.F. Severo, R.P. da Silva, V.S. Tsypin, R. Valencia, A. Vannucci, New regime of runaway discharges in tokamaks, Plasma Physics and Controlled Fusion 43 (2001) 1181–1190. [2] http://www.mdsplus.org.

[3] T.W. Fredian, J.A. Stillerman, MDSplus. current developments and future directions, Fusion Enginnering and Design 60 (2002) 229–233. [4] A.N. Fagundes, W.P. de Sá, P.M.S.A. Coelho, TCABR data acquisition system, Fusion Engineering and Design 48 (2000) 213–218. [5] A.N. Fagundes, W.P. de Sá, A.L. Dantas, TCABR data acquisition system update, Brazilian Journal of Physics 32 (2002) 50–53. [6] W.P. de Sá, Upgrading a TCABR data analysis and acquisition system for remote participation using Java, XML, RCP and modern client/server communication/authentication, Fusion Engineering and Design 85 (2010) 618–621. [7] http://www.vita.com. [8] http://www.picmg.org/v2internal/newinitiative.htm. [9] A. Neto, H. Fernandes, D. Alves, D.F. Valcárcel, B.B. Carvalho, J. Ferreira, J. Vega, ˜ M. Hron, C.A.F. Varandas, A standard data access layer E. Sánchez, A. Pena, for fusion devices R&D programs, Fusion Engineering and Design 82 (2007) 1315–1320.