The design of software development platform for CFETR plasma control system

The design of software development platform for CFETR plasma control system

Fusion Engineering and Design 152 (2020) 111433 Contents lists available at ScienceDirect Fusion Engineering and Design journal homepage: www.elsevi...

2MB Sizes 2 Downloads 30 Views

Fusion Engineering and Design 152 (2020) 111433

Contents lists available at ScienceDirect

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

The design of software development platform for CFETR plasma control system

T

L.L. Yana,b, Q.P. Yuana,*, B.J. Xiaoa,b, R.R. Zhanga, Y.Y. Zhenga,b, J.Q. Zhua,b, H.R. Guoa,b, D. Lia a b

Institute of Plasma Physics, Chinese Academy of Sciences, Hefei, 230031, China University of Science and Technology of China, Hefei, 230026, China

A R T I C LE I N FO

A B S T R A C T

Keywords: Software platform Plasma control system Eclipse Visualization Algorithm management

The Plasma Control System (PCS) is a critical system of the tokamak device to guarantee the physical experiment operation. While the Chinese Fusion Engineering Testing Reactor (CFETR) PCS is in the preliminary development stage, the newly designed Plasma Control System Software Development Platform (PCS-SDP) will provide an effective, convenient, and visual development environment for PCS software developers. The PCS-SDP is developed based on the Eclipse framework as an extension and finally realized as an Eclipse plug-in. It is deployed in a thin-client C/S mode in which developers log in and work remotely and all the developments are carried on a development server. The PCS-SDP possesses an intuitive UI and contains modules of project management, algorithm management, visualization management, testing management, and version management. Because of these customized functions, the PCS-SDP makes the developers focus on the control logic design of the PCS algorithms without the need to pay attention to the PCS details; the work efficiency is improved significantly. In this paper, the requirements are analyzed, the system architecture and module design are presented, and some functions are demonstrated. The initial hardware environment deployment has been implemented and is also presented in this paper. Further efforts will be made to implement and demonstrate the functions of all modules on the EAST PCS, then serve CFETR PCS development and can be appropriate for most Plasma Control Systems.

1. Introduction The Chinese Fusion Engineering Testing Reactor (CFETR) is the next device for the Chinese magnetic confinement fusion (MFC) program that aims to bridge the gaps between the experiment ITER and the demonstration reactor DEMO [1]. The Plasma Control System (PCS) is a critical system of the tokamak device to guarantee the physical experiment operation [2,3] and is composed of a hardware structure, a user interface for making control scenarios, and abundant control algorithms [4]. The CFETR PCS is under preliminary concept design, including real-time control framework, and control functions. The control functions contain wall conditioning and T removal, magnetic control, kinetic control, MHD and error field control, event detection and exception handling, support functions and so on. With the increasing complexity of plasma control requirements, a PCS should be upgraded and refined constantly by integrating new hardware and adding newer, more advanced control algorithms [5]. To provide an effective and convenient control algorithm development environment, the PCS-SDP is propounded as an important tool for PCS software



developers. The PCS-SDP is a visual platform integrating multiple functions of interface design, programming, debugging, simulation, testing, version management, extensive functional components, etc. with good cross-platform portability, simple maintainability, and extreme expansibility. Compared to the development mode of the EAST PCS, which has poor visualization and a very steep learning curve for users and even programmers to understand the overall PCS architecture, developers obtain a visualization environment and only need to develop core algorithm functions. The design work, the system architecture, and hardware environment deployment are described in Section 2.2, the details of the design are discussed in Section 3, finally, a summary and future work are presented in Section 4. 2. Conceptual design 2.1. Requirements analysis In terms of performance, the stability and the safety issue must be

Corresponding author. E-mail address: [email protected] (Q.P. Yuan).

https://doi.org/10.1016/j.fusengdes.2019.111433 Received 20 August 2019; Received in revised form 12 December 2019; Accepted 12 December 2019 0920-3796/ © 2019 Elsevier B.V. All rights reserved.

Fusion Engineering and Design 152 (2020) 111433

L.L. Yan, et al.

considered first, because the PCS needs a very stable operating environment to ensure the discharge experiments do not disrupt, while at the same time, good extensibility is needed to obtain multiple integrated functions. The PCS will be demonstrated on EAST and will be used as the CFETR PCS and possibly even other devices, so cross-platform portability is necessary [6]. In terms of functioning as an integrated development environment, basic elements of programming, code editing, compiling, running, and debugging must be implemented, and should be integrated as one-key so as to avoid the tedious running process of the EAST PCS; the details about the project management are in Section 3.1. For the main goal of creating algorithms easily and efficiently, the platform needs to provide algorithm templates and ensure the new algorithms can be integrated into the PCS framework after they are compiled; the preliminary design will be discussed in Section 3.2. The PCS interface will be developed using a drag and drop platform that automatically creates a control interface, thus special extensive component repositories should be provided; related technologies will be discussed in Section 3.3. To ensure the feasibility and security of the platform, it should be provided with different testing modes for debugging and demonstration; the details will be discussed in Section 3.4. Because the development work of the PCS is an enormous project with many developers contributing ideas, code, test cases, etc., the platform must support collaborative development. There will also be many different versions of the PCS for different equipment implementations, thus the files and code should be saved, organized, and archived properly using a well-developed version management system; related technology will be discussed in Section 3.5.

shown in Fig. 1. The Eclipse framework with open structure is used as the base [7,8], and functionality is extended by means of plug-in development and third-party tools and libraries (QT, GIT, GCC, GDB [9–11], etc.), all of which are integrated with the Eclipse framework seamlessly, and sequentially generating a plug-and-play plug-in for use diffusely. This architecture can easily meet the requirements of the PCSSDP. Finally, in accordance with Eclipse’s standard features, the architecture can support Linux OS well [7]. The platform contains five functional management modules: project, algorithm, visualization, testing, and version; the architecture is shown in Fig. 1. Developers start their work by the special user interface based on Eclipse where they can customize the menu, toolbar, view, perspective and so on. When developers create a new algorithm, algorithm templates defined in the algorithm management module are presented, they can choose the template needed and complete the algorithm function. The algorithm contains parameter definitions that are communicated via the interface, the visualization module provides components and a visual data editor for developers. The parameter definition code generated by dragging and dropping is also available, then the developers can run the project with “one-click” realized by the project management module. However, before the version is released by the version management module, the developers can test the project in the testing module. The test data are saved in the MDSplus database, the PCS framework integrates control functions and complete parameter setting of the PCS interface by accessing files presented from PCSSDP.

2.2.2. Hardware deployment The PCS-SDP is based on the structure and deployment of the EASTPCS since the CFETR PCS is in the design phase. The PCS is implemented on the internal control network, which has high safety requirements, and the developers involved are relatively fixed, hence the PCS-SDP adopted C/S mode on Linux during the development stage.

2.2. Platform conceptual design 2.2.1. System architecture The PCS-SDP is a large-scale integrated development platform, as

Fig. 1. The system architecture of PCS-SDP. 2

Fusion Engineering and Design 152 (2020) 111433

L.L. Yan, et al.

Fig. 2. Hardware deployment of PCS-SDP.

discontinued, the errors will be highlighted in red, and the system will skip to the errors via double-clicking the mouse on the desired error message. However, if there are no bugs, the output will be displayed on the console of the platform. The debugging function is realized by the GDB tool combined with the Eclipse graphic debugging interface, which provides developers with a visual and convenient debugging method. It supports setting breakpoints, single-step debugging, code viewing, thread viewing, stack viewing, and variable monitoring. To meet the PCS requirement, we have customized and configured the environment, specifically, the menus and tools were extended in a manner of plug-in development properties for building the debugging and running configurations were customized; the interface of the EAST PCS as seen when running in the PCS-SDP is as shown in Fig. 3.

The C/S mode refers to the client/server structure, it is suitable for a dedicated network or a small-scale network, both of which are more secure than a browser/server structure. To reduce the maintenance cost, a thin client mode of C/S is employed, all of the development work is carried out on a development server, which requires that the clientside use some common, commercial software to manage the connection to the server. The PCS-SDP is deployed on a development server which is a virtual server in a cloud platform in the control network. Developers login to the gate server remotely then connect to the server by an SSH command in the visual terminal. For safety, only authorized developers can log in through the gate server on the internal control network [12]. When the development and the testing are finished, the PCS-SDP will be deployed on the EAST PCS server to demonstrate its functionality and eventually the CFETR PCS server might be used on other magnetic confinement machines. The overall deployment is shown in Fig. 2.

3.2. Algorithm management The organization structure of the control algorithm directory of the EAST PCS is shown in Fig. 4, the EAST PCS contains many different control directories defined in categories.h such as discharge, IP control, etc. Each control directory contains different control algorithms, for example < alg > .master.h file is the function code of algorithms. There are some shortcomings in the way that new algorithms are added, however. First, developers must write a complete < alg > .master.h file, the file has a close relationship with the PCS framework and interface, so they must be aware of all the details concerning the system structure and operation process of the PCS which means they do not get to concentrate on the development of the algorithm logic or function as much. Second, different < alg > master.h files may have the same parameter definition and common logic part, which will cause

3. Function module design 3.1. Project management The project management module should provide developers a basic project development environment for code editing, compiling, linking, running, and debugging. The code editing interface should also include code navigation, code positioning, automatic error correction, automatic prompt, automatic completion, highlighting, commenting, and documentation. The module supports one-click running such that when developers click the button or menu, the system will compile, link, and run all the code in sequence. If bugs occur, the process will be 3

Fusion Engineering and Design 152 (2020) 111433

L.L. Yan, et al.

Fig. 3. The interface of project management.

Fig. 4. Structure of control algorithm directory of EAST PCS. 4

Fusion Engineering and Design 152 (2020) 111433

L.L. Yan, et al.

Fig. 5. The software architecture of CFETR PCS.

technology. The module is developed using the Eclipse plug-in.

developers to do a lot of repetitive work. Similarly, CFETR PCS contains a lot of control algorithms for realizing control functions, as well as the content is needed to be added and updated continuously; the architecture of CFETR PCS is shown in Fig. 5. To avoid spending so much effort on learning all the PCS details, algorithm templates will assist developers with designing and implementing algorithms. The template provides basic modules and functions such as initialization functions, end functions, main functions and so on. Meanwhile, it designs the algorithm category and compiling regulation beforehand. When PCS developers create a new class or an algorithm, they only need to choose the appropriate category and fill the corresponding module with functioning code. The template will generate algorithm logic files automatically to ensure that the algorithm could be compiled and linked with other files in the PCS. Meanwhile, the main functions of the template reference various sub-data in the data structure of the PCS framework, such as the target values of the PCS interface setting, input parameters, control parameters and so on. The algorithms can obtain the elements of the PCS interface and possess the input/output data structure corresponding to the PCS interface. Finally, it realizes the algorithm logic and integrates the algorithm into the PCS; the process is shown in Fig. 5.

3.4. Testing management The EAST PCS provides a software testing mode and hardware testing mode. The software testing mode tests the software logic and performance with commands. It can adopt archived data or a physical model as input, but it does not operate any hardware equipment. Hardware testing mode is a hardware simulation test command. It starts the input/output hardware such as the data acquisition card, real-time computer, RFM (reflective memory card), and so on. The acquisition cards provide data only as an input signal which is not real discharge data. Related parameters are read from the MDSplus history shot data. The testing management module of the PCS-SDP mainly tests algorithm logic, software testing is sustainable. The PCS-SDP will provide two software testing methods: the data sim server method will analyze the input/output and basic functions of the algorithms by reading the archived data from the MDSplus such as the port and hostname and so on. The method is handy and efficient, the analysis results will be shown on the PCS-SDP in the form of a visualization. The simulation server method is designed for testing the actual control effect of the algorithm. It will respond to the control signal and form a closed-loop feedback control system by loading related physical models from the simulation server, allowing the algorithm developer to adjust according to the feedback results. The testing method is as shown in Fig. 7.

3.3. Visualization management The visualization management module is designed for the visual development of the PCS algorithm parameters corresponding to the interface such as the algorithm name, PLOT_YMIN, etc.; the process is shown in Fig. 6. It mainly contains four parts: the algorithm category is displayed in the style of a tree list where developers can choose the algorithm they need to develop, the second part is a custom component palette which provides the corresponding functional components needed where developers can drag the components directly to generate code that they can then edit, the third part is component property for setting competent, the fourth part is the work area which contains a design page and source page that is converted in real-time. When the development is finished, a. h file is presented and included in the algorithm file (< alg > master.h) and then integrates into the PCS framework. The PCS interface can acquire the interface data by socket

3.5. Version management The PCS is updated constantly [2] meaning there are many different versions and related files that need to be saved. The EAST PCS saves the PCS files as different transcripts which are labeled with the different version numbers in a special catalog that developers obtain and submit after they are authorized as master developers who must test and save to the current version manually and carefully. This means there is a lot of repeated work for master developers and developers. Also, it is difficult to look back at the specific modification record and version vulnerabilities. The version management module of the PCS adopts the git tool to control versions and collaborative development; a distributed 5

Fusion Engineering and Design 152 (2020) 111433

L.L. Yan, et al.

Fig. 6. The system architecture of PCS.

the EAST PCS, then will be used for CFETR PCS development.

version management system integrated into the PCS-SDP [9]. The internal control network provides a git cloud server as the cloud repository where master developers and developers can clone, fetch, and pull projects from the cloud repository by URL to their own repositories then import them into their own workspace. Developers can then create branches and commit projects to the repository. When the work is finished, the developers merge the code to their master branches and send the patches to the master developer. The master developer examines the content and push patches to the git cloud server and informs all of the developers. Branches help developers develop and compare different versions simultaneously, and different versions can be switched freely. Every developer can obtain the latest information from the git cloud server to start their development work, they also can develop their own program that is invisible for others in the development branch; the process is as shown in Fig. 8.

Author contributions Q. P. Yuan did the main work for this paper, platform conceptual design and requirements, revising paper. L.L. Yan did the main work for this paper, module design, deployment, technology, drafting paper. R. R. Zhang did a very important job, she provided technology support of EAST PCS algorithms. B.J. Xiao put forwards some ideas and suggestions about visualization. Besides, he provided funds for our research. J.Q. Zhu worked on the data collection. H.R. Guo worked on the data collection. Y.Y. Zheng worked on the data collection. D. Li put forwards some ideas and suggestions about visualization. Besides, she provided funds for our research.

4. Summary

Declaration of Competing Interest

A Software development platform is proposed as a tool for PCS development. The design and preliminary work are presented in the paper as well as some functions that have been implemented. Future work will be focused on the implementation of functions when the development is completed, the platform will be verified and tested on

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Fig. 7. Test mode of PCS-SDP. 6

Fusion Engineering and Design 152 (2020) 111433

L.L. Yan, et al.

Fig. 8. Version management of PCS-SDP.

Acknowledgments

Eng. Des. 83 (2008) 181–187. [4] R.R. Zhang, B.J. Xiao, Q.P. Yuan, The web-based user interface for East plasma control system, Fusion Eng. Des. 89 (2014) 558–562. [5] Q.P. Yuan, J.Y. Tang, B. Penaflor, et al., Upgrade of EAST plasma control system for steady-state advanced operation, Fusion Eng. Des. 129 (2018) 109–114. [6] Q.P. Yuan, B.J. Xiao, R.R. Zhang, The design of remote participation platform for EAST plasma control, Fusion Eng. Des. 112 (2016) 1045–1048. [7] J. Campos, A. Riboira, A. Perez, GZoltar: an eclipse plug-in for testing and debugging, Proceedings of Automated Software Engineering (2012). [8] https://www.eclipse.org. [9] https://www.qt.io. [10] https://git-scm.com. [11] http://www.gnu.org. [12] X.Y. Sun, F. Wang, Y. Wang, S. Li, Conceptual design of remote control system for east tokamak, Fusion Eng. Des. 89 (2014) 741–744.

This work is supported by the National MCF Energy R&D Program of China, Grant No. 2018YFE0302100. This work is supported by the National Natural Science Foundation of China, Grant No: 11805240. References [1] Y.X. Wan, J.G. Li, Y. Liu, et al., Overview of the present progress and activities on the CFETR, Nucl. Fusion 57 (2017) 102009. [2] Q.P. Yuan, B. Xiao, K. Wu, et al., New control abilities on EAST PCS for steady-state operation, IEEE Trans. Plasma Sci. 46 (2018) 1356–1360. [3] B.J. Xiao, D.A. Humphreys, M.L. Walker, et al., EAST plasma control system, Fusion

7