The COMPASS tokamak plasma control software performance

7
1490 IEEE TRANSACTIONS ON NUCLEAR SCIENCE, VOL. 58, NO. 4, AUGUST 2011 The COMPASS Tokamak Plasma Control Software Performance Daniel F. Valcárcel, André Neto, Ivo S. Carvalho, Bernardo B. Carvalho, Horácio Fernandes, Jorge Sousa, Filip Janky, Josef Havlicek, Radek Beno, Jan Horacek, Martin Hron, and Radomir Pánek Abstract—The COMPASS tokamak has began operation at the IPP Prague in December 2008. A new control system has been built using an ATCA-based real-time system developed at IST Lisbon. The control software is implemented on top of the MARTe real-time framework attaining control cycles as short as 50 s, with a jitter of less than 1 s. The controlled parameters, impor- tant for the plasma performance, are the plasma current, position of the plasma current center, boundary shape and horizontal and vertical velocities. These are divided in two control cycles: slow at 500 s and fast at 50 s. The project has two phases. First, the software implements a digital controller, similar to the analog one used during the COMPASS-D operation in Culham. In the slow cycle, the plasma current and position are measured and controlled with PID and feedforward controllers, respectively, the shaping magnetic field is preprogrammed. The vertical insta- bility and horizontal equilibrium are controlled with the faster 50- s cycle PID controllers. The second phase will implement a plasma-shape reconstruction algorithm and controller, aiming at optimized plasma performance. The system was designed to be as modular as possible by breaking the functional requirements of the control system into several independent and specialized modules. This splitting enabled tuning the execution of each system part and to use the modules in a variety of applications Manuscript received June 14, 2010; revised February 13, 2011; accepted April 07, 2011. Date of publication May 27, 2011; date of current version August 17, 2011. This work has been carried out within the framework of the Contracts of Association between the European Atomic Energy Community and ”Instituto Superior Técnico” (IST) and IPP.CR. IST was supported by ”Fundação para a Ciencia e Tecnologia” in the frame of the Contract of Associated Laboratory. The views and opinions expressed herein do not necessarily reflect those of the European Commission. The work at IPP.CR was supported in part by the Academy of Sciences of the Czech Republic IRP #AV0Z20430508 and in part by the Ministry of Education, Youth and Sports CR #7G09042. The work of J. Havlicek at the Faculty of Mathematics and Physics, Charles University was supported by Czech Science Foundation under Grant 202/08/H057. D. F. Valcárcel, A. Neto, I. S. Carvalho, B. B. Carvalho, H. Fer- nandes, and J. Sousa are with the Associação EURATOM/IST, Insti- tuto de Plasmas e Fusão Nuclear—Laboratório Associado, Instituto Superior Técnico, Lisbon P-1049-001, Portugal (e-mail: daniel.val- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]). F. Janky and J. Havlicek are with the Institute of Plasma Physics AS CR, v.v.i., Association EURATOM/IPP.CR, Za Slovankou 3, Prague 182 00, Czech Republic. They are also with the Department of Surface and Plasma Science, Faculty of Mathematics and Physics, Charles University, V Holesovickach 2, 180 00 Praha 8, Czech Republic (e-mail: fi[email protected]; havlicek@ipp. cas.cz). R. Beno is with the Department of Control Engineering, Faculty of Electrical Engineering, Czech Technical University, Technicka 2, 166 27 Prague 6, Czech Republic (e-mail: [email protected]). J. Horacek, M. Hron, and R. Pánek are with the Institute of Plasma Physics AS CR, v.v.i., Association EURATOM/IPP.CR, Za Slovankou 3, Prague 182 00, Czech Republic (e-mail: [email protected]; [email protected]; [email protected]). Color versions of one or more of the figures in this paper are available online at http://ieeexplore.ieee.org. Digital Object Identifier 10.1109/TNS.2011.2143726 with different time constraints. This paper presents the design and overall performance of the COMPASS control software. Index Terms—Control systems, data acquisition, real-time soft- ware systems. I. INTRODUCTION R EAL-TIME plasma control plays a very important role on modern tokamak devices for nuclear fusion studies. In particular, it is absolutely necessary on advanced plasma sce- narios [1]. COMPASS is a tokamak that was previously in operation in Culham (U.K.) and in 2008, moved and commissioned to IPP Prague (Czech Republic) [2]. Its scientific research programme involves ELM studies and physics of the pedestal in the H-mode. H-mode is a plasma regime where good confinement is achieved but which must satisfy a stringent set of conditions and physical requirements. In particular, for COMPASS, it must operate with a shaped and stabilized plasma [3]. Stability comes in two parts [4], the first is the stability re- lated to the plasma radial equilibrium and it is related to the fact that a current-carrying loop tends to naturally expand due to the self-repulsive force on the ring (hoop force). The second comes from the fact that a shaped plasma is always vertically un- stable due to the quadrupole magnetic-field configuration used for shaping. This means that any deviation from its equilibrium position will deviate it even further with an exponential growth rate, leading to the plasma crashing against the wall. Thus, very high temperature and electromagnetic loads are deposited onto the vessel and in-vessel components. These needs induced the design and development of portable control software, with the added requirement of being able to be reused on other machines. This project was done in two phases. In the first, the software implements plasma current and position feedback controllers, preprogrammed shaping field, and vertical stabilization and horizontal equilibrium feedback controllers. In the second phase, to obtain optimized plasma performance, a plasma shape reconstruction and controller are implemented. There are several platforms or customized solutions that could be used for these purposes. Traditionally, the solutions are based on implementations of the control software in digital signal processor (DSP) or field-programmable gate array (FPGA) components [5], [6]. Although this solution should perform better than a generic one running on a general-purpose processor (GPP), it is not easily portable to other tokamaks. Moreover, the development time is usually larger since the solution is not easily debuggable. 0018-9499/$26.00 © 2011 IEEE

Transcript of The COMPASS tokamak plasma control software performance

1490 IEEE TRANSACTIONS ON NUCLEAR SCIENCE, VOL. 58, NO. 4, AUGUST 2011

The COMPASS Tokamak PlasmaControl Software Performance

Daniel F. Valcárcel, André Neto, Ivo S. Carvalho, Bernardo B. Carvalho, Horácio Fernandes, Jorge Sousa,Filip Janky, Josef Havlicek, Radek Beno, Jan Horacek, Martin Hron, and Radomir Pánek

Abstract—The COMPASS tokamak has began operation at theIPP Prague in December 2008. A new control system has beenbuilt using an ATCA-based real-time system developed at ISTLisbon. The control software is implemented on top of the MARTereal-time framework attaining control cycles as short as 50 s,with a jitter of less than 1 s. The controlled parameters, impor-tant for the plasma performance, are the plasma current, positionof the plasma current center, boundary shape and horizontal andvertical velocities. These are divided in two control cycles: slowat 500 s and fast at 50 s. The project has two phases. First,the software implements a digital controller, similar to the analogone used during the COMPASS-D operation in Culham. In theslow cycle, the plasma current and position are measured andcontrolled with PID and feedforward controllers, respectively,the shaping magnetic field is preprogrammed. The vertical insta-bility and horizontal equilibrium are controlled with the faster50- s cycle PID controllers. The second phase will implement aplasma-shape reconstruction algorithm and controller, aiming atoptimized plasma performance. The system was designed to beas modular as possible by breaking the functional requirementsof the control system into several independent and specializedmodules. This splitting enabled tuning the execution of eachsystem part and to use the modules in a variety of applications

Manuscript received June 14, 2010; revised February 13, 2011; acceptedApril 07, 2011. Date of publication May 27, 2011; date of current versionAugust 17, 2011. This work has been carried out within the framework of theContracts of Association between the European Atomic Energy Communityand ”Instituto Superior Técnico” (IST) and IPP.CR. IST was supported by”Fundação para a Ciencia e Tecnologia” in the frame of the Contract ofAssociated Laboratory. The views and opinions expressed herein do notnecessarily reflect those of the European Commission. The work at IPP.CRwas supported in part by the Academy of Sciences of the Czech Republic IRP#AV0Z20430508 and in part by the Ministry of Education, Youth and SportsCR #7G09042. The work of J. Havlicek at the Faculty of Mathematics andPhysics, Charles University was supported by Czech Science Foundation underGrant 202/08/H057.

D. F. Valcárcel, A. Neto, I. S. Carvalho, B. B. Carvalho, H. Fer-nandes, and J. Sousa are with the Associação EURATOM/IST, Insti-tuto de Plasmas e Fusão Nuclear—Laboratório Associado, InstitutoSuperior Técnico, Lisbon P-1049-001, Portugal (e-mail: [email protected]; [email protected]; [email protected];[email protected]; [email protected]; [email protected]).

F. Janky and J. Havlicek are with the Institute of Plasma Physics AS CR,v.v.i., Association EURATOM/IPP.CR, Za Slovankou 3, Prague 182 00, CzechRepublic. They are also with the Department of Surface and Plasma Science,Faculty of Mathematics and Physics, Charles University, V Holesovickach 2,180 00 Praha 8, Czech Republic (e-mail: [email protected]; [email protected]).

R. Beno is with the Department of Control Engineering, Faculty of ElectricalEngineering, Czech Technical University, Technicka 2, 166 27 Prague 6, CzechRepublic (e-mail: [email protected]).

J. Horacek, M. Hron, and R. Pánek are with the Institute of Plasma PhysicsAS CR, v.v.i., Association EURATOM/IPP.CR, Za Slovankou 3, Prague182 00, Czech Republic (e-mail: [email protected]; [email protected];[email protected]).

Color versions of one or more of the figures in this paper are available onlineat http://ieeexplore.ieee.org.

Digital Object Identifier 10.1109/TNS.2011.2143726

with different time constraints. This paper presents the design andoverall performance of the COMPASS control software.

Index Terms—Control systems, data acquisition, real-time soft-ware systems.

I. INTRODUCTION

R EAL-TIME plasma control plays a very important roleon modern tokamak devices for nuclear fusion studies.

In particular, it is absolutely necessary on advanced plasma sce-narios [1].

COMPASS is a tokamak that was previously in operation inCulham (U.K.) and in 2008, moved and commissioned to IPPPrague (Czech Republic) [2]. Its scientific research programmeinvolves ELM studies and physics of the pedestal in the H-mode.

H-mode is a plasma regime where good confinement isachieved but which must satisfy a stringent set of conditionsand physical requirements. In particular, for COMPASS, itmust operate with a shaped and stabilized plasma [3].

Stability comes in two parts [4], the first is the stability re-lated to the plasma radial equilibrium and it is related to thefact that a current-carrying loop tends to naturally expand dueto the self-repulsive force on the ring (hoop force). The secondcomes from the fact that a shaped plasma is always vertically un-stable due to the quadrupole magnetic-field configuration usedfor shaping. This means that any deviation from its equilibriumposition will deviate it even further with an exponential growthrate, leading to the plasma crashing against the wall. Thus, veryhigh temperature and electromagnetic loads are deposited ontothe vessel and in-vessel components.

These needs induced the design and development of portablecontrol software, with the added requirement of being able to bereused on other machines. This project was done in two phases.In the first, the software implements plasma current and positionfeedback controllers, preprogrammed shaping field, and verticalstabilization and horizontal equilibrium feedback controllers. Inthe second phase, to obtain optimized plasma performance, aplasma shape reconstruction and controller are implemented.There are several platforms or customized solutions that couldbe used for these purposes.

Traditionally, the solutions are based on implementationsof the control software in digital signal processor (DSP) orfield-programmable gate array (FPGA) components [5], [6].Although this solution should perform better than a generic onerunning on a general-purpose processor (GPP), it is not easilyportable to other tokamaks. Moreover, the development time isusually larger since the solution is not easily debuggable.

0018-9499/$26.00 © 2011 IEEE

VALCÁRCEL et al.: THE COMPASS TOKAMAK PLASMA CONTROL SOFTWARE PERFORMANCE 1491

The DIII-D Plasma Control System [7] has already proven toact and control DIII-D in a 50- s timescale, but has the disad-vantage of not being introspectable or configurable during thereal-time phase. The system uses a customized Linux runningin several VME GPP personal-computer (PC) components; it isconfigured before the plasma discharge and when the dischargeexternal interrupts are disabled. This is a problem especially be-cause in very long discharges, such as in ITER [8], it is importantto drive the experiment in human timescales.

The GPP approach used on the JET vertical stabilizationsystem [9] is based on the MARTe software framework [10].It runs on a 50- s timescale and has shown good results inmitigating the plasma vertical instability [11]. MARTe is de-signed to run on a variety of operating systems (OS), suchas Linux, Linux-RTAI, Solaris, Microsoft Windows, and Vx-Works. For this reason, the developed applications are portableand development can be performed on a different OS, takingadvantage of existing debugging utilities. It is a multithreadedsoftware that greatly benefits from the current multicore pro-cessor technology and in the case of Linux, to attain real-timeperformances by using the kernel ability to isolate cores fordedicated tasks.

The MARTe workflow for the application developer is to de-sign and implement modules called generic application modules(GAMs). These execute sequentially in real-time threads andcan work together by exchanging signals. A particular MARTeapplication can have several threads, each running its own set ofGAMs. If they are designed as independent modules, they arealso reusable on different applications.

This paper describes the control software design, which usesthe MARTe framework and its performance results. Suggestionsfor the improvement of the software are given in the final sectionof this paper.

II. COMPASS PLASMA CONTROL

A. Description

Fig. 2 depicts the hardware installed for the control project.The main components are the actuator circuits along with theassociated power supplies, the magnetic sensors, and the analogintegrators and the processing module that it is shared with thedata-acquisition system.

COMPASS has a set of six circuits that generate the mag-netic fields to control the plasma. Table I summarizes the circuitsand the power supplies that drive them, and Fig. 1 shows theposition of the circuits (except the toroidal circuit) in a COM-PASS cross-section [12]. These are the toroidal field (TF), mag-netizing field (MF), equilibrium field (EF), shaping field (SF),as well as the radial (BR) and vertical (BV) fields driven by thefast amplifiers (BRPS and BVPS, respectively). The former aredriven by power supplies called TFPS, MFPS, EFPS, and SFPS,and this set is known as the energetic system.

The toroidal field (TF circuit) along with the poloidal fieldgenerated by the plasma current are responsible for plasma con-finement. The magnetizing field (MF circuit) on COMPASS hastwo purposes: the first is to induce the plasma breakdown andthe second is to drive the plasma current. The field generated

Fig. 1. Cross-section of COMPASS showing three slow circuits (magnetizing,equilibrium and shaping) and the two fast circuits (F). The toroidal circuit is notshown.

Fig. 2. COMPASS hardware setup for plasma magnetic control.

TABLE ICOMPASS MAGNETIC-FIELD GENERATING CIRCUITS AND THEIR

ASSOCIATED POWER SUPPLIES. THE ENERGETICS SYSTEM IS THE ONE

DRIVING THE SLOW POWER SUPPLIES AND EACH FAST AMPLIFIER

DRIVES THE FAST MAGNETIC FIELDS

by the currents in the EF and BV circuits is directed to the ver-tical direction and acts on the plasma radial position. The maindifference between the two circuits is on the power supplies thatdrive them. The EFPS is slower but stronger. The field producedby the SF circuit is one that acts on the plasma shape, changing

1492 IEEE TRANSACTIONS ON NUCLEAR SCIENCE, VOL. 58, NO. 4, AUGUST 2011

it from circular to a D-shape. Finally, the BR circuit generatesthe field important for shaped plasmas to control the verticalinstability.

The COMPASS data-acquisition and processing system [13]is based on PICMG 3.0 Advanced Telecommunications Com-puting Architecture (ATCA) standard and on multicore x86 pro-cessor technology [14].

The processing module was updated in early 2010 for a fasterprocessor and a more recent motherboard. The system usesan ASUS(R) motherboard with an Intel(R) Core(TM)2 QuadQ9550 processor at 2.83 GHz. To communicate with the powersupplies, a Lindy(R) PCI Quad RS-232 at 921.6-kbaud cardis used. The data-acquisition cards GPIO-MIMO-ISOL weredeveloped at Instituto Superior Técnico (IST) and each samples32 channels at 20 kSamples/s for real-time purposes [15]. TheMARTe real-time framework runs on the processing module ontop of the Linux operating system with kernel version 2.6.29.6and three isolated cores for real-time threads.

The sets of analog integrators are the original ones that wereinstalled at Culham along with COMPASS-D. They provideconfigurable integration gains and optional sum or subtractionof up to four integrated signals per integrator module. Theoutput signals of these analog integrators drift linearly andthese have to be removed before using the signals in real time.The integrators are reset electronically and restart drifting fromzero before each plasma discharge.

B. Plasma Current Control

The plasma current is induced on a tokamak plasma bytransformer effect. A primary winding driven by a currentgenerates the magnetic flux that links with the plasma, the sec-ondary of the transformer. is induced by a variable . Tocontrol the plasma current, a PID controller can be used, pro-viding the necessary variation . Since MFPS receives anactual current setpoint and not a current variation, this must becomputed by using (1) by measuring the actual current in theMF circuit

(1)

C. Equilibrium Control

The plasma radial equilibrium control must be divided in twocontributions since there are two sets of vertical field actuators(EF and BV). One needs to keep in mind that the EF currentevolves slower than the BV current but it generates a strongerfield.

Regarding the equilibrium problem, [16] shows that for a cir-cular and high aspect ratio plasma, (2) gives the vertical mag-netic field needed to balance the plasma hoop force

(2)

This expression has been shown to work relatively well forlow-aspect ratio tokamaks and even noncircular plasmas [4]. Itshows that the hoop-force depends on the plasma current ,the plasma radial position , and radius , internal inductance

, and poloidal beta . The plasma current, position, and radius

are easily measured during a discharge. The internal inductanceand poloidal beta are not so easily measurable but can be es-timated and assumed constant throughout the flat-top phase ofthe plasma discharge. In reality, they are not constant; however,this fact can be taken into account as a disturbance to the model[17].

Thus, it is natural to devise a control strategy where (2) pro-vides a feedforward model to drive the EF circuit, and the distur-bances are handled by the faster BV circuit driven by a feedbackPID control scheme.

D. Vertical Instability Control

For the vertical instability control, [18] shows that a PD reg-ulator suffices. Work has been done by modeling the COM-PASS vertical instability [19] where a PD regulator has beenused in the simulations. The growth rate of the instability [20]determines that the control loop must execute at least once each50 s.

E. Summary

In the first phase of the project, the planned control systemis similar to the one that was implemented at Culham. Thismeans independent controllers for the plasma current, radialequilibrium, and vertical instability. The TF and SF are bothprogrammed before the discharge starts. The MF for the plasmacurrent control is driven by a PI controller; for the radial equi-librium, the EF is driven by the feedforward model described inSection II-C and BV by a PI controller that measures the plasmaradial position. Finally, for the vertical instability control, theBR circuit is driven by a PD controller that measures the plasmavertical position.

The system requires two control cycles. One at 50 s forthe fast corrections, such as vertical instability and fast radialcorrections. The second at 500 s for the control of slow-varyingprocesses, such as the plasma current and radial equilibrium.Shaping control, which will be implemented in a second phase,belongs to the slow-varying processes class.

III. SOFTWARE LIBRARY

A. Description

The real-time software library was designed to fulfill theneeds described in Section II by implementing several inde-pendent modules. These can be classified as data-processingGAMs, input/output GAMs (IOGAMs), system-managementGAMs, and simulation GAMs.

Data-processing modules include PID control, waveformgeneration, signal offset, and drift removal, as well as mea-suring the plasma current and position.

The implemented IOGAMs are responsible for communi-cating with the power supplies.

The simulation GAMs are a set of modules developed to sim-ulate the working system. They test triggers and communicationwith the power supplies.

Finally, the system-management GAMs provide func-tionality, such as determining that a trigger signal arrived,communicating with the control and data acquisition system,or converting between different data types.

VALCÁRCEL et al.: THE COMPASS TOKAMAK PLASMA CONTROL SOFTWARE PERFORMANCE 1493

Fig. 3. Removal procedure in a real case. The ’Measured’ curve is the inte-grated signal of a Rogowski probe measuring the EFPS current. The “No Drift”curve is the same signal with drift and offset removed. A linear model fits thesamples removing the drift and the offset from 0.8 to 1.5 s. The parameters ofthe linear model are calculated from 0.5 to 0.8 s. At 0 s, TFPS starts rampingup the toroidal field and the other fields start only after 800 ms. At around 0.5s, the analog integrators are reset electronically and start drifting from zero (notshown).

All of these modules were designed, keeping in mind thatthe library should be portable for other applications, especiallyother machines. Thus, the number of COMPASS-specific mod-ules was kept to a minimum. Their design and code implemen-tation were optimized so that they run on the least time possible,enabling a greater application range. The most important mod-ules are detailed in the following sections.

B. Linear Drift and Offset Removal GAM

All measured integrated magnetic signals possess an integra-tion drift and an offset that need to be removed prior to the cal-culations. The drift is fairly linear on a millisecond timescalebut the slope of the drift is different between integrators and canchange on larger timescales.

The module required to eliminate the offset and drift of thesignals was designed to work on two time windows. The firstwindow is where it calculates the drift and the second is whereit effectively removes the drift. Usually, the first window isa few hundreds of milliseconds before the plasma discharge,and the removal starts a few milliseconds before and continuesthroughout the discharge.

The drift calculation procedure is illustrated in Fig. 3 wherea minimization procedure is used to fit a linear model

to the measured data [21]. This procedure must be doneon a time window where only linear drift exists. During the cal-culation window, the fitting parameters and are updated ateach iteration.

C. Waveform Generator GAM

To generate the required waveforms, such as the TF circuitcurrent reference, the WaveformGeneratorGAM was devel-oped. This module stores in memory an array of time-valuepairs that are reproduced at the correct instants. If the valuerequired is not stored in memory, then an interpolation usingthe two nearest points is used. The optimized search on thearray of pairs is done without looking up the past timestamp

values; this is implemented with a pointer to the most recentlyused point.

D. Plasma Current Calculator GAM

The plasma current is measured by using the integrated signalof a Rogowski coil. This signal is measured, and a calibrationfactor provides the scaling to obtain the plasma current.

E. Plasma Position Calculator GAM

The plasma position calculation algorithm is still in a testingphase and was tested to measure its execution time. As Sec-tion III-A shows, the algorithm executes fast enough to be usedon the 50- s control cycle.

This algorithm determines the plasma current center fromthe measurement of the integrated signal from four Mirnovprobes—one pair on the top/bottom and the other on thehigh-field side/low-field side of the poloidal cross section ofCOMPASS. For each pair, the ratio between both probes iscomputed. By simulation, it is possible to previously computea lookup table (LUT) and search in real time for the positiongiven the ratios.

The algorithm using the Mirnov probes shows reasonable of-fline results; however, there are two issues regarding the mea-surements. The first is that the Mirnov probe signal-to-noiseratio is smaller comparably to the one from internal partial Ro-gowski probes. The second is that using only four probes mightnot be enough since the set is not very sensitive to radial changesin position. Thus, a similar LUT algorithm is being studied anduses a set of more than four internal partial Rogowski probes.The description and results will be the subject of a future paper.

F. Control GAMs

This GAM, referred to as basic controller core GAM, wasdesigned with two features in mind. One is to simultaneouslyuse feedback control, and programmed outputs for the actuatorsand feedforward control. The second feature was that the basicfunctionality should be easily extendable, in the object orientedprogramming sense, to accommodate different solutions for dif-ferent applications. This GAM has three independent channelswhose outputs are summed to obtain the final result.

The first of these channels is the programmed channel thatstores a waveform with the desired output.

The feedback channel is a fully configurable PID controller. Itimplements the three terms controller with integral antiwindup,setpoint weighting, derivative kick limiter, and filtering.

The feedforward channel is not implemented in the basicfunctionality since feedforward is based on application-specificmodels. To implement specific behavior, the GAM must be sub-classed and the methods related to feedforward are overridden.All of the implemented basic functionality is inherited.

The plasma current controller GAM is a customized basiccontroller core GAM that implements (1) as custom function-ality to update the MF circuit current.

The plasma radial equilibrium controller GAM is a cus-tomized basic controller core GAM that implements thefeedforward model of (2) for the radial equilibrium. This GAMis still a work in progress.

1494 IEEE TRANSACTIONS ON NUCLEAR SCIENCE, VOL. 58, NO. 4, AUGUST 2011

Fig. 4. Software schematic illustrating the organization of the GAMs in the real-time threads (RTTh). There are two real-time threads (at the edges), one MARTethread (in the middle), and the GAMs execute sequentially from top to bottom on each thread. The dynamic data buffer (DDB) structure has the purpose of handlingdata transfer between GAMs.

G. Communication GAMs

This is a set of three GAMs—one that communicates withthe energetic system and the other two with the fast ampli-fier system. Both communication protocols are serial protocolstransmitting at 921.6 kbaud.

The 9-bit serial energetic system communicator GAM imple-ments cyclic redundancy check (CRC-3) generation and checksfor the transmitted and received messages, respectively.

The 8-bit serial fast amplifier communicator GAM doesnot implement CRC but instead uses a custom error checkingscheme coupled with parity checking. There is also an auxiliarythyristor module communicator GAM which turns ON andOFF a thyristor module powering the fast amplifiers and uses asimilar serial protocol.

H. Integration on the MARTe Framework

The integration on MARTe of the GAMs described for controlpurposes is depicted in Fig. 4. The system uses two real-timethreads to reflect the need for two control cycles. The fast loop

runs at 50 s and executes the code related to the fast control,the vertical stabilization, and the fast radial feedback control.The slow loop runs at 500 s and executes the code related tothe slow magnetic-field control.

Data are acquired from the analog channels on the fast loopat 20 kSamples/s and after the drifts and offsets removed, theplasma position is determined. The result of the calculation isused by two basic controller core GAMs to regulate the posi-tion. At the end of the loop, the acquired data and the plasmaposition are transferred to the slow loop. The ten samples ac-quired between consecutive slow loop cycles are filtered with afinite-impulse response filter and decimated.

On the other hand, after receiving the samples, the slow loopdetermines the plasma current. Following this, the waveformgenerator GAM outputs the currents for the TF and SF circuits.An instance of the plasma current controller GAM controls theplasma current with the MF, and the plasma radial equilibriumcontroller GAM provides the EF feedforward value. At the endof the loop, the energetic system communicator GAM sendsthe values of the four currents in the circuits. On this loop, the

VALCÁRCEL et al.: THE COMPASS TOKAMAK PLASMA CONTROL SOFTWARE PERFORMANCE 1495

TABLE IIMEASURED EXECUTION TIME FOR EACH GAM

Fig. 5. The 500-�s cycle time measurement histogram that shows low jittercompared to the cycle time 500.06�0.845 �s.

thyristor module communicator GAM turns the module ON be-fore the discharge and turns it off after the discharge. Thus, itis not necessary to be in the same thread as the fast amplifiercommunicator GAMs.

At the end of both loops, the DataCollection GAM and theWebstatistic GAM, both reused from the JET library, providedata storage and statistics. Auxiliary GAMs also take part onboth loops.

I. Results

Table II shows the execution times for each GAM, includingthe GAMs used from the JET library, DataCollectionGAM andWebstatisticGAM. Observation of the measured timings showsthat more time is spent on communications with the actuators.This time information is used to determine how long the exe-cution of the code in Fig. 4 takes, considering that all of thecontroller GAMs take the same time to execute. The code in the50- s thread takes 29.045 5.290 s to execute, and the code in

Fig. 6. The 50-�s cycle time measurement histogram which shows reasonablylow jitter compared to the cycle time 49.997 �0.907 �s.

Fig. 7. MFPS current driven by the real-time system. The field generated bythis circuit is responsible for the plasma breakdown at around 0.95 s and fordriving the plasma current after that.

500 s takes 94.371 3.757 s, both below the thread execu-tion time, even considering the associated jitter.

Figs. 5 and 6 show the histogram of the measured cycle timeof the 500 s and 50- s threads, respectively. These cycle timeswere measured to be 500.06 0.845 s and 49.997 0.907 s.From the plots, it can be seen that the jitter in both measurementsis low compared to the respective cycle time.

The experimental tests with COMPASS so far were to drivecurrent on TFPS, MFPS, EFPS, and SFPS during several plasmadischarges. The results for discharge #1155 are presented. Thetoroidal and shaping fields are not shown, as the shaping field iszero on a circular-shape plasma and the toroidal field is constantand of little interest for the discharge. Figs. 7 and 8 show theMFPS and EFPS currents on the circuits. It can be seen that thepower supplies follow the requests.

IV. FINAL REMARKS

The system developed complies with the real-time specifica-tions, and the preliminary tests performed show that the cur-

1496 IEEE TRANSACTIONS ON NUCLEAR SCIENCE, VOL. 58, NO. 4, AUGUST 2011

Fig. 8. EFPS current driven by the real-time system. The field generated by thiscircuit is responsible for the equilibrium of the radial plasma movements. Thepeaks seen after 0.95 s are caused by the large derivative in the MFPS current,as the MF circuit is inductively coupled with the EF circuit.

rent actuators can follow the reference signals provided by thesystem. The following steps in the testing phase are to test thefull current and position feedback, first in a circular plasmawithout vertical instability and afterward in a preprogrammed-shaped plasma introducing vertical stabilization.

Regarding the execution time of all the GAMs in the real-timethreads, in Section III-A, it was shown that in each thread, evenwith the total jitter, the execution time of all GAMs was less thanthe thread cycle time. The case of the 50- s thread is the mostcritical since the jitter of both the thread cycle (in percentage)and the total GAM execution is larger. Nevertheless, if the needarises, it should be possible to reduce the jitter by executing thecontrol code in kernel space RTAI, the solution adopted by JET.

As pointed out in Section II-C, the plasma behavior is in-fluenced by disturbances, such as variations of or . Sincethese disturbances are unavoidable, it is also necessary to con-trol the plasma boundary shape. For this purpose, two things areneeded: 1) a plasma boundary reconstruction scheme and 2) amultiple-input single-output boundary controller.

Several boundary reconstruction codes are available; amongthem, there is rtEFIT [22] and XLOC [23]. Since we are inter-ested only in the boundary reconstruction and there is alreadyan implementation of XLOC for MARTe, Felix [24], this is themost promising candidate.

Typically, the control scheme for the plasma shape is basedon approaches, such as controlling gaps or the magnetic flux onthe boundary [17]. The gap approach involves controlling theshape, ensuring constant distances (gaps) to reference positions(usually the wall). The latter approach means controlling thepoloidal flux on predefined points of the boundary, and it is usedin tokamaks, such as TCV [25].

It is straightforward to integrate this solution in the alreadydeveloped scheme. In the 500- s real-time thread, the Felix

GAM must be included after the plasma current calculation, andthe shape controller receives the result in the form of the shapedescriptors.

REFERENCES

[1] J. B. Lister, “The evolution of feedback control in tokamaks,” presentedat the ICALEPCS2003, Gyeongju, Korea.

[2] R. Pánek et al., “Reinstallation of the COMPASS-D tokamak in IPPASCR,” Czechoslovak J, Phys., vol. 56, 2006.

[3] S. J. Fielding et al., “The H-mode in COMPASS-D,” Plasma Phys.Controlled Fusion, vol. 38, pp. 1091–1102, 1996.

[4] R. Albanese and G. Ambrosino, “Current, position and shape control oftokamak plasmas: a literature review,” presented at the IEEE Int. Conf.Control App., Anchorage, AK, Sep. 25–27, 2000.

[5] D. F. Valcárcel et al., “Fast feedback control for plasma positioningwith a PCI hybrid DSP/FPGA board,” IEEE Trans. Nucl. Sci., vol. 53,no. 3, pp. 838–844, Jun. 2006.

[6] A. P. Rodrigues, L. Pereira, J.-M. Moret, B. P. Duval, and C. A. F.Varandas, “Real-time data transfer in the TCV advanced plasma controlsystem,” Fusion Eng. Design 81, no. 15-17, pp. 1939–1943, Jul. 2006.

[7] B. G. Penaflor, J. R. Ferron, R. D. Johnson, and D. A. Piglowski,“Current status of the upgraded DIII-D real-time digital plasma controlsystem,” Fusion Eng. Design, vol. 71, pp. 47–52, 2004.

[8] R. Aymar, P. Barabaschi, and Y. Shimomura, “The ITER design,”Plasma Phys. Controlled Fusion, vol. 44, p. 519, 2002.

[9] F. Sartori et al., “The JET PCU project: An international plasma controlproject,” Fusion Eng. Design, vol. 83, no. 2-3, pp. 202–206, Apr. 2008.

[10] A. Neto et al., “MARTe: A multi-platform real-time framework,” IEEETrans. Nucl. Sci., vol. 57, no. 2, pp. 479–486, Apr. 2010.

[11] F. Sartori et al., “The PCU JET plasma vertical stabilisation controlsystem,” Fusion Eng. Design, vol. 85, no. 3-4, pp. 438–442, Jul. 2010.

[12] Application for Preferential support for enabling a programme of ITERrelevant plasma studies by transferring and installing COMPASS-D tothe Inst. Plasma Phys. AS CR Assoc. EURATOM-IPP.CR, Inst. PlasmaPhys. AS CR, v.v.i. Prague, Czech Republic, 2006.

[13] D. F. Valcárcel et al., “An ATCA embedded data acquisition and con-trol system for the compass tokamak,” Fusion Eng. Design, vol. 84, no.7-11, pp. 1901–1904, 2009.

[14] A. J. N. Batista, J. Sousa, and C. A. F. Varandas, “ATCA digital con-troller hardware for vertical stabilization of plasmas in tokamaks,” Rev.Sci. Instrum., vol. 77, no. 10F527, pp. 1–3, 2006.

[15] D. F. Valcárcel et al., “Real-time software for the COMPASS tokamakplasma control,” Fusion Eng. Design, vol. 85, no. 3-4, pp. 470–473,Jul. 2010.

[16] V. S. Mukhovatov and V. D. Shafranov, “Plasma equilibrium in atokamak,” Nucl. Fusion, vol. 11, pp. 605–633, Dec. 1971.

[17] G. Ambrosino and R. Albanese, “Magnetic control of plasma current,position and shape in tokamaks: a survey or modeling and shape intokamaks,” IEEE Control Syst. Mag., vol. 25, no. 5, pp. 76–92, Oct.2005.

[18] E. A. Lazarus, J. B. Lister, and G. H. Nielsen, “Control of the ver-tical instability in tokamaks,” Nucl. Fusion, vol. 30, no. 1, pp. 111–141,1990.

[19] R. Beno, “Modeling of the plasma position control in the COMPASSTokamak,” B.Sc. degree, Dept. Control Eng. (Faculty of Elect. Eng.),Czech Technical Univ., Prague, Czech Republic, 2008.

[20] P. Vyas, “Plasma Vertical Position Control on COMPASS-D,” Ph.D.dissertation, Dept. Eng. Sci., Oxford Univ, Oxford, U.K, 1996.

[21] W. H. Press et al., Numerical Recipes in C: The Art of Scientific Com-puting, 2nd ed. Cambridge, U.K.: Cambridge Univ. Press, 1992.

[22] J. R. Ferron et al., “Real time equilibrium reconstruction for tokamakdischarge control,” Nucl. Fusion, vol. 38, no. 7, pp. 1055–1066, 1998.

[23] D. P. O’Brien et al., “Local expansion method for fast plasma boundaryidentification in JET,” Nucl. Fusion, vol. 33, no. 3, pp. 467–474, 1993.

[24] L. Zabeo, G. Artaserse, A. Cenedese, F. Piccolo, and F. Sartori, “Anew approach to the solution of the vacuum magnetic problem in fusionmachines,” Fusion Eng. Design, vol. 82, pp. 1081–1088, 2007.

[25] J. B. Lister et al., “The control of tokamak configuration variableplasmas,” Fusion Technol., vol. 32, p. 321, 1997.