Fusion Engineering and Design 71 (2004) 35–40
Progress in real-time feedback control systems in RFX O. Barana, A. Luchetta∗ , G. Manduchi, C. Taliercio Consorzio RFX, Associazione EURATOM-ENEA sulla Fusione, Corso Stati Uniti 4, 35127 Padova, Italy Available online 2 June 2004
Abstract Major modifications of the RFX load assembly and power supplies are in progress to allow extensive active control schemes, such as equilibrium and plasma position control and innovative control of the MHD modes. The digital control system is implemented in VME64 using a distributed architecture. The use of a ‘stable’ operating system that is likely to survive some generations of processors can help coping with evolution of technology. PowerPC and Pentium processors were thus considered as candidates and tested and the first one has been selected due to the better performance in floating point computation. Wind River VxWorks has been chosen as real-time operating system. 100 Mbit switched Ethernet has been evaluated for real-time communication by using the user datagram protocol (UDP). Measurements have been executed on a prototype system to assess data transfer latency, jitter and reliability and the results confirm that the solution is suitable for the application. The paper describes in detail the reasons for the choice in the hardware components. Results from several tests comparing the performance of different solutions are also provided. © 2004 Elsevier B.V. All rights reserved. Keywords: Reverse field pinch; Digital control; Feedback control; Position control; MHD mode control; VxWorks
1. Introduction Major modifications are under development at the RFX experiment aiming at a better control of the plasma. They involve both the load assembly and the power supply system and are finalized to make a fundamental step in the comprehension of MHD modes in the nuclear fusion experiments based on magnetic confinement. The first major intervention on the machine aims at better interacting with the plasma by external magnetic field. The RFX original load assembly was equipped ∗ Corresponding author. Tel.: +39-049-8295043; fax: +39-049-8700718. E-mail address:
[email protected] (A. Luchetta).
with a conductive shell surrounding the vacuum vessel with time constant for the penetration of radial field longer than the pulse length (450 and 150 ms, respectively). Little margin was thus left to control actively the pulse by means of external field. To overcome this limitation a new shell with lower time constant (50 ms) has been installed. This can control passively the equilibrium of the plasma column only in the first tens of ms, while active control of equilibrium must be provided in the rest of the pulse [1]. The goal of the second major intervention on the machine is the control of MHD modes, i.e. the harmonic spatial distribution of magnetic field evolving within and around the plasma. Unstable MHD modes, due to the presence of a resistive wall, grow up to destroy the magnetic configuration [2,3]. These resistive
0920-3796/$ – see front matter © 2004 Elsevier B.V. All rights reserved. doi:10.1016/j.fusengdes.2004.04.007
36
O. Barana et al. / Fusion Engineering and Design 71 (2004) 35–40
nents of the toroidal field or to produce robust rotating perturbations that are effective to drag in rotation the tearing modes and the localised helical deformation (LHD) [6].
2. System requirements
Fig. 1. View of the saddle coils covering the vacuum vessel.
wall modes (RWM) have poloidal order m = 1 and multiple toroidal orders n depending on a set of machine parameters. The rise of RWM with n < 5 and growth times ranging from many tens to hundred of ms has been predicted in RFX [4]. To interact with MHD modes a complex system has been implemented, consisting of 4 × 48 saddle coils (four in poloidal, 48 in toroidal direction) mounted to cover completely the outer surface of the vacuum vessel, 4×48 independent power amplifiers to drive the saddle coils and 4 × 48 probes, to measure the radial, poloidal and toroidal components of the magnetic field [1]. Fig. 1 illustrates a portion of the vacuum vessel covered with saddle coils. The third major modification aims at the independent control of current in the 12 sectors of the toroidal winding. To the purpose, a new toroidal power supply system has been developed, based on independent power amplifiers, one for each toroidal sector [5]. This allows producing components of toroidal field with poloidal and toroidal orders m = 0 and 0 ≤ n < 6 that can be used to control the plasma m = 0 compo-
The operation of the RFX experiment requires the active control of various physical parameters. In some cases the various controls do not interfere with each other, in other cases they are to be coordinated to avoid undesired interaction. All applications have a large number of input signals and characteristic time constants ranging from a few to tens of ms. The software environment is common to all applications, as all have to read-out samples from A/D converters, compute control algorithms and issue several to many analogue references. For these reasons a common solution can be used. Table 1 summarizes the main control schemes required in RFX. The first three entries of the table have been already mentioned. The active control of the toroidal position of the LHD is important when executing pulses at high plasma current, as in this case the enhanced plasma—wall interaction due to the wall locking of the LHD can damage the first wall. The control of the m = 0 and 1modes is very interesting for the comprehension of the physics of the MHD modes. The intelligent shell consists in using the saddle coils to minimise the radial field on the saddle probes in order to obtain a quasi-ideal flux surface. The table lists also the number of input/output channels used in each control scheme and the desired closed loop bandwidth. As the sampling frequencies of the digital control systems have to be much higher than the closed
Table 1 Main control schemes Control schemes
Number of input channels
Number of output channels
Equilibrium and plasma position Stabilisation of RWM Toroidal field at the wall Toroidal position of LHD m = 0 MHD modes m = 1 MHD modes Intelligent shell
80 192 + 192 192 192 192 192 192
8 192 12 12 12 192 192
+8 + 12 + 12 + 12
Closed loop bandwidth (Hz) 20 45 45 90 45 45 45
O. Barana et al. / Fusion Engineering and Design 71 (2004) 35–40
loop bandwidth in order to meet the requirements of control, sampling frequencies from some to many kHz are considered adequate.
3. System architecture A modular, distributed architecture was adopted as it helps coping with multiple control schemes, large number of signals and multiple locations where signals are available in the experiment. Typically, one node of the distributed architecture is dedicated either to acquire and pre-process input channels, or to execute some sort of algorithms on pre-processed quantities and generate the control references. The complete control algorithm is thus processed in a two-stage pipeline. Fig. 2 illustrates the system architecture together with the front-end signals. Three stations are de-
37
voted to data acquisition and pre-processing. The radial and toroidal field processors acquire and elaborate (typically by 2D spatial harmonic analysis) the homonymous component of the magnetic field. The axisymmetric processor acquires signals used in axisymmetric control schemes, such as the plasma position and the toroidal field at the wall. Four stations are devoted to compute control algorithms and generate control references. The MHD Sector Controllers A and B share the control of the 192 power amplifiers of the saddle coils. Two controllers instead of one are used to make the process parallel in hardware. The toroidal controller manages the power amplifiers feeding the toroidal sectors (non axisymmetric control), while the axisymmetric controller drives the power amplifiers of the poloidal and toroidal windings (axisymmetric control). The stations are all connected to two LANs, one used for off-pulse networking (not
Fig. 2. Overview of the system architecture.
38
O. Barana et al. / Fusion Engineering and Design 71 (2004) 35–40
shown in figure), the other dedicated to real-time communication during the pulse.
4. Components The system is implemented by means of seven VMEbus crates, each equipped with one single board computer (SBC) and I/O boards. The main criterion for the selection of the CPU was efficiency in both floating point arithmetic and networking. Two solutions were evaluated: specialized digital signal processors (DSPs), as in the previous RFX real-time control system [7], and general purpose processors such as Pentium and PowerPC. The following considerations were crucial in discarding the DSP based solution: one cycle, ADD AND MULTIPLY vector floating point operations are now available also in some general purpose architecture, not only in DSPs as in the past; general purpose processors increase their performance following the so called ‘Moore law’; general purpose processors are well supported by the suppliers of (real-time) operating systems, while DSPs are not; software development under a ‘stable’ operating system protects the investment. To compare the computation efficiency of different processors, a benchmark program based on the LU decomposition algorithm was run on two SBCs, equipped with 850MHz Pentium III and 500MHz PowerPC (MPC7410) processors, respectively. C language and GNU C compilers were used in both cases. Surprisingly, the PowerPC showed to be 30% faster than the Pentium. This was achieved without using the PowerPC AltiVec architecture that implements parallel vector arithmetic [8]. Hence, a single board computer (SBC) based on the MPC7410 processor was adopted running Wind River VxWork as real-time operating system [9].
5. Real-time communication Some solutions are commercially available for real-time communication with high data throughput, among which reflective memories, ATM, fast and giga ethernet. Some of them are used in various fusion and physics large experiments [10–14].
Reflective memories implement distributed shared memory using proprietary protocols for data transmission and memory coherency. They are expensive and introduce a legacy in both hardware and software (drivers). ATM is rarely used at LAN level and thus few ATM interfaces are commercially available. Tests were made to assess the feasibility of using fast ethernet, the main communication technology in the world. Due to the collision mechanism of the medium access the ethernet protocol is not deterministic, but the use of switches reduce drastically the probability of collisions. In the communication tests we used the User datagram protocol (UDP) that provides an unreliable connectionless delivery service, but is faster than TCP. By using three nodes connected via one switch, with one node sending data by multicast datagrams to the other, tests were carried out to measure the probability of losing datagrams, the data transfer latency (including processing of protocol stack, physical transmission and switch latency) and its jitter. The results of the tests are summarized as follows: no datagrams were lost in many hours of operation; the transmission latency, modelled by means of a random variable with Gaussian distribution, in the case of 1 kByte data transmission, has average and standard deviation of the order of 150 and 1.4 s, respectively. This means that 99.997% of datagrams are delivered with latency jitter within the interval ±5.6 s. It must be pointed out that in our application the network is insulated and the control system tolerates the loss of one datagram from time to time without loss of control.
6. Algorithms and arithmetic AltiVec floating point arithmetic has been exploited only in time critical routines, such as matrix arithmetic and Fourier analysis. Fig. 3 shows the measurements of the average number of CPU cycles needed to multiply the floating point arrays A[n][n] × B[n] versus the array dimension, in two implementations written in C language: nested iterative cycles; parallel algorithm optimised for Altivec architecture. As the AltiVec architecture uses four units in parallel to execute 32 bit floating point arithmetic, the improvement by using the AltiVec Architecture is a
O. Barana et al. / Fusion Engineering and Design 71 (2004) 35–40
39
to execute the FFT with and without AltiVec optimisation, respectively. The impact of AltiVec optimisation on the portability of the code is rather low, as it is required only for a few specialised routines.
7. Control system performance
Fig. 3. Computational efficiency in array arithmetic.
factor of four when the parallelism is fully exploited. In Fig. 3, the ratio between the plotted values is greater than four in most cases due to the better use of registers in the parallel algorithm. In general, the compiler is able to perform a better optimisation if applications use data stored in single variables rather than in vectors. Measurements performed in the case of 2D spatial Fourier Analysis on 192 points, that is the most interesting case for our application, show average numbers of CPU cycles of ∼6500 and 18,000
Fig. 4 illustrates the result of a set of measurements executed on a prototype system consisting of three VMEbus stations equipped with I/O modules. One station operates as the toroidal field processor, acquiring 192 analogue inputs, performing the 2D Fourier decomposition and sending the result to the other stations on fast ethernet. The other two stations operating as the MHD sector controllers acquire locally 128 channels each, perform the control algorithm and the 2D Fourier inverse decomposition. The system works as a two stage pipeline. The bars shown in figure are to scale with the measurements of the single activities. The latency time of the system is the sum of the time spent in the toroidal field processor and the MHD sector controller. In the figure the time needed for the control algorithm (not yet available) is estimated to be 60 s. The overall latency time turns out to be of the order of 300 s for the control of the MHD modes that is the most time critical real-time application in RFX. It is worth noting that data transfer is the most time consuming activity in the control cycle.
Fig. 4. Time diagram with system performance.
40
O. Barana et al. / Fusion Engineering and Design 71 (2004) 35–40
8. Status and future work A prototype of the control system is operational. Main functions, such as data read-out, real-time communication and reference generation are implemented and tested. The integration of the system in the MDSplus data acquisition system is straightforward, as MDSplus has been ported under VxWorks. Data available in the real-time control system can be exported through mdsip, the TCP/IP based protocol of MDSplus, and thus processed (acquired, stored, displayed) under MDSplus as any other RFX data. The commissioning of the power supply with the modified machine is scheduled for mid 2004, the operation with plasma for late 2004.
[4]
[5]
[6]
[7]
[8] [9] [10] [11]
References [1] P. Sonato, et al., Machine modification for active MHD control in RFX, Fusion Eng. Design 66–68 (2003) 161–168. [2] B. Alper, et al., RFP stability with a resistive shell in HBTX1C, Plasma Phys. Contr. Nucl. Fus. 31 (1989) 205–212. [3] J.A. Malmberg, P.R. Brunsell, Resistive wall instabilities and tearing mode dynamics in the EXTRAP T2R thin
[12]
[13]
[14]
shell reversed-field pinch, Phys. Plasmas 9 (2002) 212– 221. R. Paccagnella, Linear magnetohydrodynamic stability in reversed field pinch with distant and multiple resistive walls, Nucl. Fus. 38 (1998) 1067–1081. R. Piovan, V. Toigo, L. Zanotto, A new power supply scheme for the toroidal circuit of RFX, Fusion Eng. Design 58-59 (2001) 17–21. R. Bartiromo, et al., Tearing mode rotation by external field in a reversed field pinch, Phys. Rev. Lett. 83 (9) (1999) 1779–1783. A. Luchetta, G. Manduchi, et al., General architecture, implementation and performance of the digital feedback control in RFX, IEEE Trans. Nucl. Sci. 47 (2) (2000) 186– 191. http://www.simdtech.org/altivec. Motorola, MVME5100 series, www.mcg.motorola.com. D. Moulin, et al., The real time plasma control system of Tore Supra, Fusion Eng. Design 43 (1999) 371–376. R. Felton, et al., Real-time plasma control at Jet, using an ATM network, IEEE Trans. Nucl. Sci. 47 (2) (2000) 174–180. G. Raupp, et al., Integrating discharge control and data acquisition at ASDEX upgrade, Fusion Eng. Design 60 (2002) 353–359. H. Laqua, H. Niedermeyer, I. Willmann, Ethernet based real-time control bus, IEEE Trans. Nucl. Sci. 49 (2) (2002) 478–482. F.R.M. Barnes, et al., Testing ethernet networks for the ATLAS data collection system, IEEE Trans. Nucl. Sci. 49 (2) (2002) 516–520.