Università degli Studi di Roma Tor Vergata Facoltà di Ingegneria Dottorato di Ricerca in Informatica ed Ingegneria dell Automazione XXIV Ciclo del Corso di Dottorato Real-time control solutions for plasma control problems in Tokamak experiments Riccardo Vitelli A.A. 2010/2011 Relatore: Prof. Luca Zaccarian
Alla mia famiglia Agli amici
Acknowledgements This work couldn t have been carried out without the support of many people who helped me with their knowledge, their time and, most important, their friendship. Starting from my tutor, Prof. Luca Zaccarian, who introduced me to the world of Tokamaks and Nuclear Fusion during my degree thesis, and supported me since then up to the Laurea Specialistica (master degree) and now the doctorate. Then I d like to thank the whole PPCC Team at the JET, which guided me during my master degree thesis and with which I still have the pleasure to work. Dr. Filippo Sartori, Dr. André Neto, Dr. Luca Zabeo, Dr. Fabio Piccolo, Dr. Katiuscia Zedda, thank you very much for all that you have done for me. Together with the JET staff, I d like to thank the CREATE people, in particular Dr. Gianmaria De Tommasi, Prof. Vincenzo Coccorese, Prof. Giuseppe Ambrosino, Prof. Alfredo Pironti and Prof. Raffaele Albanese, who made the whole JET experience possible. A special thank you goes to Dr. Teresa Bellizio, with whom I had the pleasure to work, and to the other italians that were working at the JET: Dr. Carmelenzo Labate, Dr. Antonio Barbalace and Dr. Massimo Camplani. Last but not least I want to thank my family, which has always been so supportive, expecially during the long periods I was far from home. I
Contents 1 Introduction 1 2 Tokamaks and Nuclear Fusion 3 2.1 Nuclear fusion.......................... 3 2.1.1 Plasma and confinement................ 4 2.2 Tokamaks............................ 6 2.3 The state of the art: the JET................. 8 2.4 The Road Ahead: ITER and DEMO............. 9 3 Plasma control problems and solutions 11 3.1 The Vertical Stabilisation................... 11 3.1.1 The Vertical Instability problem........... 11 3.1.2 The JET Vertical Stabilization system........ 14 3.1.2.1 Estimation of the vertical plasma velocity. 16 3.1.2.2 JET s Vertical Stabilisation and ELM pacing 23 3.2 Plasma shape and position control.............. 25 3.2.1 JET Shape Control................... 25 3.2.1.1 XSC: extreme Shape Controller...... 28 3.2.1.2 CLA: Current Limit Avoidance....... 30 3.3 Power supplies related problems................ 37 3.3.1 Induced plasma oscillations: the AL-F amplifier... 37 3.3.1.1 Model of the AL-F feedback........ 41 CONTENTS II
CONTENTS 3.3.1.2 Anti-windup solution............ 51 3.3.2 The JET EFCC Coils control system......... 58 4 Technical solutions and implementation 61 4.1 The MARTe Framework.................... 61 4.1.1 The BaseLib2...................... 62 4.1.2 Multithreaded Application Realtime executor (MARTe) 67 4.1.2.1 Generic Application Module........ 67 4.1.3 Code generation via SysML.............. 75 4.1.3.1 Sample application to the FTU Tokamak. 82 4.2 The JET systems........................ 87 4.2.1 The Vertical Stabilisation system........... 87 4.2.1.1 The Vertical Stabilization hardware.... 88 4.2.1.2 Interfacing with JET............ 90 4.2.1.3 Vertical Stabilization GAMs........ 91 4.2.1.4 User Interface................ 100 4.2.1.5 First Results................. 102 4.3 The new FTU Feedback System................ 106 4.3.1 Experimental results.................. 107 5 Conclusions and future work 113 Bibliography 115 List of Figures 126 List of Acronyms 131 CONTENTS III
Chapter 1 Introduction The energy problem is one of the greatest challenges mankind will have to face in the following years. The progressive depleting of fossil fuels, the necessity of cleaner ways to produce energy and the growing demand for electrical power from developing countries, will force humanity to invest more and more in the research for alternative power sources. While renewable power sources, such as photovoltaic and wind, don t provide the required reliability, nuclear fission can t be seen as a long-term solution to the power generation problem due to the production of long lived radioactive waste. In this framework, nuclear fusion is becoming more and more considered as the most probable solution to the energy problem due to the short life of the nuclear waste produced, as well as the huge availability of fuel, namely deuterium (present in big quantities in salt water) and tritium (that can easily be bred from lithium, which makes up the vast majority of Earth s crust, directly in the blanket of a Tokamak [1]). The trait d union of this Thesis is fusion technology, particularly related to control systems for Tokamaks device. After a brief introduction on the experimental devices and on fusion in general, some of the main problems 1
1 Introduction related to the magnetic control of nuclear fusion experiments (particularly the vertical stabilization problem [2] and the plasma shape control [3]), together with their control solutions are reported. Finally the implementation of the aforementioned solutions is illustrated, in particular concerning the development carried on the MARTe Framework [4]. 2
Chapter 2 Tokamaks and Nuclear Fusion 2.1 Nuclear fusion Nuclear fusion is the basic form of energy production in the stars. It is a process in which atomic nuclei join to form an heavier atom whose mass is less than the sum of the masses of the reactants [5, 6]. This reduction of mass leads to the production of large amounts of energy following the famous Einstein equation E = mc 2. Of the various known fusion reactions, the most promising one uses two hydrogen isotopes, deuterium and tritium, which result in the reaction: 2 1D + 3 1T 4 2He(3.5MeV ) + n(14.1mev ) The D-T reaction has been chosen as the most promising one as it is a good compromise between energy produced, large cross section (from which depends the likelihood of interactions) and, above everything, the availability of both isotopes on Earth. An important law for nuclear reactions is the Lawson Criterion [7] 3
2 Tokamaks and Nuclear Fusion 2.1 Nuclear fusion (also known as triple product ), which defines the conditions needed to reach ignition, that is when the heating generated by the nuclear reaction is capable of maintaining the temperature of the plasma against all losses or, in other words, of keeping the nuclear reaction going on theoretically forever while confined. In the case of the D-T reaction the Lawson Criterion states that: nt τ E 10 21 kev s 1 m 3 (2.1) where n is the plasma density, T the plasma temperature and τ E the confinement time. The Lawson Criterion basically states that ignition conditions can be achieved either by dense plasmas with low τ E or by less dense plasmas with an higher τ E. Directly derived from the Lawson Criterion, the Fusion Energy Gain Factor Q is defined as the ratio between generated fusion power and power used for plasma heating. Ignition is when Q =, however a value of Q in the order of 20 is considered enough for a practical reactor. The particular condition of Q = 1 is called breakeven and reaching it is considered as a sort of milestone in the fusion power research field. Currently the largest Q factor obtained on Earth is 0.61 registered at the JET Tokamak in 1997. 2.1.1 Plasma and confinement At the high temperatures needed for fusion reactions to happen, matter is subject to another change of state becoming plasma. In a plasma the electrostatic forces which bind electrons and nuclei are overcome as they become two distinct populations of negatively charged electrons and positively charged ions. This gives to plasma the important property of being capable of conducting currents and reacting to magnetic fields, which is of paramount importance in the development of magnetic confinement fusion device as it will be shown later. 4
2 Tokamaks and Nuclear Fusion 2.1 Nuclear fusion Burning plasmas in fusion research are usually macroscopically studied by means of the MagnetoHydroDynamics (MHD) equations [5]. This discipline, initiated by Alfvén in 1942 [8], studies the dynamics of conducting fluids under the action of magnetic fields. Plasmas, due to their aforementioned properties, fit perfectly in this category. MHD equations consists fundamentally of a combination of the Navier- Stokes equations of fluid dynamics, together with Maxwell s equations of electromagnetism: the basic idea is to model in this way the dynamics of the magnetic fields due to the action-reaction of conductiong fluids. A simplified explanation of the ideal MHD equations for plama modeling can be found in [9]. The Lawson Criterion (2.1) basically states that in order to achieve steady-state operations, a fusion machine should achieve high plasma densities (n) and temperatures (T ) for enough time (τ E ). In stars due to their immense mass, the gravitational force is capable of confining the plasma long enough to achieve fusion reactions. This kind of gravitational confinement, however, is unthinkable to be obtained on Earth. Two main approaches have so arisen to confine plasma: inertial confinement and magnetic confinement. In the former approach a small pellet of D-T fuel is bombarded by high-power laser causing it to explode, so creating very high density plasmas for few nanoseconds 1. The latter approach is more widespread and uses lower density gaseous fuel but with longer τ E by constraining the plasma via magnetic fields. Tokamak devices are the most common form of magnetic confinement devices. 1 In the USA this approach to nuclear fusion is being carried out in the National Ignition Facility (NIF) at the Lawrence Livermore National Laboratory in Livermore, California. 5
2 Tokamaks and Nuclear Fusion 2.2 Tokamaks 2.2 Tokamaks A Tokamak (Russian acronym for toroidalnaya kamera i magnitnaya katiushka, toroidal chamber and magnetic coil ) is a fusion device that uses strong magnetic fields to confine the plasma within a vacuum vessel with a toroidal shape. The first Tokamaks were first developed in the former Soviet Union in the 60s [5]. Inner Poloidal Field Coils (Primary winding) Transformer Limbs Mechanical Structure Vacuum Vessel Toroidal Field Coils JG98.356/24c Outer Poloidal Field Coils Figure 2.1: Structure and scale of a Tokamak: the JET (Joint European Torus). In Tokamaks the plasma is confined in a vacuum vessel (or chamber) by means of a set of toroidal field (TF) coils, while poloidal field (PF) coils permit a precise shaping and positioning of the plasma, as well as the induction of a current in the plasma via transformer effect (central solenoid), and the stabilization of vertical instabilities in case of elongated plasmas. In Figure 2.1 the standard structure of a Tokamak device is reported. 6
2 Tokamaks and Nuclear Fusion 2.2 Tokamaks Being gaseous, it is not possible to define a precise position and shape for the plasma. However the plasma border is usually considered coincident with the LCMS (Last Closed Magnetic Surface), i.e. the last magnetic surface which doesn t intersect any physical object (in case of limiter configuration), or on which lies the X-point 2 for a divertor configuration (separatrix). In Figure 2.2 the differences between a limiter and a divertor plasma is shown. Figure 2.2: Differences between a limiter and a divertor plasma (JET predivertor and JET as of today). One of the major advantages of the divertor configuration plasmas is the mitigation of the sputtering or melting of material from the limiters to inside the plasma, as impurities in the plasma tend to dilute the fuel and generate radiation losses [5]. Moreover it has been shown that the presence of an X-point greatly helps in reaching high confinement modes (H-mode), thus improving fusion performances [10]. 2 The X-point is a point at which the poloidal magnetic field is zero. 7
2 Tokamaks and Nuclear Fusion 2.3 The state of the art: the JET In a Tokamak device plasma is heated partially via the Joule effect due to the plasma current (ohmic heating). However as the resistivity of the plasma falls sharply with the increase of temperature, additional external heating system are needed, such as Neutral Beam Injection (NBI), which uses beams of accelerated ions to move energy to the plasma; Ion Cyclotron Resonant Heating (ICRH), which heats the plasma through radio waves resonating with the plasma ion rotation; Lower Hybrid Current Drive (LHCD) which uses microwaves with several MW of power at frequencies in the range of 1-5 GHz accelerate the plasma electrons. 2.3 The state of the art: the JET The Joint European Torus (JET) is the world s largest Tokamak [11]. It has a major radius R 0 = 2.96m, minor radius a = 0.96m, elongation k 1.6, plasma current I p < 6MA and a toroidal field B t < 4T and is equipped with several additional heating systems, which enable the injection of large amounts of external power into the plasma. The ICRH has 32M W of installed power, while the LHCD system is able to provide 12M W, for 20s, at the generator source. After the 2010 upgrades, the neutral beam injector (NBI) is able to provide up 34MW of power for a maximum of 20s. Moreover, the ICRH and NBI can also be used to produce non-inductive current drive. The NBI system has also the ability of generating toroidal angular momentum, a very important feature for the overall MHD stability of the plasma. An overview of JET, together with its scale, is shown in Figure 2.1. Although JET was not initially designed to operate with a divertor, new scientific results, in particular the discovery of the high confinement mode in ASDEX-Upgrade, lead to a major upgrade of JET and the consequent installation of a divertor system. The latest version of the JET divertor is known as mark-ii and is depicted in Figure 2.3. For an overview of the JET results see [12]. 8
2 Tokamaks and Nuclear Fusion 2.4 The Road Ahead: ITER and DEMO Divertor tiles Coils JG00.47/32c Cryopump Figure 2.3: Structure of the JET Tokamak divertor region. 2.4 The Road Ahead: ITER and DEMO ITER (International Thermonuclear Experimental Reactor) is the next step in the race towards power production from nuclear fusion [13, 14, 15]. ITER will become the world s largest Tokamak device, built by seven cooperating members (the European Union, India, Japan, People s Republic of China, Russia, South Korea and USA), and will be hosted in Cadarache, France. Figure 2.4: 3D model of the ITER Tokamak. It has been designed to reach a Q factor of up to 10 (500MW output with 50MW of input power), and is intended to study plasmas after the 9
2 Tokamaks and Nuclear Fusion 2.4 The Road Ahead: ITER and DEMO breakeven threshold. A plasma pulse in ITER should last up to 480 seconds (roughly an order of magnitude more than in JET). Construction of the site begun in 2007, and the first plasma is planned in 2019. ITER is planned to be built by outsourcing the design and construction phase as much as possible, in order to develop industrial interest in nuclear fusion energy production. DEMO (DEMOnstration Plant) [16, 17] is intended to build on the success of ITER the first real fusion power plant. The envisaged goal of DEMO is to produce at least 2000MW of electrical power on a continual basis. To achieve this goal DEMO should be at least a 15% bigger than ITER and with an higher plasma density. However a success of ITER is considered more than enough to proceed with the development of DEMO, which, if everything proceeds on schedule, should be ready by 2033. 10
Chapter 3 Plasma control problems and solutions 3.1 The Vertical Stabilisation 3.1.1 The Vertical Instability problem Non-circular, elongated plasmas have naturally considerable advantages regarding confinement, achievable pressure and space utilisation 1. However elongated plasmas suffer from a natural fast vertical instability which requires closed-loop feedback control, without which no experiment could be carried out. This instability can be explained in a simplified way by considering Figure 3.1, which depicts the vertical instability problem in the JET Tokamak. In JET the plasma is elongated via two iron bar in which reflected currents due to the plasma current flow (iron polar expansions in the Figure). The vertical force generated on the plasma is inversely proportional to the distance. Assuming the current flowing in the two polar expansions identical, 1 Vacuum chambers, in fact, need to have a vertically elongated shape in order to have a big enough support structure to whitstand the enormous vertical forces due to disruptions. 11
3 Plasma control problems and solutions 3.1 The Vertical Stabilisation the upwards and downwards forces are in equilibrium. However it is evident that the centre of the chamber is an unstable equilibrium point, and so even a small perturbation δ from it will lead the plasma to hit the upper or lower part of the chamber. The inverse of the time in which the plasma hits the superior or inferior wall when not stabilized is called growth rate γ. Figure 3.1: The mechanism of plasma elongation and resulting vertical instability. The iron polar expansions (shoes), colored in purple, are the main reason for the natural elongation of JET plasmas. Different plasma elongation can be obtained by adjusting the currents in the shaping circuit (blue) and PFX circuit (yellow). The vessel (green) provides some passive stabilization, and the RFA circuit (red) is the actuator for active stabilization. It is possible to estimate the growth rate by using a simplified model of 12
3 Plasma control problems and solutions 3.1 The Vertical Stabilisation the vertical instability called rigid displacement model. In this model the plasma is represented by one or more rigid filaments in which a constant current flows. Those filaments are considered as having a single degree of freedom, i.e. the vertical position of their current centroid. Combining the equations of the poloidal circuits and passive structures with the force balance equation, it is possible to obtain [2]: ( ψ I(t), zp (t)) + RI(t) = u(t) (3.1) ( ) m p z p (t) = 2πr p B r I(t), zp (t) I p where ψ is the flux through circuits, passive structures and plasma filaments; R is the resistance matrix; I is the vector of the poloidal field currents and u are the tensions applied to the various circuits (zero for the passive structures); m p, z p and r p represent mass, vertical and radial position of the plasma; I p is the plasma current and B r the magnetic field on the plasma. The model can be then linearized: ψ I δ ψ I + δż p + RδI z = δ u(t) p ( B m p δ z p = 2πr r p I δ I + B ) r δz p I p z p Substituting then for simplicity sake the following: ( 2πr ) B r p I ψ I = L ψ M = I p z p z p ( ) ( M T.= = I p g T 2πr p z p B r z p ). = g = F (3.2) 13
3 Plasma control problems and solutions 3.1 The Vertical Stabilisation where L and M are the matrices of the mutual inductance between the circuits and between the circuits and the plasma, and F the force, the model becomes: Lδ I + gδżp + Rδ I = δ u(t) m p δ z p = g T δ I + F δz p (3.3) Neglecting the plasma mass (m p = 0), (3.3) becomes: (L g gt F ) δ I + Rδ I = δ u (3.4) from which it is possible to evaluate the growth rate [2] by analyzing the eigenvalues with real part greater than zero of: (L g ) 1 gt R F In JET the growth rate can be estimated to be in the order of magnitude of 10 2 10 3 s 1. 3.1.2 The JET Vertical Stabilization system In JET the vertical stabilization system is made by two different control loops (Figure 3.2): a velocity loop which tries to regulate to zero the vertical velocity of the plasma (thus halting its vertical movement) and a slower current loop which regulates the current in the vertical amplifier ERFA to a set point value (usually zero). While the two control loops may seem at a first sight in opposition, actually, when considering the presence of a shape controller system which will slowly reshape the plasma in the desired position, their objective is easier to understand: the velocity loop reacts rapidly to unwanted vertical movements by unbalancing the radial field, while the slower current loops tries to recover the normal operating 14
3 Plasma control problems and solutions 3.1 The Vertical Stabilisation mode. Adaptive controller v est Figure 3.2: The JET Vertical Stabilisation controller. The velocity loop is a simple proportional controller: V ref (t) = G V (t) v est (t) (3.5) where V ref (t) is the control voltage component for the ERFA amplifier due to the velocity loop, G V (t) is the proportional gain and v est (t) the estimation of the plasma centroid vertical velocity. The current loop is instead a PI controller: t I ref (t) = G I (t) (e IERF A (t) + K I e IERF A (t)dt) (3.6) where I ref (t) is the control voltage component for the ERFA amplifier due to the current loop, G I (t) is the current loop gain, K I is the integral gain and e IERF A (t) is the current error measured. Notice that the gains G V (t) and G I (t) of the two controllers are time varying. They are computed by an adaptive controller whose aim is to change the gains (within certain thresholds) depending on the ERFA am- 0 15
3 Plasma control problems and solutions 3.1 The Vertical Stabilisation plifier switching frequency, whose temperature is directly correlated to. In fact, should the temperature raise above a certain threshold, the amplifier could switch off causing a loss of control. The gain of the velocity loop G v (t) is computed as: t G v (t) = G v,f F (t) + G A (f ref f sw (t))dt (3.7) where G v,f F (t) is a feedforward component (baseline gain for the velocity loop), G A is an adaptation gain, f ref is a reference switching frequency (manually tuned to safe values) and f sw (t) is the ERFA switching frequency, measured as the number of times the amplifier voltage crosses zero. The gain of the current loop is proportional to the velocity one: 0 G I (t) = G I,F F (t) + KG v (t) (3.8) where G I,F F (t) is a feedforward component and K is a gain. 3.1.2.1 Estimation of the vertical plasma velocity One of the most critical parts of JET Vertical Stabilisation system is the evaluation of the plasma vertical velocity. Due to the small required cycle time it is not possible to run full shape reconstruction algorithms in real time, so it is necessary to obtain an estimation of the required measure by using the various magnetic signals coming from the Tokamak. In particular at JET these measures are provided by different type of probes situated in different poloidal, radial and toroidal locations. The Internal Discrete Coils (IDC, also known as Mirnov coils, Figure 3.3) have a 3dB cut-off frequency of 10kHz. IDC provide a direct flux measurement of the tangential component of the poloidal magnetic field. Each of the JET octants 2 contains 18 IDC coils, so that eight different measurements, in the 2 The JET machine is commonly subdivided in eight sectors, called octants, in the toroidal direction. 16
3 Plasma control problems and solutions 3.1 The Vertical Stabilisation same poloidal position, are available at eight different toroidal positions. In Figure 3.4 the position of the IDC in the JET Tokamak is reported. Figure 3.3: Photo of an internal discrete coil. The normal component of the poloidal magnetic field is measured instead by the saddle coils, 3.2mm diameter cables shaped to form a rectangular loop and mounted outside the vessel. Each octant has 14 saddle coils installed. Figure 3.5 shows the positions of IDCs and saddle coils in a single octant. The estimation of the vertical velocity is carried out by using a technique elaborated by Zakharov [18], which relates the vertical position of the plasma centroid z c (scaled by the concatenated toroidal current I Φ ) with the measures of the tangential (B t ) and normal (B n ) components of the magnetic field around a closed curve l. Zakharov equation is reported in (3.9), where r and z represent the radial and vertical coordinates. I Φ z c = 1 µ l [ ( ) ] r B t (r, z)z r log B n (r, z) dl (3.9) R 0 By deriving (3.9), making l coincide with the JET s vacuum vessel and taking into account the fact that the magnetic field can be measured only in certain discrete position along the chamber (where the sensors are placed), it is possible to rewrite the Zakharov equation as: 17
3 Plasma control problems and solutions 3.1 The Vertical Stabilisation Figure 3.4: Position of the magnetic sensors in the JET Tokamak. 18 14 I p ż p = a i Ḃ t (i) + b i Ḃ n (i) I p z p I pass z pass (3.10) i=1 i=1 where I pass z pass is relative to the passive structures, and a i and b i are weights obtained by solving (3.9) in the locations where the sensors are placed. For the JET the 18 weights of the Mirnov coils and the 14 ones for the saddle loops are reported in Figure 3.6 [2]. In Figure 3.7 a sample of the signals of the JET Vertical Stabilization system is reported (pulse #79632 3 ). The top plot shows the control action of the feedback (voltage applied to the coil), while the bottom one, VSEL, shows the estimation (weighted by the plasma current) of the verti- 3 All signals acquired during each JET experiment are archived sequentially in a database since the beginning of operations. 18
3 Plasma control problems and solutions 3.1 The Vertical Stabilisation Figure 3.5: Position of the saddle coils in the JET Tokamak. cal velocity of the plasma. The middle plot reports IFRFA, i.e. the current flowing in the vertical stabilization coils. This burst behavior is common in the operation of the vertical stabilization system and is due to the fast dynamics of the system which has to keep the plasma centroid near to the unstable equilibrium in the center of the vacuum vessel. Figure 3.8 shows pulse #79698, where a record current of 4.5MA was reached, just before the long JET shutdown for the substitution of the first wall. Notice the bursts of vertical velocity due to the inevitable Edge Localized Modes (ELMs) with such energetic plasmas. 19
3 Plasma control problems and solutions 3.1 The Vertical Stabilisation 1.2 1 Modified Set Mirnov Coils Saddle Loops 0.8 Weight 0.6 0.4 0.2 0 0.2 0 5 10 15 20 25 30 35 Coil Number Figure 3.6: JET weights for Mirnov coils and saddle loops. Notice how the introduction of the divertor pratically made unusable the coils in the lower part of the vacuum vessel due to the shielding effect of the divertor itself, leading to the necessity of setting to zero the relative weights (coils 10-18). 20
3 Plasma control problems and solutions 3.1 The Vertical Stabilisation 5000 Tension on ERFA coils (V5 VFRFA<S) Voltage [V] 0 5000 59.455 59.46 59.465 59.47 59.475 59.48 59.485 Time [s] Current [A] 350 300 250 200 150 100 50 Current on ERFA coils (V5 IFRFA<S) 0 59.455 59.46 59.465 59.47 59.475 59.48 59.485 Time [s] x 10 6 ZpdIp signal (Ip weighted vertical velocity) (V5 VSEL<S) 2 1 ZpdIp 0 1 2 59.455 59.46 59.465 59.47 59.475 59.48 59.485 Time [s] Figure 3.7: JET Vertical Stabilization system, pulse #79632. 21
3 Plasma control problems and solutions 3.1 The Vertical Stabilisation x 10 4 Tension on ERFA coils (V5 VFRFA<S) Voltage [V] 1 0.5 0 0.5 1 52 52.1 52.2 52.3 52.4 52.5 52.6 52.7 52.8 52.9 53 Time [s] 1000 Current on ERFA coils (V5 IFRFA<S) 500 Current [A] 0 500 1000 52 52.1 52.2 52.3 52.4 52.5 52.6 52.7 52.8 52.9 53 Time [s] x 10 7 15 ZpdIp signal (Ip weighted vertical velocity) (V5 VSEL<S) 10 ZpdIp 5 0 5 52 52.1 52.2 52.3 52.4 52.5 52.6 52.7 52.8 52.9 53 Time [s] Figure 3.8: JET Vertical Stabilization system, pulse #79698. 22
3 Plasma control problems and solutions 3.1 The Vertical Stabilisation 3.1.2.2 JET s Vertical Stabilisation and ELM pacing A particular use of the Vertical Stabilisation of the JET is to stimulate Edge Localised Modes (ELMs). ELMs are a class of MHD instabilities identifiable by the release of large amounts of plasma internal energy and particles [5, 19]. The edge of high confinement plasmas (H-mode plasmas), such as those of the JET, is in fact characterized by very strong plasma density and temperature gradients due to the formation of what is called an Edge Transport Barrier (ETB), as shown in Figure 3.9. After an ELM the plasma pressure decreases abruptly to slowly rise again. The phenomena is then repeated with an irregular frequency. Pedestal Plasma pressure H-Mode L-Mode Collapse of pedestal due to ELM Formation of edge transport barrier 0 r/a 1 Figure 3.9: Collapse of pedestal causes ELMs. The main problem due to ELMs is the high energy load they unload on the vacuum vessel walls. However, as the energy of an ELM is directly proportional to the amount of time between two consecutive ELMs [20], it is possible to partially mitigate this phenomena by instigating ELMs with an high enough frequency. ELM pacing is still an open field of research, however various techniques have been studied to force trigger ELMs, such as impurity gas puffing and magnetic triggering (see [21, 22] for studies of magnetic ELM triggering in the TCV and ASDEX Tokamak). Magnetic 23
3 Plasma control problems and solutions 3.1 The Vertical Stabilisation triggering, in particular, is the standard technique used for ELM pacing in JET. ELMs are triggered via impulses on the vertical amplifier [23], called, in the JET gergon, vertical kicks. 10 a) ELM pacing for Pulse #78442 ERFA voltage (kv) 0 10 b) 1 D alpha (a.u.) 0.5 0 c) 2 Amplifier Current (ka) 0 2 d) 10 Diamagnetic energy (MJ) 9.5 (MA.m.s 1 ) 9 e) 200 100 0 Vertical velocity 100 24.82 24.84 24.86 24.88 24.9 24.92 24.94 24.96 24.98 25 Time (s) Figure 3.10: Example of ELM pacing via vertical kicks in pulse #78422. In Figure 3.10 an example of ELM pacing via vertical kicks is shown (pulse #78422). In the first and third plot, respectively, the voltage applied and the current on the vertical stabilization coils are reported. The second plot shows the D α emission, which indicates the triggering of an ELM. Notice in the last plot the vertical velocity estimation, which indicates how the plasma reacts to each kick. 24
3 Plasma control problems and solutions 3.2 Plasma shape and position control 3.2 Plasma shape and position control Precise positioning of the plasma column inside the vacuum vessel is one of the most important aspects in Tokamak devices. Via shape control it is possible to maximize the area occupied by the plasma inside the vacuum vessel, to avoid excessive heat loads on components of the vacuum vessel such as the divertor tiles [24], and generally to optimize plasma parameters. 3.2.1 JET Shape Control The Shape Controller (SC) [25, 3] is the system responsible for shaping the plasma column in the JET Tokamak by controlling the voltages applied on the Poloidal Field (PF) coils whose name and positions are shown in Figure 3.11. U Circuit name Toroidal Field (TF) Magnetising (P1) Vertical Field Fast Radial Field Radial Field X-Point Shaping Divertors (P4T) (RFA) (IMB) (PFX) (SHA) (D1-4) Coils series 24 toroidal coils P3MU/L+P1EU/L+P1C P4U+P4L P2/3RU-P2/3RL P4U-P4L P1C P2SU/L+P3SU/L D1, D2, D3, D4 Figure 3.11: JET circuits generating the poloidal field. While the P1 circuit is responsible for the generation of the plasma current, all the other circuits take an active role in shaping the plasma 25
3 Plasma control problems and solutions 3.2 Plasma shape and position control column. In particular the PFX circuit is mostly used to control the position of the X-point and to reduce the stray fields from the P1 circuit, increasing the inboard vertical field and allowing for a more D shaped plasma; the P4T and IMB circuits share the same windings and produce the vertical field of equilibrium and the radial field for the vertical position of the plasma centroid; the Shaping circuit is responsible for changing and elongating the plasma shape; finally the four divertor coils allow the formation of an X- point and the control of its position, as well as the last close field surface strike positions. Each circuit can be controlled either in absolute current, proportional (to the plasma current) current or against a geometrical parameter, defined as a vector named Gap (see Figure 3.12). Examples of Gaps are the Radial Outer Gap (ROG), which defines the distance between the outer limiter and the plasma, and the Radial Inner Gap (RIG), the inner limiter ROG analogue. The amplifiers can also be set in blocked state, where minimum negative voltage is applied, and no induced current is allowed to flow in the circuit (due to the presence of a diode); or in the free-wheeling state where 0 V are applied across the circuit. Although the PF circuits are independently controlled, they are strongly coupled due to their mutual inductances. In the absence of plasma the full circuit equations can be written as: V C = R C I C + M I C (3.11) where V C is a column vector with the circuits voltages, R C is a diagonal square matrix with the circuits resistances, I C is the circuits measured currents, and M is a square matrix containing all the self and mutual inductance terms. The controller structure was designed to be independent of the control 26
3 Plasma control problems and solutions 3.2 Plasma shape and position control Figure 3.12: Main Gaps in the JET Tokamak. Gaps are geometrical distances of the plasma to a given point, that can be controlled by shape controller to a prescribed value. One of the most used is the Radial Outer Gap (ROG), controlled by changing the vertical field produced by the P4T circuit. mode selection and it can be summarised [3] as: V ref = R C I C + K(Y ref Y ) (3.12) where Y and Y ref are respectively the vectors of measures and references of the controlled variables, and K is a gain matrix defined as: K = H (MT 1 C 1 ) (3.13) where H is named cancellation matrix and cancels the coupling effects of the faster circuits, and C contains the delays due to the dynamics of each circuit. T has the role of translating the current measurements in meaningful control variables. 27
3 Plasma control problems and solutions 3.2 Plasma shape and position control In order to control Gaps, Shape Controller needs to receive as input measurements of the plasma surface along the Gaps. In order to do so a software named Felix [26] implements the XLOC equilibrium reconstruction code [27, 28]. 3.2.1.1 XSC: extreme Shape Controller The extreme Shape Controller (XSC) is a recent addition to the historical Shape Controller of JET. It is structured as an add-on module and was designed to allow full boundary control of the plasma shape [29, 30], as opposed to SC simpler Gap control. XSC has been succesfully validated in the JET Tokamak in 2003 [31], and is now regularly used, in particular to control ITER-like plasmas [32, 33]. The main idea behind the XSC algorithm is to control the full plasma boundary, while minimising the error over a large set of geometrical shape descriptors (32 Gaps, strike points and X-point position), so that the system is no longer limited to the accurate control of only a few Gaps. The XSC operational scenarios are implemented [34] around a given plasma shape and equilibrium (in terms of plasma current, internal inductance l i and the ratio of the poloidal kinetic to magnetic pressure β p ). The system made by the plasma, JET s passive structures and PF coils is a distributed parameter system described by a set of nonlinear PDEs [35]. However by using the axisymmetry of the Tokamak device and some approximations it is possible to obtain a nonlinear lumped parameters approximation of the PDEs. As the plasma basically moves between equilibrium states, the obtained lumped parameter rapresentation can be further simplified by linearizing it around a desired equilibrium, obtaining a linearized plasma model [36, 37] in the form: 28
3 Plasma control problems and solutions 3.2 Plasma shape and position control x(t) = Ax(t) + Bu(t) + Ew(t) (3.14) I p,eq g(t) = CI P F (t) + F w(t) (3.15) where A, B, E, C, F are the model matrices obtained via linearization; x(t) is the state vector and is made by the variations of the currents in the PF circuits and of the plasma current; u(t) is the input voltage variations on the PF circuits (zero for the plasma current virtual circuit); w(t) are the disturbances (β p and l i variations); g(t) is the variation of the shape descriptors and, finally, I p,eq is the value of the plasma current at the equilibrium. As the decoupling of the PF coils is already carried out by the SC system (which XSC leverages), and the power supplies can be modeled as simple first order SISO systems: I P Fi (s) = I ref,p F i (s) 1 + sτ P F (3.16) where τ P F is conservatively chosen as the slowest time constant between all power supplies, the XSC controller can be modeled by simply using the second equation of system (3.15). XSC minimizes a steady-state performance index: J = lim t [g ref g(t)] T [g ref g(t)] (3.17) which penalizes the error on the whole plasma shape with respect to a reference shape g ref. In Figure 3.13 the block diagram of the extended JET Shape Control system is reported (as implemented on the actual plant), with the XSC highlighted and made up of the Gap Controller part (minimizing the shape error cost function), and of the set of low pass filters adapting the re- 29
3 Plasma control problems and solutions 3.2 Plasma shape and position control sponse of the XSC to the slowest power supply. Figure 3.13: Block diagram of the Shape Controller system augmented with the XSC. The generation of a XSC scenario is completely automated by a set of XSC Tools [34]. With these tools it is possible to define an XSC Configuration Files which basically is a set of XSC parameters and the linear plasma model on which that particular configuration is based. An XSC Simulator is also present in the suite of tools to help with carrying out closed loop simulations of the XSC together with the linear model of the plant. 3.2.1.2 CLA: Current Limit Avoidance The main issue with the XSC system was the fact that it didn t take into account the current limits on the PF coils which, if reached, cause the controlled termination of the experiment or, in extreme cases, even a disruption. As stated in the previous section, XSC scenarios had to be accurately tuned by hand in order to ensure that all PF currents where safely far from the current saturations. This led to difficulties in the development of said scenarios, and deepened the dependence of XSC on a correct model of the 30
3 Plasma control problems and solutions 3.2 Plasma shape and position control whole plasma shaping system. The Current Limit Avoidance (CLA) system was developed as an addon module for XSC in order to keep a balance between plasma shape constraints and distance of the currents from the saturation limits in real-time [38, 39, 40, 41]. The CLA system is based on the dynamic input allocation theory developed in [42]. The same theoretical framework was already successfully applied in FTU plasma elongation control system [43, 44]. The idea behind this theory is that in a MIMO system, when the number of actuators exceeds the number of controlled outputs, different choices of the inputs can raise the same output response (at least at steady state). A dynamic input allocator leverages this property by modifying the input to a plant in order to obtain a better allocation of it (for instance by keeping actuators away from saturations) without compromising the outputs. In particular, given a system in the state space standard form: { ẋ y = Ax + Bu + B d d = Cx + Du + D d d (3.18) and a controller defined as: P (s) = C(sI A) 1 B + D, P := P (0) (3.19) { ẋ c y c = A c x c + B c u c + B r r = C c x c + D c u c + D r r (3.20) the dynamic input allocation theory developed in [42] is applicable only either to strongly input redundant system, i.e. systems where ker(b) ker(d), or to weakly input redundant systems, i.e. system where ker(p ). In the former case input allocation allows to keep the value of the plant inputs inside a desirable region without affecting the output response of the system, while in the latter the same can only be guaranteed at steady state (so the input allocation should be sufficiently slow to avoid 31
3 Plasma control problems and solutions 3.2 Plasma shape and position control instability). In the case of the XSC system, however, the system is not even weakly input redundant as is the general case when the number of outputs is greater than the number of inputs of a plant. However, as small deviations from the desired shape are acceptable as long as they guarantee the current limit avoidance, there was margin to operate. In particular the theory in [42] needed to be extended. In [41] the problem has been throughly analyzed and solved by introducing a continously differentiable cost function J(u, δy ) measuring the trade-off between the modified steady-state input of the plant u, and the associated output modification δy. r e yc u y XSC Plant + + + + ya Alloc. P* δy JG10.245-6c Figure 3.14: Block diagram of the control system with the insertion of the allocator block. Defining the following allocator system: ẇ y a = ρk = B 0 w ( [ ( J ) = ρk J I P ] B 0 ) (3.21) where ρ is a scalar parameter tuning the allocation speed, K is a symmetric positive definite gain matrix and B 0 is a full column rank matrix specifying the allocation directions in the input space 4 [40]; and intercon- 4 B 0 leads to the possibility of denying certain directions, thus blocking the allocator from applying any control action to them. This has been used extensively to forcibly block certain points in the plasma shape, such as the X-Point position. 32
3 Plasma control problems and solutions 3.2 Plasma shape and position control necting the allocator to the systems (3.18) and (3.20) as shown in Figure 3.14: { u c = y P y a u = y c + y a (3.22) and assuming that the feedback system made by (3.18) and (3.20) is well posed and exponentially stable, it is possible to show that the input allocated closed loop system converges, for sufficiently small values of the allocation speed, to a steady state which minimizes J(u, δy ) [41]. The CLA system has been recently commissioned at JET. In particular pulses #81710 and #81715 have been carried out keeping all the parameters constant with the exception of the enabling of the CLA in the latter pulse (at 61s) with the following artificial limits on the divertor currents in order to force the intervention of the allocator system: I D1 [ 16.5 4] ka I D3 [ 11 2] ka I D2 [ 31.45 10] ka I D4 [6 13.5] ka Figure 3.16 shows that the limits on the currents in the various divertors are quickly enforced upon enabling the CLA. Notice the oscillation in the I D2 current do to the reallocation of the other currents. Figure 3.15 shows instead the negligible difference in shape between the reference pulse (in blue) and the one with the CLA enabled (in red). Notice in particular how the X-point position is kept fixed (as been programmed in the CLA configuration). A detail of the movements of the top-right gap (GAP2) and of the internal and external position of the plasma (RIG and ROG GAPs) is reported in Figure 3.17. 33
3 Plasma control problems and solutions 3.2 Plasma shape and position control (a) (b) Figure 3.15: JET pulse #81710 (blue) and #81715 (red) with CLA enabled. Shape error (a) and detail (b). 34
3 Plasma control problems and solutions 3.2 Plasma shape and position control Current on ID1 Current [A] 2000 3000 #81710 #81715 Current [A] 4000 61 61.2 61.4 61.6 61.8 62 62.2 62.4 62.6 62.8 63 Time [s] 0.95 x Current on ID2 104 1 #81710 #81715 Current [A] 1.05 61 61.2 61.4 61.6 61.8 62 62.2 62.4 62.6 62.8 63 Time [s] 1.05 x Current on ID3 104 1.1 1.15 #81710 #81715 Current [A] 1.2 7000 6500 6000 5500 61 61.2 61.4 61.6 61.8 62 62.2 62.4 62.6 62.8 63 Time [s] Current on ID4 #81710 #81715 61 61.2 61.4 61.6 61.8 62 62.2 62.4 62.6 62.8 63 Time [s] Figure 3.16: Comparison of currents on the divertor colis for JET pulses #81710 and #81715. 35
3 Plasma control problems and solutions 3.2 Plasma shape and position control RIG Measure GAP [m] 0.14 0.13 0.12 0.11 0.1 0.09 0.08 #81710 #81715 61 61.2 61.4 61.6 61.8 62 62.2 62.4 62.6 62.8 63 Time [s] ROG Measure 0.06 #81710 #81715 GAP [m] 0.04 0.02 0 61 61.2 61.4 61.6 61.8 62 62.2 62.4 62.6 62.8 63 Time [s] 0.26 0.24 GAP2 Measure #81710 #81715 GAP [m] 0.22 0.2 0.18 61 61.2 61.4 61.6 61.8 62 62.2 62.4 62.6 62.8 63 Time [s] Figure 3.17: Comparison of GAP measures for GAP2 (top right of the vacuum vessel) and RIG/ROG (Radial Inner/Outer GAP) for the JET pulses #81710 and #81715. 36
3 Plasma control problems and solutions 3.3 Power supplies related problems 3.3 Power supplies related problems Due to the high fields required for magnetic control and heating of plasmas, Tokamak power supplies tend to be very complex machines, usually custom built for the experiment at hand. In this section two examples of some of the most common difficulties concerning Tokamak power amplifiers are reported, namely the management of problems when driving amplifiers outside their standard operating point, and the overcome of power supplies limits due to their embedded controllers. The former problem has been addressed in FTU, where low current requests on the AL-F amplifier led to oscillating behavior, while the latter concerned the improvement of the performances of an old amplifier for the EFCC coils at the JET Tokamak. 3.3.1 Induced plasma oscillations: the AL-F amplifier I V I P Figure 3.18: Control system block diagram of horizontal position. In FTU, the desired horizontal plasma position is regulated thanks to a pair of coils named V (vertical field) and F (feedback). The former provides most of the energy needed for the horizontal stabilization and is generally driven in feedforward mode due to its severe bandwith limitations. The latter, instead, is dedicated to an accurate regulation of the horizontal plasma position and is driven by a PID controller working in feedback mode plus a possible feedforward preprogrammed term. 37
3 Plasma control problems and solutions 3.3 Power supplies related problems A feedback PID controller uses as input the difference between the magnetic flux measured at the two desired plasma boundaries Ψ. This measurement resembles the horizontal position error because a horizontal misplacement causes a difference between the flux values at the two desired boundaries. The whole F coil control loop is sketched in Figure 3.18, where the AL-F block is a thyristor-based converter receiving a reference signal coming from the PID controller, corresponding to the requested F coil current. 38
3 Plasma control problems and solutions 3.3 Power supplies related problems Figure 3.19: Electrical scheme of the AL-F converter. 39
3 Plasma control problems and solutions 3.3 Power supplies related problems The schematic of the AL-F converter is shown in Figure 3.19; the circuit can be however well represented by the simplified electrical scheme shown in Figure 3.20. I 1 R F V 2 V 1 I F L F I 2 L L Figure 3.20: Simplified electrical scheme of the thyristor bridges of the AL-F converter. In this scheme, each thyristor has a minimum current threshold of 1.2 ka below which no conduction is possible. Therefore, any requested current level below this threshold has to be obtained by an adequate balance among the currents flowing through the 2 bridges. Unfortunately, the PID controller was not designed to deal with nonlinear components, so that instability phenomena occur when it is forced to act with F currents below the 1.2 ka threshold. In fact, the algorithm generally works fine for standard plasma discharges, but it often results inadequate during the plasma startup or in particular experimental circumstances such as when, due to the first wall impurity s release, the kinetic pressure of the plasma is lower than the expected one. In many of such cases, strong oscillations are experienced and the experiment (shot) is often terminated. 40
3 Plasma control problems and solutions 3.3 Power supplies related problems 3.3.1.1 Model of the AL-F feedback The first step in trying to reproduce the oscillations seen during experiments was to develop a simplified model of the AL-F circuit derived from the scheme of Figure 3.20, where each one of the left and right branches represents two pools of thyristors (exactly sixteen of them, in parallels of pairs). Each branch can generate pulsing voltages on the F coil, which is represented by the central branch and its inductance L F and resistance R F. The two inductances L are saturated inductances (namely variable inductances whose value depends on the current level) used to limit sudden current variations in low current operation. A hardware control system (not shown in the figure), called PHSC (Programmable High Speed Controller), is embedded into the AL-F circuitry. This control system has authority over the switching angles of each thyristor within each one of the two external branches of Figure 3.20. In particular, each thyristor transfers some quantity of the alternate power supply to the load according to the switching angle allocation. Since the load is highly inductive (with time constant L F /R F ), from the point of view of the currents I 1 (t) and I 2 (t) flowing in the circuit, what matters most is the equivalent average voltage applied to each branch within one period of the alternate power supply (this is roughly 60 Hz). According to Figure 3.20, denote by V 1 (t) and V 2 (t), respectively, the average voltage applied to the left and right branches of the figure. Then, also taking into account the constant voltage drop V T around each conducting thyristor, the equations describing the circuit in Figure 3.20, neglecting the presence of the two diodes, correspond to (dependence from time has been omitted for space constraints): V 1 = L di 1 dt + L d(i 1 I 2 ) F dt V 2 = L di 2 dt L F d(i 1 I 2 ) dt + R F (I 1 I 2 ) + 8V T R F (I 1 I 2 ) + 8V T, (3.23) 41
3 Plasma control problems and solutions 3.3 Power supplies related problems where the constant voltage drop V T is multiplied by 8 because each branch consists of a series of 8 thyristors. Equations (3.23) can be used to derive two coupled differential equations allowing to compute I 1 (t) and I 2 (t) from the equivalent average voltages V 1 (t) and V 2 (t) applied by the thyristors. These equations are reported in (3.24). Note that in (3.24) the presence of the diodes of Figure 3.20 is embedded in the fact that with non positive currents, the current variation is not allowed to be negative, so that the non-negative semiaxis is positively invariant. di 1 dt = di 2 dt = { max 0, (L+L F )V 1 +L F V 2 +LR F (I 2 I 1 ) 8(2L F +L)V T L 2 +2LL F }, if I 1 0 (L+L F )V 1 +L F V 2 +LR F (I 2 I 1 ) 8(2L F +L)V T L 2 +2LL F, otherwise { max 0, (L+L F )V 2 +L F V 1 +LR F (I 1 I 2 ) 8(2L F +L)V T, if I 2 0 L 2 +2LL F } (L+L F )V 2 (t)+l F V 1 +LR F (I 1 I 2 ) 8(2L F +L)V T L 2 +2LL F, otherwise (3.24) Clearly, from equations (3.24) one can easily compute the current flowing in the F coil by I F (t) = I 1 (t) I 2 (t). The hardware PHSC unit (whose block diagram is reported in Figure 3.21) controls the voltages V 1 (t) and V 2 (t) so that two requirements are fulfilled: 1) the output current I F (t) is close (as close as possible) to the requested current I F,req (t) coming from the PID controller (see Figure 3.18); 2) both currents I 1 (t) and I 2 (t) never drop below the minimum conduction current characterizing the thyristors if I F,req (t) is below that threshold. Since the thyristors are paired and each thyristor has a minimum current of 600A, the total minimum current is given by I min = 1200A. To fulfill the above mentioned goals, the PHSC follows a PID strategy 42
3 Plasma control problems and solutions 3.3 Power supplies related problems I 1 I 1 I F,req + _ e I PHSC PID I reg PHSC Logic V 1 V 2 AL-F Bridges I 2 I 2 + _ I F Figure 3.21: Block diagram of the PHSC. with an error feedback from the F coil current error: I reg (t) = K p e I (t) + K I x c (t) + K d ė I (t) ẋ c (t) = e I (t) (3.25) Moreover, based on the output I reg (t) of the PID controller, the PHSC imposes the voltages V 1 (t) and V 2 (t) as V 1 (t) = σ V (I min 1.8I 2 (t) + σ M (I reg (t))) V 2 (t) = σ V (I min 1.8I 1 (t) σ M (I reg (t))) (3.26) where σ s ( ) is the scalar symmetric saturation function having saturation level s, and M = 12500A and V = 5000V. This control strategy ensures that for any current request I F,req (t), the PHSC will regulate I 1 (t) and I 2 (t) so that, after a reasonable transient, I F (t) = I F,req (t) and, moreover, both I 1 (t) and I 2 (t) will be either zero or larger than I min. This type of behavior is inevitable with circuits relying on thyristors which can be thought of as some very powerful diodes and, as such, are inevitably characterized by a minimum current to be able 43
3 Plasma control problems and solutions 3.3 Power supplies related problems to polarize the P/N junction. The larger the maximum current of the thyristor, the larger the minimum allowable current must be. Hence, when low currents are requested from I F,req (t), the PHSC will need to enforce two currents in the left and right branches of Figure 3.20, both of them larger than I min and such that their difference (which flows in the load) corresponds to I F,req (t). Note that in the model we completely disregard the effects of the switching angles of each thyristor: the filtering action of the highly inductive load makes it unnecessary to model all the switches happening in the bridge and the pulsed voltage waveforms arising on the load. The averaged representation of this model is sufficient to reproduce the experimental behavior. 2000 Experimental and simulated currents on F coil (shot #20838) Current [A] 1000 0 1000 Experimental Simulated 0.4 0.6 0.8 1 1.2 1.4 Time [s] Figure 3.22: Shot number #20838. Open-loop simulation of the AL-F model. Figure 3.22 reports on an open-loop simulation where the model given by (3.24), (3.25) and (3.26) has been implemented in Matlab/Simulink using the experimental time history of I F,req (t) from the unstable shot #20838 as an input. According to the PHSC datasheet, the parameters in the PID controller (3.25) have been selected as K p = 1.5, K i = 37.5, K d = 0.75. 44
3 Plasma control problems and solutions 3.3 Power supplies related problems Moreover since the small nonlinearity of L causes negligible effects on the closed-loop behavior, it has been considered as a linear inductance. Finally, according to the experimental equipment, the other components have been selected with the values reported in Table 3.1. In Figure 3.22 the solid curve represents the experimental measurement of I F (t) while the dashed curve represents the simulation output. L L F R F V T 2mH 9mH 8mΩ 1.8V Table 3.1: Values of the electrical components of the AL-F model. Altogether, the model in Figure 3.21 consisting of (3.24), (3.25) and (3.26) with: e I (t) = I F,req (t) I F (t) = I F,req (t) (I 1 (t) I 2 (t)) (3.27) corresponds to a strongly nonlinear closed-loop relating the requested current I F,req (t) to the actual F coil current I F (t). Considering the systems (3.24), (3.25), (3.26) and (3.27) under the action of an input I F,req (t) = I 0 +Ĩ(t) with Ĩ(t) sufficiently small in magnitude and rate it is possible to show [45] that the solution of the systems coincides with the one of (3.25) and (3.27) interconnected with the linear filter: I F (t) = αi F (t) + βi reg (t) (3.28) If I 0 is sufficiently large (but I 0 < M ) the system (3.28) is stable with: α = LR F L 2 = 0.28, β = + 2LL F L + L F L 2 + 2LL F = 67.4 called, from now on, High Current (HC) model; while if I 0 is sufficiently 45
3 Plasma control problems and solutions 3.3 Power supplies related problems small, system (3.28) becomes unstable with: α = L(1.8 2R F ) L 2 + 2LL F = 63.53, β = defined as Low Current (LC) model. 2L L 2 + 2LL F = 71.22 This interesting feature means that before the stabilizing action performed by the PID controller (3.25) in the feedback loop of Figure 3.21, the core linear dynamics of the system ranges from exponentially unstable behaviors to exponentially stable ones, thus resulting in a highly nonlinear response for large ranged signals. Despite the unstable small signal behavior of (3.24) and (3.26), the PID controller (3.25) manages to stabilize both linearized dynamics (even though with poor performance in the small signal range -see the upper plot of Figure 3.23). Indeed, when closing the loop with the PID controller (3.25), the poles of the linearized AL-F transfer function from I f,req (t) to I f (t) are ( 4103, 77, 21) in the first case, i.e. with the HC model, and ( 4107, 21±j36) with the LC model. Figure 3.23 shows the simulation response I F (t) to a triple step input I F,req (t) when using the closed-loop of the PID with the LC linear model (solid curve in the upper plot) and the response to the same input when closing the loop with the HC linear model (solid curve in the lower plot). In both plots the nonlinear response obtained by closing the loop with the nonlinear model corresponds to the dashed curves. Note that in the first step, where I 0 is very small, the response matches that one of the LC model, in the second step it sits somewhere between the two models and in the third step, where I 0 is sufficiently large, it matches the HC model response. Once established this peculiar feature of AL-F, also the other components of the feedback system were modeled in order to be able to run a closed-loop simulation of the control system in Figure 3.18. 46
3 Plasma control problems and solutions 3.3 Power supplies related problems 2000 Step response of the low current (LC) model Current [A] 1500 1000 Reference 500 Nonlinear AL/F model Linear LC model 0 0 0.5 1 1.5 2 Time [s] Step response of the high current (HC) model 2000 Current [A] 1500 1000 Reference 500 Nonlinear AL/F model Linear HC model 0 0 0.5 1 1.5 2 Time [s] Figure 3.23: Linear LC and HC models behavior compared to the nonlinear response. The PID controller on the left is completely known because it is discretized and implemented in the real-time control code running on the Linux-RTAI platform controlling the plasma during the experiment [46]. In particular, the controller obeys the following standard law: y P ID (t) = K p (t)u P ID (t) + K i (t)x c (t) + K d (t) u P ID (t) ẋ c (t) = u P ID (t) (3.29) where K p (t), K i (t), K d (t) are time variant gains which are preprogrammed and usually uniformly ramp up during the startup phase, are constant 47
3 Plasma control problems and solutions 3.3 Power supplies related problems during the flattop phase and ramp down during the final phase of the shot. The constant values at the flattop, K p = 0.15, K i = 25, K d = 4.5 10 4, have been used as this is the most interesting part of the experiment, and the one in which the oscillations are most evident. Mimicking the FTU control system, the controller (3.29) has been introduced in the simulation diagram in its discretized form with the sampling period T s = 0.5 ms used at FTU. Its approximate discrete-time transfer function corresponds to: y P ID (z) = 1 ( T s 2 10 5 K p + K i 2 + K d z 1 (τ + T s )z τ with the time constant value τ = 4 ms. ( ) z + 1 z 1 ) u P ID (z) The external signals acting on the diagram of Figure 3.18 correspond to the preprogrammed feedforward profiles for the F coil (called I F,pre ), for the V coil (called I V,pre ) and for the plasma current (called I P,pre ). In particular, the equivalent effect of these currents at the plasma input is computed by suitably weighting each contribution according to their equivalent steadystate effect on the plasma position and corresponds to selecting the signal acting before AL-F in Figure 3.18 as w 1 (t) = I F,pre (t), and to selecting the signal acting after AL-F as w 2 (t) = g V I V,pre (t) + g P I P,pre (t), with g V = 4.317 and g P = 4.717 10 2. Then the controller (3.29) is interconnected to the closed-loop via the equations I F,req (t) = I F,pre (t) + y P ID (t) and u P ID (t) = Ψ(t). The plasma model in Figure 3.18 is crudely represented as a simple linear dynamical system capturing the gross horizontal motion of the plasma. The model adopted has been identified by manually adjusting the parameters 48
3 Plasma control problems and solutions 3.3 Power supplies related problems in a first order continuous time filter with the following transfer function: Ψ(s) = P (s)(i F (s) + w 2 (s)) 7 3.4375s := 10 0.008s + 1 (I F (s) + w 2 (s)) (3.30) mapping I F (t) + w 2 (t) into Ψ(t). Experimental and simulated magnetic flux (shot #20838) Magnetic flux [Wb] 0.1 0.05 0 0.05 0.1 Experimental Simulated 0.4 0.6 0.8 1 1.2 1.4 Time [s] Figure 3.24: Shot number #20838. Open-loop simulation of the plasma model. Figure 3.24 shows a comparison between the experimental data from the same unstable shot #20838 used in Figure 3.22 and the simulated data obtained from the model (3.30) driven by the experimental signals I F,supplied (t)+w 2 (t). Some differences between the experimental data (solid) and the simulated data (dashed) occur, especially with large signals, for the fact that the linearity of plama behaviour is guaranteed only for very small variations around the equilibrium. However, the small signal fidelity of the model is satisfactory. 49
3 Plasma control problems and solutions 3.3 Power supplies related problems Experimental and simulated currents on F coil (shot #28000) 6000 Current [A] 4000 2000 Experimental Simulated 0 0 0.5 1 1.5 Time [s] Experimental and simulated currents on F coil (shot #20838) 2000 Current [A] 1000 0 1000 Experimental Simulated 0 0.5 1 1.5 Time [s] Figure 3.25: I F response for shots number #28000 (upper plot) and #20838 (lower plot) in solid lines. Corresponding closed-loop simulations in dashed lines. In Figure 3.25 two closed-loop simulations 5 are reported: one corresponding to a standard experiment (where the F coil current was monotonically increasing and significantly higher than the circulating current I min ), and an oscillating one. 5 Closed-loop simulations of previous experiments are carried out by closing the AL-F loop while considering the other signals (such as the currents on the other coils, etc.) as external disturbances and directly feeding them to the simulink model as downloaded from the FUT experimental database. This, while not being completely accurate, as it disregard some phenomena such as mutual inductances, can give an insight of problems and performances of the solutions proposed, and it is a mandatory step before closing the loop on the actual machine. 50
3 Plasma control problems and solutions 3.3 Power supplies related problems The upper plot shows the I F (t) response simulating the stable shot #28000. The initial mismatch between the experimental data (solid) and the simulated response (dashed) depends on possible different initial conditions and the fact that the linear plasma model (3.30) certainly cannot capture the highly nonlinear plasma behavior during the breakdown phase. The lower plot of Figure 3.25, instead, shows the simulated I F (t) response for the unstable shot #20838. Note that the simulated F current is correctly mapped within the critical range between ±I min and the closed-loop system exhibits an undesirable oscillation, mimicking the twofold behavior of the actual experiments. Once again, the simulated behavior in Figure 3.25 (as well as the experimental behavior), reveals that the only possible cause of this twofold behavior can be the nonlinear model of the AL-F circuit. Indeed, all the other components of the closed-loop simulation (corresponding to the diagram of Figure 3.18) are linear and cannot cause instability for small signals and stability for large ones. As a further confirmation of this fact the poles of the linear closedloops between the PID controller (3.29) and the plasma model (3.30) via the two linear approximate behaviors HC and LC for the AL-F system have been studied. With the HC model, the closed-loop is exponentially stable with a maximum real part of the stable closed-loop poles corresponding to λ MAX = 7.5. With the LC model, the closed-loop is, instead, unstable, with λ MAX 34. This property explains, to a certain extent, the oscillatory behaviour experienced in experiments and simulations in the small signals regime. 3.3.1.2 Anti-windup solution Once the cause of instability is recognized, the anti-windup scheme of [47] (see also [48]) can be applied by treating the nonlinear dynamic behavior of AL-F as a sort of undesired (dynamical) input nonlinearity. Indeed, the basic calculations carried out in [48, 47] still apply to this case and conver- 51
+ + 3 Plasma control problems and solutions 3.3 Power supplies related problems gence properties can be established because the plasma model (3.30) is linear and exponentially stable. The arising closed-loop scheme is represented in Figure 3.26, where the supplied current in the F coil is not measured from the field but is computed using the model illustrated 6. In particular, the faithfulness of the computed current with respect to the experimental one has been confirmed by real-time simulations running exactly the same real-time code prepared for the experimental controller (see [49] for details on the underlying architecture). Preprogrammed F current Preprogrammed V and P current ~ ΔΨ PID + + I F,req. + + AL-F I F + + PLASMA ΔΨ. v 1=KΔI K aw. + + AL-F model Î F Target model. I F,T -Î F + PLASMA model v =ΔΨ -ΔΨ^ 2 T Anti-windup compensator Figure 3.26: Anti-windup solution. The proposed anti-windup solution consists in adding extra dynamic components to the closed-loop, that generate two compensation signals 6 Note that the current could be measured directly from the field, but this would overload the input signals to the real-time controller; therefore computing an estimate of it from the model has been the preferred solution. Moreover, as the anti-windup solution is robust (as shown in [47]) and the nonlinear AL-F model developed is quite realistic, using the model to compute I F has the beneficial side effect of avoiding the introduction of any noise in the system that, instead, a real sensor inevitably has. 52
3 Plasma control problems and solutions 3.3 Power supplies related problems v 1 (t) and v 2 (t) (as in Figure 3.26), where v 1 (t) is added to the AL-F input and v 2 (t) is added to the plant output Ψ(t). In particular, the controller (3.29) is interconnected to the closed-loop via: I F,req (t) = y P ID (t) + I F,pre (t) + v 1 (t) u P ID (t) = Ψ(t) + v 2 (t) (3.31) Regarding v 1 (t) and v 2 (t), they are selected in such a way that the compensation action aims at reproducing as much as possible the closed-loop response arising when the AL-F dynamics is replaced by the target model in Figure 3.26, which is selected to be linear. Defining I F,T (t) as the output of said target model, ÎF (t) as the estimated value of I F (t) arising from the nonlinear model, K aw as a positive constant (tuning parameter for the antiwindup system), and Ψ T (t) and ˆΨ(t) as, respectively, the (linear) plasma model response to I F,T (t) and ÎF (t), then the v 1 (t) and v 2 (t) signals are selected as: v 1 (t) = K aw (I F,T (t) ÎF (t)) v 2 (t) = Ψ T (t) ˆΨ(t) (3.32) It is possible to show [45] that for small enough values of K aw 0, and under the action of limited signals, the anti-windup closed-loop generates limited responses and that for any trajectory of the target closed-loop such that the response of the target model coincides with that of the nonlinear AL-F model (3.25), (3.26), (3.27), the response Ψ(t) of the anti-windup closed-loop from the same initial conditions and with the same inputs converges to the response Ψ(t) of the target closed-loop. Note that according to the robustness analysis carried out in [47] (see also [50]), the overall scheme is robust with respect to variations of the plant parameters (as compared to the model). This robustness follows from a small gain reasoning (see [47] for details) under the assumption that the controller is incrementally stable, which holds as shown before. 53
3 Plasma control problems and solutions 3.3 Power supplies related problems 2000 Simulated currents on F coil (shot #20838) Current [A] 1000 0 1000 Without AW With AW 0 0.5 1 1.5 Time [s] Figure 3.27: Shot number #20838. Anti-windup simulation. Figure 3.27 shows a simulation of the same shot #20838 illustrated in the lower plot of Figure 3.25 when the target model is selected as the HC model previously characterized. This selection of the target model also allows to achieve an automatic and smooth shutdown of the anti-windup compensation when the F current becomes large enough, i.e. when the response of the nonlinear model coincides with the one of the target (HC) model. It can be seen that the oscillations caused by the AL-F nonlinearities (solid curve) are completely removed by the anti-windup scheme (dashed curve). Note also that the oscillations during the initial transient are still present but those, as mentioned above, should be interpreted as an effect of the linear model of the plasma behavior, which is inaccurate during the startup phase. Note also that this startup phase is basically the same for the solid and dashed curves, revealing that the anti-windup compensation is not doing much in that initial transient. The proposed solution, whose block diagram representation is shown in Figure 3.26, has been implemented on the FTU feedback system and tested with various values for the gain K aw. 54
3 Plasma control problems and solutions 3.3 Power supplies related problems First of all a simpler version of the anti-windup system has been deployed at FTU in order to have a benchmark and test the system softwarewise. This preliminary version consisted of the scheme of Figure 3.26 with K aw = 0 (thus turning off the signal v 1 ) and the target model chosen as an identity (thus forcing the system to behave like an ideal amplifier). The drawback of this solution, however, was that, since the AL-F model never acts like an identity, the anti-windup action would enforce closed-loop corrections also in operating conditions where the F current is large enough not to require any correction. Therefore, in order to forcibly avoid any intervention of the controller when large currents were requested, a dead-zone-like nonlinearity was added at the input of the anti-windup system. The FTU experimental response with this solution is shown in Figure 3.28 (shots #31621 and #31626). Notice how the oscillations have been greatly damped. Current [A] Comparison of the same pulse with and without antiwindup system 2000 #31621 (AW off) #31626 (AW on) 1000 0 1000 0.35 0.4 0.45 0.5 0.55 0.6 0.65 Time [s] Figure 3.28: Shots #31621 and #31626: same shot type. In the latter the anti-windup system was turned on. Following the success of this preliminary version, the development of the anti-windup system has been completed and the final controller deployed in the plant. In Figure 3.29, a comparison between two shots, one with the anti-windup system turned off (#32784) and the other with the system active and tuned with the target model coinciding with the HC model and K aw = 1 (#32786) is reported. In Figure 3.30 the values of the signals v 1 (t) 55
3 Plasma control problems and solutions 3.3 Power supplies related problems and v 2 (t) are also shown. It is evident that the damping of the oscillations was worse than what expected from the simulations, and in particular from what was obtained with the simplified system deployed previously. Current [A] Comparison of the same pulse with and without antiwindup system 2500 #32784 (AW off) #32786 (AW on) 2000 1500 1000 0.4 0.5 0.6 0.7 0.8 0.9 1 Time [s] Figure 3.29: Shots #32784 and #32786: same shot type. In the latter the anti-windup system is turned on. To verify this issue, a further test has been carried out and is reported in Figure 3.31, where the same experiment has been repeated twice, first using the HC-target anti-windup compensation (shot #32959) and then using the simplified one (shot #32960). better behaviour of the less elegant solution. This test further confirmed the Considering the high level of accuracy of the implemented nonlinear model of the AL-F amplifier (and thus of its HC linearization), the simple plasma model used in the anti-windup system is probably the cause of the bad behaviour of the HC-target anti-windup solution. This theory is further confirmed by inspecting the experimental data corresponding to the signal Ψ(t) of Figure 3.26 where the closed-loop oscillations are clearly visible. As currently no fast plasma boundary reconstruction algorithms are deployed at FTU, it is not possible to have a better plasma model for the anti-windup system. For this reason the simplified scheme is the one active by default during experimentation at FTU. With this solution in place, the previous undesired oscillations occasionally happening and pos- 56
3 Plasma control problems and solutions 3.3 Power supplies related problems 400 v 1 signal in pulse #32786 v 1 signal 200 0 200 400 0.4 0.5 0.6 0.7 0.8 0.9 1 Time [s] x 10 3 v signal in pulse #32786 2 5 v 2 signal 0 5 0.4 0.5 0.6 0.7 0.8 0.9 1 Time [s] Figure 3.30: Shot #32786: signals v 1 and v 2 of the anti-windup system. Comparison between complete and simplified anti windup Current [A] 4000 3000 2000 #32959 (complete AW) #32960 (simplified AW) 1000 0.35 0.4 0.45 0.5 0.55 0.6 0.65 Time [s] Figure 3.31: Shots #32959 and #32960: same shot type. The complete anti-windup code ran on the former. The simplified code shows smaller oscillations. sibly compromising the experiment have not been seen again during all the subsequent experimental campaigns. 57
3 Plasma control problems and solutions 3.3 Power supplies related problems 3.3.2 The JET EFCC Coils control system Magnetic field perturbations which break the toroidal symmetries are inevitable in tokamaks due to imperfections in magnetic field coils and to the presence of magnetic materials. Magnetic islands arising from these asymmetries can cause the appearance of locked modes which, if uncontrolled, frequently lead to disruptions [6, 5]. One of the main goals of the Error Field Correction Coil (EFCC) systems in modern tokamaks is to alleviate this effect by applying magnetic perturbations that compensate the natural error field at the plasma boundary. In JET the EFCC are a set of 4 non-axisymmetric coils distributed around the Tokamak as by Figure 3.32 Figure 3.32: The EFCC coils at the JET Tokamak. Recently at JET, performance issues and practical limitations led to the decision of replacing the EFCCs voltage amplifiers by using the old Vertical Stabilisation amplifier (named FRFA) which was decommissioned around the same period. The opportunity was also taken to reformulate and improve the controller application by incorporating it into a new realtime software framework, developing a new control algorithm and revising the time synchronization mechanism whilst maintaining essentially the same VME based hardware components [51]. 58
3 Plasma control problems and solutions 3.3 Power supplies related problems It has been observed during JET operations that there is a decrease in the performance of this simple PID controller as the frequency of the current reference waveform increases. Furthermore, it is inevitable that inherent plant non-linearities such as component saturations and, in particular, the amplifier s switching of the thyristor bridge restricts the performance of the (linear) PID controller to a limited operational space. New controller Feedforward voltage Original current reference Anticipation Anticipated reference Inverse Model Direct Model New reference Inner delay adaptation - PID Feedback voltage + Outer delay adaptation Measured current Plant (EFCCs) VCVS JG10.250-1c Figure 3.33: The proposed advanced controller block diagram. This has motivated the design and development of a new non-linear and adaptive controller scheme (for a primer on adaptive control see for instance [52]) with the clear aim of improving the system s overall bandwidth [51]. The new controller (Figure 3.33) is based on the idea of shifting the current reference in time (Anticipation block) in order to compensate for circuit delays and the dynamics of the coils. The Inverse Model block calculates the inverse dynamics of the system (amplifier and coils) thus supplying the feedforward component of the control voltage. Also, the Direct Model block is used in order to calculate the new reference for the PID which takes into account the anticipation mechanism. The anticipation mechanism is, in turn, driven by two different loops: the internal one, which attempts to synchronize the original reference with the newly calculated one (i.e. the one modified by the plant dynamics), and the outer one, which does the 59
3 Plasma control problems and solutions 3.3 Power supplies related problems same with the new reference and the measured coil current. The new controller algorithm has been developed and tested in Matlab Simulink environment and simulation results are presented in Figure 3.34. This figure shows a comparison between the experimentally achieved EFCC current and the predicted one by simulating the new controller algorithm for JET Pulse #79777. Furthermore, as a validation cross-check of the plant model used in the new controller algorithm, the simple PID behavior of the present controller has also been simulated revealing good agreement with the experimentally obtained current, thus, providing a clear indication of the accuracy of the model. The current reference used in this pulse is a 40Hz sinusoidal waveform and it can be seen that the simulation with the new controller scheme predicts an overall system bandwidth increase once it is implemented in the online system. Pulse No: 79777 0-500 Current (A) -1000-1500 -2000 19.68 19.70 19.72 19.74 19.76 19.78 Time (s) JG10.250-3c Figure 3.34: Comparison of simulated and experimental results for the EFCC advanced controller. Solid black line represents the reference waveform, dashed black line represents the simulated current obtained with the new controller, dark gray line represents the current experimentally obtained with the present PID controller and the light gray line represents the simulated current obtained with the present PID controller using the plant model. 60
Chapter 4 Technical solutions and implementation 4.1 The MARTe Framework MARTe (Multithreaded Application Realtime executor) is a framework recently developed at the JET Tokamak while working with the PPCC (Plasma Position and Current Control) Group. The main aim of this framework is to simplify the development and deployment of control systems with strict hard-realtime requirements by being easily portable (thanks to the underlying library BaseLib2) and by giving to the control system engineer a simple environment in which to deploy the control law, completely hiding to him the implementation details. MARTe received a warm acceptance by the fusion community, and is now used in various machines throughout Europe (JET, FTU, ISTTOK, COMPASS...). In particular FTU is carrying out a complete revamping of its old control system in order to port it to the new framework. 61
4 Technical solutions and implementation 4.1 The MARTe Framework 4.1.1 The BaseLib2 MARTe is built upon a C++ multi-platform library named BaseLib2. The first key feature of the library is the ability to run the same code in different operating systems (OS). It is organized in consecutive layers (Figure 4.1) where the lowest level implements the different calls for each of the available systems. In order to guarantee portability, the remaining layers and the end-user code must use the functionalities provided by the library, avoiding OS dependent calls. This layered scheme provides a logical organization on how the code is distributed. Top layers have a broader view over the library functionality and tend to accommodate code that is less critical for the operation of a system, granting at the same time a set of tools that greatly eases the development of applications. When porting the library to a new OS only the lowest layer needs to be adjusted. Dynamic Data Buffer Message interfaces Data driven interfaces Matrices RT Matrices Basic filters... Level 5... Level 6 Built-in HTTP server Object introspection Level 4 Configuration DB Data driven support Build objects by name... Level 3 Threading Semaphores Memory... Files Sockets Strings Level 0 Advanced streaming Data types definition Level 2 Garbage Collection Named objects Object Database... Level 1 Figure 4.1: The layered structure of BaseLib2. The layer closest to the operating system provides all the abstraction regarding the interaction with the file system, networking, threading, semaphores, atomic operations and operating system dependent optimizations. BaseLib2 was already ported to the following OS: VxWorks, Linux, Linux RTAI, Solaris, Mac OS X and Microsoft Windows. The possibility 62
4 Technical solutions and implementation 4.1 The MARTe Framework of running the same code in different systems allows developers to write and debug code using tools that might not be available in the target architecture. This is even more important when the final environment has no memory protection (such as Linux RTAI), making the debug of algorithms particularly difficult. BaseLib2 tries to maximize the concept of reference and to dissuade as much as possible the use of pointers. For this purpose a garbage collector and a special root garbage-collectable object is available (GCNamedObject). Objects inheriting from this class can be automatically constructed by the library and are destroyed by the garbage collector when they are no longer required by any external reference. These objects are also allowed to have a name and are, upon construction, automatically added to an internal database (GlobalObjectDataBase). By simply searching for an object name in this database a reference to it can be later obtained. In order to automatically create objects the library provides a standard configuration language. This configuration is provided to the library as a stream and analyzed by a parser that instantiates the objects based on the requested classes. If the object is successfully created, its self-configuration function (ObjectLoadSetup) is called with the subtree of the configuration file relative to the object passed as a parameter. Listing 4.1 and Figure 4.2 show an example of a possible configuration. In order to guarantee real-time efficiency, the object is expected to perform the majority of the required validations and all memory allocations at this stage. Once the object is successfully built it is added to the previously described database. A garbage collectable container object is also provided, allowing to recursively create new nodes in the internal database (GCReferenceContainer). 63
4 Technical solutions and implementation 4.1 The MARTe Framework +H t t p S e r v e r = { C l a s s = H t t p S e r v i c e Port = 8084 } +MARTe = { C l a s s = MARTeContainer +RTThread1 = { C l a s s = RealTimeThread +C o n t r o l l e r = { C l a s s = ControllerGAM NoPlasmaCurrentGain = 4 0. 0 IPWaveform = { Times = {0 120} Amplitudes = { 0. 5 0. 5 } } } +DAM = { Class = DAMGAM P r o j e c t i o n M a t r i x = { 0 = { 1. 0 0. 0 0. 0 0. 0 } 1 = { 0. 0 1. 0 0. 0 0. 0 } 2 = { 0. 0 0. 0 1. 0 0. 0 } 3 = { 0. 0 0. 0 0. 0 1. 0 } }... }... }... Listing 4.1: An example of a BaseLib2 configuration. A series of classes are dedicated to strings and data streaming. These permit to perform a series of advanced operations in character sequences, Figure 4.2: Example of a BaseLib2 CDB. The library is data driven using a syntax that allows to automatically create and configure objects. Once created these are added to an internal tree database which can later be used to search and retrieve references. This figure corresponds to the configuration presented in listing 4.1 64
4 Technical solutions and implementation 4.1 The MARTe Framework and to perform input/output (I/O) operations without requiring the concept of beginning and end of transmission. Most of the I/O classes are abstracted to a level where the knowledge of the target media (file, socket, memory, etc.) is not required. Live introspection and analysis of objects is provided by the CINT C++ interpreter 1, which permits to verify objects internal states and expected behaviors. Due to its wide availability and simplicity the Hypertext Transfer Protocol (HTTP) has been chosen as the standard transfer mechanism of information when querying objects. BaseLib2 provides an internal multithreaded HTTP server which can browse any objects that inherit the appropriate interface (HttpInterface). The internal object database is also browsable and is rendered as a recursive tree with links to all the objects which have the HTTP interface implemented. This scheme allows library users to have a standard user-interface for all the application built with the library. The GET and POST HTTP requests are also implemented providing a way to actively interact with the objects. Multiple servers can coexist at the same time, by using different ports. Object oriented languages provide a very good programming paradigm when designing an application. The concepts of data abstraction, inheritance and modularity permit to define and even impose how the different pieces of the application should interact. Sometimes, and particularly true when providing a library, one cannot fully constrain or predict how something is going to behave. In order to decouple concepts higher level protocols are usually used. Applications developed using the BaseLib2 library can use a series of message classes that allow objects to communicate in a Smalltalk fashion. These messages contain a sender and a receiver object address, specified as a unique path in the internal tree configuration database. A network based message server enables the interaction between 1 http://root.cern.ch/drupal/content/cint 65
4 Technical solutions and implementation 4.1 The MARTe Framework applications living in different machines. The library automatically searches for the object address in its database and if found calls the appropriate function (ProcessMessage). Messages can also be sent in synchronous mode where the sender expects a reply from the receiver. The content of the messages is free and they are routinely used inside the library to start and stop services and by some objects to update their internal behavior. One example of such an object is the state machine class. It is updated by changing its internal states accordingly to the messages received and upon state changing it broadcasts new messages to registered listeners. Being structured using the aforementioned named objects, the State Machine (and the content of the messages sent when changing states) is completely configurable at runtime. The library also provides a series of algebraic and mathematical tools. The widest range is in matrix calculations where several matrix decomposition methods, like the single value decomposition (SVD) and LU decomposition, are available. In order to assure the correct function of a system, a logger mechanism is of huge importance. A good logging scheme permits to expeditiously analyze any problems that may arise during operation. On the other side the logger should not compromise the real-time performance. BaseLib2 provides a series of logging functions with which it is possible to automatically append to a desired logging string, information like the name of the object, its location in memory, the time when the message was issued, the thread and process identifiers, as well as the name of the machine where it was generated. A minimum impact on the system is guaranteed by the use of a consumer/producer scheme. The process wishing to write a log message appends it to a FIFO queue. A consumer, running with very low priority, processes the messages in the queue when processor time is available. This 66
4 Technical solutions and implementation 4.1 The MARTe Framework permits to even report information from an interrupt service routine where the scheduler is usually frozen. The library makes no assumptions about how messages are consumed. The default behavior is to send it using the User Datagram Protocol (UDP) to a stated address. Using this scheme a relay logger mechanism was developed, allowing to combine, collect and store messages arriving from different machines. Figure 4.3 shows a design where messages are produced in a private network and subsequently broadcasted to a data persistence node and a live information system. Since a system can produce hundreds, or even thousands, of information messages per day, a Java application that organizes messages accordingly to user defined criteria has been developed. Messages are grouped first by producer, where each machine has a node in a tree, and inside every node, messages are grouped by: severity, thread and object producer name. Filtering enables control room users to follow only a narrow subset of messages (e.g., messages with a particular alarm level from a specific object in a subsystem). 4.1.2 Multithreaded Application Realtime executor (MARTe) MARTe is a modular collection of a series of components that permits the system to work as a whole [4]. Some of the blocks are intended to be further adapted to the target application, while others are expected to be used as provided. 4.1.2.1 Generic Application Module The atomic element of MARTe is named Generic Application Module (GAM) and all applications built using the framework are designed around these components. A GAM is a class inheriting an interface specified in the BaseLib2 library. Each GAM contains three communication points: one for configuration and two for data input and output. GAMs are setup us- 67
4 Technical solutions and implementation 4.1 The MARTe Framework Figure 4.3: Relay logger mechanism. Messages are automatically relayed across networks, allowing to add new logger nodes as required. In this figure messages are produced in the acquisition network and further relayed to a node responsible for data persistence and another node for live visualization. ing the standard BaseLib2 configuration syntax described in the previous section. The core of a typical GAM processes the input accordingly to how it was configured and outputs the modified information. Conceptually GAMs are equivalent to a block in a standard block diagram Figure 4.4. During initialization the modules declare what data they expect to receive and what information is going to be produced in output. Each type of input or output is declared as a configurable named signal with a data type associated. This is the only available way to chain GAMs and provides a clear boundary in the system: GAMs are not aware of the presence of other 68
4 Technical solutions and implementation 4.1 The MARTe Framework C u P y v H D read(v) write(u) GAM C D B read(u) write(y) read(y) write(v) GAM P GAM H TIME Figure 4.4: Conceptual passage from a block diagram to a MARTe architecture. modules. The GAMs which interface with hardware are named IOGAMs and provide a unique high level interface. The connection between the IOGAM and 69
4 Technical solutions and implementation 4.1 The MARTe Framework the specific low level code responsible for driving the hardware is performed through the specialization of a high level class named Generic Acquisition Module. This interface requires the number of hardware inputs and outputs to be specified and forces the existence of a reading and a writing function. These functions must be implemented for each kind of I/O device, although it is common that devices belonging to the same family are able to share a common acquisition module. These high level interfaces to the hardware can usually be configured to return the latest acquired value or to wait for a new sample to arrive (at the cost of delaying the execution), depending on the requirements of the application. Another important feature in MARTe is the ability to perform simulation without interfering with the plant. Although this greatly depends on the target project, it is usually possible to model up to some extent the process to be controlled, and a GAM can be used to simulate the inputs (possibly using real signals saved beforehand) and another to predict the output of the system. This arrangement permits to debug and tune all the other modules, or to test the possible effects that a change in a module configuration will produce. On the live system the simulation modules can later be swapped with the real interface to the hardware. This technique has been used for instance in the development of a simulator for the JET Vertical Stabilization system [53]. Data is transferred between GAMs by using an optimized memory bus named Dynamic Data Buffer (DDB). The first role of this entity is to ensure coherency across the system, verifying if all the signals requested by each of the GAMs are produced by one module and in case of any inconsistency issue an error during the initialization phase. Although it is not the default behavior, a GAM may write over a signal already produced by another module. This process, named patching, must be explicitly requested otherwise it is assumed as an error. 70
4 Technical solutions and implementation 4.1 The MARTe Framework MARTe also provides a collection of GAMs to send signals between different systems, even in different machines. Depending on the system, real-time may only be guaranteed on the producer, unless using a realtime network such as RTNet [54, 55]. The RealTimeThread is a container of GAMs and acts as a GAM microscheduler being responsible for their sequential execution. The thread can be configured to run on a specific processors and can be assigned to a specified priority. It also tracks execution times and keeps a series of internal timing information about each of the GAMs for which it is responsible. The list of GAMs that are executed can be changed accordingly to the state of the system as provided by a BaseLib2 State Machine as described earlier. Depending on the severity of an error, the RealTimeThread can be configured to take an action, which could be the complete stop of execution, or to switch the execution to a series of safety GAMs. MARTe must contain at least one real-time thread. When designing a new system one of the major challenges is to decide what GAMs, and in what order, are to be executed. Figure 4.5 depicts a possible set of modules that start by acquiring signals from an hardware device, then processing and taking decisions upon this data, and finally outputting the signals to both a device and a storage scheme. Threads can be configured to run at a specific frequency and all the GAMs are expected to execute within this time. A warning or an error is issued everytime the execution time is larger than the specified cycle period. MARTe requires the existence of at least a timing source. A shared variable in the RealTimeThread tracks the absolute time in microseconds. Depending on the project, this time is usually expected to be updated by an external hardware through an IOGAM, although sometimes the CPU clock can be used, particularly when developing and debugging a new project. 71
4 Technical solutions and implementation 4.1 The MARTe Framework Figure 4.5: The RealTimeThread acts a module micro-scheduler. In this figure a group of seven GAMs is executed at each cycle. The first GAM acquires data from a device and outputs it to the memory data buffer. Once processed some of the data is written back to the hardware. MARTe provides ready made high precision time emulators, based on the CPU time and optimized for each of the supported operating systems. A new control cycle is started when the absolute time is a multiple of the requested cycle period. The previously described acquisition module also forces the presence of a synchronization function. When configuring MARTe one chooses if this synchronization module has to work in interrupt or polling mode. In the first case the execution of MARTe is arrested up to the arrival of an external interrupt. If polling is selected the system will continuously query the interface until an answer is provided. In both cases when an answer 72
4 Technical solutions and implementation 4.1 The MARTe Framework arrives the absolute time is updated and the framework checks if a new cycle is to begin. As this is one of the most delicate parts of the system a series of checks and timeouts can be configured. The system designer must decide what actions to perform when a timeout or error occurs. MARTe is also able to handle a collection of RealTimeThreads. These can either be configured to run concurrently on the same processor or in parallel. The only way of sharing data between threads is to use a special IOGAM (provided by the framework) as the output of the thread producing data, connected to an input acquisition module in the thread consuming it. For MARTe these two synchronization GAMs emulate the presence of a physical hardware which would produce and consume the data, allowing to have the two threads completely decoupled. The output module can also be used as the timing source for the driven thread and can be configured to send undersampled filtered data, allowing to specify different running frequencies. MARTe can send and receive messages using the BaseLib2 message protocol described earlier. MARTe internal services are started and stopped upon the reception of a specific message. The interface is designed to be connected to an external object that is able do decode an external configuration protocol, for instance from a human machine interface, into a MARTe recognized message. This is the preferred way to change the list of modules to be executed and to update GAMs parameters. After receiving a message, the framework verifies its validity and forwards it internally. If reconfiguration is required the threads being executed are eventually stopped. MARTe uses the HTTP server provided by BaseLib2 and supplies a collection of HTTP based components that allow to setup a communication channel with all the internal elements. Examples of these utilities are 73
4 Technical solutions and implementation 4.1 The MARTe Framework a remote configuration file upload and a signal server to download data acquired during a certain period of time in CSV or MATLAB binary format. Live diagnosis of threading and memory activity are also available, together with the list of all the registered objects. All the GAMs that expose information are also highlighted. 74
4 Technical solutions and implementation 4.1 The MARTe Framework 4.1.3 Code generation via SysML Modeling languages, such as the Unified Modeling Language (UML), help the designers to foster the design and understanding of complex systems. The Systems Modeling Language (SysML) [56] extends the UML, intending to unify the various modeling languages used by systems engineers. In particular, SysML extends the application of UML to systems which are not purely software based, and can in particular be applied to design heterogeneous embedded systems. SysML also introduces a requirement diagram to structure the requirements and link these to the system architecture and test procedures. During the last decade UML and SysML have been used to promote model driven development in different fields, such as manufacturing systems [57, 58], electronic systems [59], embedded systems [60, 61, 62], and automotive [63]. In particular in [57], Thramboulidis extends the UML to define the Model Integrated Mechatronics paradigm. Such a paradigm supports the model driven development of complex mechatronic systems, and it has been used to develop a system platform called Archimedes that permits to automate the development process of manufacturing systems. A recent extension that uses SysML to model industrial automation control systems is presented in [64], while [61] also deals with an application of model driven engineering to real-time automation systems. Furthermore, SysML has been adopted in [58] to formally specify mechatronics systems; such a description is then used to generate models to be used for the verification of the automatically generated embedded control code. A similar approach to automatically generate models from a SysML description has been presented also in [65]. More recently, the authors of [62] have used UML to propose model driven approach for the analysis of the so-called dynamically partially reconfigurable systems (DPRS), which are embedded system realized with an 75
4 Technical solutions and implementation 4.1 The MARTe Framework FPGA device with the capability of being partially reconfigurable. These systems enables more applications to be accelerated in hardware, making possible to reduce the overall system execution time. Due to all this interest in the SysML language it was decided to develop an automatic model-to-marte system. In fact GAM configurations can be easily stored into text-file, as well as a number of makefiles that are needed to compile the real-time application on different targets. Moreover by using SysML a better system documentation is achieved. It was decided to use a subset of the diagrams SysML provides, in particular: internal block diagrams are used to specify the internal structure of GAMs; this allows to explicitly show the distinction between GAM internal parameters and input/output signals, which enhance the selfdocumentation of the project; interdependency among GAMs is explicitly represented by means of block definition diagram that show the interconnections between the various module, also enhancing the overall project documentation. Having proposed a model driven approach to design a MARTe application, is then possible to use model 2 text tools to automatically generate part of the real-time code and of the configuration data, together with make files for the compilation on different platforms. To this aim Topcased has been adopted as modeling tool, since it integrates the model 2 text tool Acceleo. Topcased is a system/software engineering toolkit which complies with the requirements of critical and embedded applications [66]. First of all a BaseLib2 model containing all the common definitions (classes, types, etc.) needed to model GAMs (see Figure 4.6) has been developed. 76
4 Technical solutions and implementation 4.1 The MARTe Framework (a) Excerpt of the BaseLib2 modeled classes. (b) Excerpt of the BaseLib2 modeled data types. Figure 4.6: Block definition diagrams used to model the BaseLib2 library. Once the BaseLib2 model has been imported in a new Topcased project, the first step to model GAMs is to define them by using a BDD. An example is shown in Figure 4.7, where three GAMs are defined: a simple 77
4 Technical solutions and implementation 4.1 The MARTe Framework Figure 4.7: Example of GAMs modeling. The block definition diagram reported in this figure is used to define three GAMs and to add to them the HTTP server, which is implemented by the HttpInterface block. PID controller, a WaveformGenerator that generates the control reference, and a Plant block, which simulates the plant behavior and can be used to perform offline tuning and validation of the controller. The three GAMs reported in Figure 4.7 inherits also from the HttpInterface abstract class; this block is included in the BaseLib2 library and is used to add HTTP user interface capabilities to a generic block. This scheme enables GAMs to publish run-time execution information about the internal state of algorithms and data. When modeling a GAM it is possible to add internal parameters (e.g., controller gains for the PID in the proposed 78
4 Technical solutions and implementation 4.1 The MARTe Framework Figure 4.8: Internal block diagram used to define input and output signals for the PID GAM shown in Figure 4.7. example) and to extend the interface (e.g., the GenerateReference() function for the WaveformGenerator GAM). The definition of the internal parameters can be easily done by using an IBD, as shown in Figure 4.8, where the internal structure of the PID GAM is modeled. Moreover IBDs are also used to model input and output signals of a given GAM. Input and output names shall match channel names into the DDB, while the distinction between inputs and outputs allows to clearly identify the producers and consumers of each signal. By using the Topcased modeling tool, it is also easy to add comments and expression objects to a GAM model, in order to add comments to GAM parameters and signals, and to specify initial values, respectively (see Figure 4.9). This feature is also exploited to add comments and initial values to the automatic generated code. Once all the GAMs within a project have been modeled, BDDs can be used also to define interconnections between them. Such interconnection implicitly defines the execution order of the GAMs chain by the Real-time Thread.. Figure 4.10 shows the GAMs chain for the simple example described in the previous section. In particular, two additional GAMs (ADC and DAC) have been added to model the data acquisition boards of this simple realtime control system. In Figure 4.10 the Plant GAM has not been chained, 79
4 Technical solutions and implementation 4.1 The MARTe Framework Figure 4.9: Topcased hierarchical view of the model of the PID GAM block shown in Figure 4.7. Figure 4.10: Block definition diagram used to model the connections between GAMs. 80
4 Technical solutions and implementation 4.1 The MARTe Framework since this BDD models the behavior of the real system to be deployed, which therefore does not include the plant simulation. Starting from the SysML model of the MARTe application to be deployed, which consists of the definition of the GAMs and of the GAMs chain, the Acceleo tool can be exploited to automatically generate a large part of the whole real-time source code, configuration and makefiles for multi-platform compilation. Acceleo is a code generator tool which transforms models into code, and it has been designed to improve software development productivity. Its approach deals with many concepts grouped together under the name Model Driven Architecture (MDA), which is obviously coherent with mode driven approach proposed in this work. Although MDA is currently being standardized by the Object Management Group, there is a lack of effective and operational tools. Acceleo results from the best practices and experience feedbacks from the use of MDA in the industry, and it is fully integrated into Topcased. In particular, it is easy to develop Acceleo plug-ins for Topcased. By using the Acceleo plug-in, the SysML model is parsed and the following files are produced for each GAM, each one in its own subdirectory: the GAM C++ source files (.h and.cpp); the header files containing the input and output signals for easier interfacing with the DDB; additional files for multi-platform compilation (including make files); the GAM configuration file. Moreover, the top level MARTe configuration file (including all the GAM-relevant configurations previously generated) is also produced. 81
4 Technical solutions and implementation 4.1 The MARTe Framework 4.1.3.1 Sample application to the FTU Tokamak As an example of application of the model driven approach, the plasma control system of FTU has been modeled, and a large part of the code for the real-time system has been automatically generated. The Frascati Tokamak Upgrade is a medium size Tokamak (minor and major radius of the chamber are, respectively, 0.31 and 0.935 meters) operating since 1990 at the ENEA laboratories of Frascati, in the south of Rome (Italy). FTU is capable of discharges of up to 1.5 seconds of length with a toroidal field of 8T. The magnetic field responsible for plasma shaping and current drive, is generated by four different amplifiers that feed a coils system that surrounds the tokamak vacuum chamber. In particular, two amplifiers, named AL-F and AL-V, are used for the horizontal position control (the former, faster, is in closed loop, while the latter is usually operated in feed-forward), while the AL-H amplifier for the vertical one, and AL-T for the plasma current. 1 0.8 0.6 FI HI T2 T3 HE V FE 0.4 0.2 0 T1 0.2 0.4 FI 0.6 FE T2 V 0.8 HI HE T3 1 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 Figure 4.11: Cross section of the FTU Tokamak. 82
4 Technical solutions and implementation 4.1 The MARTe Framework Figure 4.11 and Figure 4.12 show a cross section of the FTU tokamak toroidal vessel. The vacuum chamber sits in the middle of the figure, while the coils lay around it, named following the amplifier to which they are connected (F, V, H and T). Figure 4.12: FTU vacuum chamber. The block diagram of the plasma control system of FTU is reported in Figure 4.13. The blocks in light grey represent the actuators and the plant, the white one is the algorithm which reconstructs the plasma shape from the magnetic measurements, the oval blocks are the references and the feedforwards for the actual control systems, whose main blocks are depicted in dark grey. The plasma control system is divided in two main parts: the gas control system, which regulates the density of the plasma; and the plasma current and position control system, which is made by three PIDs (the vertical 83
4 Technical solutions and implementation 4.1 The MARTe Framework Gas preprog. value Density Controller Gas Valves Direct/Reflected Power Pos. ref. values H Controller F Controller Allocator Current Amplifiers Plant Magnetics LLL Temps Ip Plasma Shape z r T Controller F H V T I preprog. values r* Extremum Seeking Algorithm z,r LLL Temp. Controller Figure 4.13: Block diagram of the FTU plasma control system. position feedback, which uses the AL-H amplifier, the horizontal one, which uses the AL-F amplifier, and the AL-T controller which drives the plasma current to the requested value). The AL-V amplifier is operated in openloop 2. The feedback quantities for AL-F and AL-H (called DEP and DEZ) are the flux errors measured on the horizontal and vertical axis of the vacuum chamber, and are proportional to the plasma position error. Those quantities are evaluated from the magnetic measurements by the realtime Last Closed Magnetic Surface estimation algorithm, Plasma Shape in Figure 4.13 (see Tutorial 7 in [67]). The plasma current and position control system is also augmented by three nonlinear controllers: the temperature controller for the experimental liquid lithium limiter (in development), an extremum seeking algorithm 2 It should be noticed that open loop is intended only concerning the FTU Feedback System: in fact all the amplifiers have an internal control system which drives the output current to the reference value, so, strictly speaking, no one of them is actually operated in open-loop. 84
4 Technical solutions and implementation 4.1 The MARTe Framework for LH power optimization [68], and an allocator algorithm used to control plasma elongation [44]. Figure 4.14: BDD of the FTU plasma control system. In order to revamp and improve the FTU control systems, it was decided to reimplement it from scratch leveraging the MARTe Framework [4]. To do so the PCS has been packaged in small self-contained pieces which could be wrapped as GAMs. The final result of this packetization is shown in Figure 4.14. Note that the PCS reported in the figure is a simplified version, as the safety and scheduling modules which had to be produced for a reliable operation of the device were added at a later stage. Each block 85
4 Technical solutions and implementation 4.1 The MARTe Framework in Figure 4.13 has been translated in a single GAM. As the AL-F PID has a different behavior than the other ones (more precisely it has been upgraded with an antiwindup system in order to avoid low current oscillations [69]), instead of using various instances of a single and standard PIDGAM, it has been decided to develop three different PID-based controllers to leave room for future improvements. Figure 4.15: Auto-generated files for the FTU Plasma Control System. The BDD diagram shown has been then fed to the developed Accelleo plugin in order to generate the boilerplate code. In Figure 4.15 we show the amount of files automatically produced. The vast majority of standard code, as well as a simple master configuration file, has been generated, greatly reducing development time. In particular about 60% of the code has been automatically generated, most of which was the one relative to the initialization and visualization of each GAM s parameters (i.e. the most error-prone code). The only code which had to be actually written was the scientific one, i.e. the algorithms themselves. 86
4 Technical solutions and implementation 4.2 The JET systems 4.2 The JET systems 4.2.1 The Vertical Stabilisation system As shown in a previous chapter, in order to obtain better fusion performances the plasma is forced to be vertically elongated, unfortunately becoming unstable [70], thus needing closed loop control. The aim of the Vertical Stabilisation (VS) system is to control the instability by driving the current in a set of Poloidal Field (PF) coils so that a radial magnetic field is produced. The lose or erroneous control of the instability can have huge negative impacts, as plasma disruptions (complete loss of thermal and magnetic energy) may occur, inducing large currents and forces in the machine vessel. An international project for the upgrade of the JET plasma control (Plasma Control Upgrade, PCU) [71, 72] allowed to greatly enhance the current VS system. The project has seen the development of new modeling techniques for the analysis of the vertical instability, as well as numerous technological improvements, concerning in particular the control system (with a complete upgrade using the MARTe Framework) and the new power supply ERFA (Enhanced Radial Field Amplifier). The hardware-software requirements for the upgrade were the execution of the closed loop cycle within 50 µs with a maximum jitter of 2.5 µs, including the interface with hardware and data processing. An application fulfilling these requirements was designed using the MARTe framework, where a multi-disciplinary team contributed to the different parts of the system: hardware and software engineers developed the integration with hardware and the overall setup of the system, while control engineers produced the GAMs for modeling and control. Although JET is a pulsed machine, with experiments that can last up to 2 minutes and where the presence of the VS system is vital, it was decided from the beginning to have the vertical stabilization always running and 87
4 Technical solutions and implementation 4.2 The JET systems guaranteeing real-time, making no distinction between operational phases. This is particularly relevant for future fusion devices like ITER [73], where subsystems will have to adapt to a steady state operation reality. This was also only possible since no pulse-based assumptions were made in the design of the framework. 4.2.1.1 The Vertical Stabilization hardware The system runs on a Intel Quad-Core processor and uses the RTAI implementation [74], with a standard Linux kernel option (isolcpus) to explicitly assign interrupts and Linux tasks to a single core, breaking the symmetric multiprocessor scheduler decisions. All MARTe threading activity is placed on the remaining three cores, allowing one to be completely dedicated to the RealTimeThread. This single feature immediately guarantees that no external activity or spurious interrupts will deviate the realtime system from its high priority activities. It is important to notice that all these configurations are completely transparent to MARTe and no code modifications had to be performed, not even to change in which cores threads should run or how memory should be arranged. The downside of this implementation is that, living in kernel space, software faults have large impacts on the system, making it very hard to debug problems that are not closely related to the framework, mainly in the GAMs algorithms. This is where the multi-platform configuration proves to be a powerful mechanism as all the code can be tested as is in more friendly environment like userspace Linux or MS Windows. The hardware of the data acquisition system is based on the PICMG 3.0 Advanced Telecommunications Computing Architecture (ATCA) standard and contains 6 data acquisition cards. Each board comprises 32 18-bit resolution analog to digital converters acquiring at 2Msamples/s. The cards are connected to the controller computer using the Peripheral Component 88
4 Technical solutions and implementation 4.2 The JET systems Figure 4.16: Photo of the backpane of the VS5 ATCA crate. Interconnect Express (PCIe) point-to-point links through the ATCA backplane [75]. A rear transition module (RTM) connects the system to the radial field amplifier ERFA (for a picture of the crate see Figure 4.16). When designing the hardware interface driver for the data acquisition system it was decided to use an interrupt-less environment with a data polling scheme, but without compromising the other interfaces to the computer, e.g., network access. The data acquisition boards, map in the controller computer memory a set of four buffers as described in Figure 4.17. The selected buffer is consecutively cycled every 50 µs by the firmware. The first value written is the header and contains the absolute time since the 89
4 Technical solutions and implementation 4.2 The JET systems last trigger, followed by the values of the ADCs and finally by the footer containing the same value as the header. The driver continuously queries the value of next header to be written and as soon as it changes, it starts to check the footer. When these two values are the same, the driver signals the high level IOGAM, which in turn broadcasts and updates MARTe absolute internal time. The framework uses the values provided by the high resolution timers of the processor to measure the performance of the system and to keep track of the jitter associated with the synchronization mechanism. The firmware also assures synchronization between all boards. network and other I/O interrupts Core #1 Linux Core #2 MARTe Services HTTP server Logger... Core #3 MARTe Services Core #4 RT-Thread CPU Master board 18000 18050 17900 17950 18000 18050 17900 17950 100 32 us 32 ADCs ago ADCs 100 100 us us ago us ago 50 32 us 32 ADCs ago ADCs 50 50 us us ago us ago 200 32 32 ADCs us ago ADCs 200 200 us us ago us ago 150 32 us 32 ADCs ago ADCs 150 150 us us ago us ago 18000 18050 17900 17950 18000 18050 17900 17950 Figure 4.17: Data synchronization of the ATCA boards is performed in the master board, which is guaranteed by the firmware to be the latest to have data available. Once new data is available it is collected and a new MARTe cycle starts. The CPU core isolation scheme allows to protect the real-time environment from spurious and undesired interrupt sources. 4.2.1.2 Interfacing with JET The JET Control and Data Acquisition System (CODAS) [76] is the entity responsible for providing control, monitoring and data acquisition to all the existent subsystems. As a JET subsystem, the vertical stabilization uses the tools provided by CODAS, both for plant configuration and 90
4 Technical solutions and implementation 4.2 The JET systems data retrieval. Between pulses, experts are allowed to change the system configuration by mainly updating values in the different GAMs. This is performed using the standard user interface of JET (Figure 4.18) which contains several access layers and where expert users and engineers are allowed to upload configuration files for each of the modules. VS operators are expected to act on a upper layer where atomic values are validated and have already a unique and direct physical meaning. As of today and with configuration files that can easily have more than 7000 lines, the requirement for an advanced user-interface was almost compulsory, allowing to capitalize all the VS experimental advanced features [13], minimizing the risks of configuration and regression faults. 4.2.1.3 Vertical Stabilization GAMs The design of the new system has been carried out following a model based approach [9], which turns out to be essential when high performance and robustness are required. In particular, such an approach has been adopted for: the design of the new power supply for the RFA circuit, called Enhanced Radial Field Amplifier (ERFA), to assess the system performance for different choices of the amplifier s maximum voltage and current [72]; the assessment of the best choice for the turns setup of the RFA coils; the design of the new VS control algorithm, to optimize the controller parameters for the different operative scenarios. Thanks to the availability of reliable linear models for the plasma magnetic behavior [36, 37], a validation phase has been carried out for each design step, from conceptual design to implementation. Scenarios with highly elongated plasmas in presence of large ELM perturbations are envisaged to achieve better fusion performance in tokamaks. 91
4 Technical solutions and implementation 4.2 The JET systems Figure 4.18: JET LEVEL1 interface for the new Vertical Stabilisation System 5. In these extreme scenarios a general purpose controller 3 cannot guarantee the requirements. Hence, to push the performance up to the desired level, it is usual to rely on a model based design approach [9], which assures the needed control performance. In particular, for each plasma scenario, it was envisaged that the JET VS system could potentially use different estimations of the plasma vertical velocity, as well as different adaptive algorithms for the controller gains, in order to optimize the system behavior. 3 We refer to general purpose controller as a controller which is robust enough to satisfactory work under any envisaged operational scenario, without pushing the performance to the best. In particular a general purpose controller should at least do not disrupt the plasma for almost all the possible operational scenarios. 92
4 Technical solutions and implementation 4.2 The JET systems The architecture proposed for the VS system is similar to the one adopted for the extreme Shape Controller at JET [31, 34, 30]. In particular, it permits to face with different scenarios during the same experiment in a simple manner. However, since the controllers are optimized, there must be a safety logic that, in case of unexpected dangerous events, switches to the general purpose controller, in order to get a safe termination of the experiment. Since control algorithms are usually developed in a modeling and simulation environment (e.g. Matlab/Simulink), another requirement for the new VS software architecture concerns the possibility to check and validate the whole real-time code (including both the control algorithm and the auxiliary code, i.e. communication interface with other systems, data acquisition, etc.) before testing it on the plant. To perform this offline validation real-time computational model of the plant, based on detailed plasma linearized models [36, 37] are needed. It turns out that the adoption of a flexible and modular software architecture is mandatory for the VS implementation, in order to successfully cope with the functional requirements summarized above. Indeed, the old VS system, based on 4 Texas Instruments DSPs (TMS320C40), was not flexible enough to satisfy the requirements. As an example, the present control system has been used to carry out some preliminary experiments aimed to confirm the simulation results. To perform these tests the needed modification had been applied as patches to the normal control mode, since it was not possible to isolate the control algorithm from the remaining part of the software. It turned out that, given the limitations of the present architecture, anytime a new functionality was required its implementation was not straightforward, mostly due to this lack of modularity, which is always needed in a real world control application. The overall system is composed of a collection of 18 modules. The first GAM synchronizes and retrieves data from 192 ADC channels which 93
4 Technical solutions and implementation 4.2 The JET systems are then written into the DDB. Using some of these signals, the second GAM produces a series of synthetic data, like threshold detection and linear combinations of magnetic signals. ObserverGAM subsequently provides an estimate of the plasma vertical velocity, followed by a scheduler module deciding which of the following GAMs must be executed. Four controller GAMs are then sequentially executed and only the one previously selected by the scheduler, through a signal in the DDB, performs real work. Two modules, named vertical and divertor amplifier, are allowed to override the output of the controller with some special features, like dither or hysteresis, and are run before calling the module responsible for writing the output back to the DAC and close the loop. A collection of 6 different GAMs acquire in memory the data for each type of signal: ADC, controller, debug, performance, waveforms and asynchronous. Finally, a module performing live statistics of configured signals is executed. The scheme is depicted in Figure 4.19 and mean values for the time of execution of these application modules, reported in Table 4.1. The architecture of the new JET VS system has been conceived to operate in advanced plasma scenario, where different estimations of the plasma vertical velocity must be available in order to optimize system performance. For these reason, the ObserverGAM has been designed as a container of ten different observers which computes different estimations of the plasma vertical velocity. An observer receives as input a set of measurements and a transformation matrix. The resulting outputs can be used as inputs for other observers, in a daisy chain design, enabling the eventual reuse and optimization of some calculations. The observer computational interface can be extended and specialized in order to meet and model specific requirements, loosing in flexibility but leveraging configuration and functionality. One example is the state space model observer [77], where instead of specifying one anonymous matrix, the 94
4 Technical solutions and implementation 4.2 The JET systems Figure 4.19: All the modules executed for each control cycle by the RealTimeThread. The first module provides the synchronization with the hardware. All the code must be executed in less than 50 µs. end-user is expected to provide the matrices with a direct correspondence to the observer dynamic model. As for the ObserverGAM, the Controller GAM has been conceived as a container of four different control algorithms which are available during whole pulse. Thanks to this choice, it is possible to meet the requirements in terms of disturbances rejection and thermal losses in the RFA circuit, by selecting the optimal controller in each phase of the pulse. Furthermore this architectural choice permits to safely validate new control algorithms on the plant by running them in open loop during the experiments. 95
4 Technical solutions and implementation 4.2 The JET systems 10 9 GAM Execution times (#78210) Maximum Minimum Mean 8 7 Execution time (us) 6 5 4 3 2 1 0 ATCA ADC and synchronisation Signal Processing Observer Scheduler Controller 1 Controller 2 Controller 3 Controller 4 Vertical Amp. Module Divertor Amp. Module ATCA Output ADC Collection Controller Collection Debug Collection Performance Collection Async. Collection Waveform Collection Web statistics Figure 4.20: Maximum, minimum and mean execution times for all VS5 GAMs. There are a number of inputs that are common to all the control algorithms (i.e. the plasma velocity estimations and the current in the RFA circuit). Moreover, each algorithm can have its own input signals. The selection of the plasma vertical velocity to be used for the control is made on the basis of the scheduling signal provided by the Scheduler GAM. The control algorithms can implement any linear or nonlinear control algorithm, provided that the computational effort is achievable. However each control algorithm must satisfy two basic requirements: control of the plasma vertical velocity, in order to achieve vertical stabilization; control the current in the RFA circuit to avoid current saturation and 96
4 Technical solutions and implementation 4.2 The JET systems Table 4.1: The execution times of the VS application modules. GAM Mean (µs) Std. dev. (µs) ADC 2.43 0.26 Signal processing 5.14 0.01 Observer 4.00 0.04 Scheduler 0.37 0.01 Controller 1 1.01 0.02 Controller 2 0.31 0.01 Controller 3 0.28 0.02 Controller 4 0.26 0.01 Vertical amplifier 0.85 0.03 Divertor amplifier 0.59 0.02 DAC 0.39 0.02 Data collection 1 2.83 0.07 Data collection 2 0.84 0.05 Data collection 3 1.46 0.34 Data collection 4 1.08 0.02 Data collection 5 0.92 0.04 Data collection 6 0.74 0.06 Statistics 1.24 0.02 to reduce the thermal losses in the coil. In the current version of the JET VS system the plasma velocity regulator is a proportional controller while a proportional integral regulator is used for the current in the RFA circuit. The controller gains are varied during the experiment on the basis of some additional signals (e.g. the temperature in the ERFA). 97
4 Technical solutions and implementation 4.2 The JET systems The VAMGAM is executed immediately after the controllers and selects the desired controller output, on the basis of the scheduling signals. Before sending it to the ERFA, the selected voltage request can be further processed by a series of components: a Dither module, a Delay module, a Kicks module and a Relay Characteristic. The Dither component adds a sawtooth waveform to the selected voltage request. This feature is used to reduce the effect of the voltage quantization. Indeed ERFA is composed of four units each rated 3 kv, 5 ka, which can be configured to deliver 12 kv, 5 ka [78]. The Delay module is used to delay the voltage request by a given number of time samples. The resulting delay introduced in the system has been used to estimate stability margins during dedicated tests [79]. The Kicks module is the most innovative component of the VAMGAM. It implements all the various types of kicks, voltage pulses of a given length and amplitude, used mostly to drive Vertical Displacement Event (VDE) or for ELM pacing. Each kick is made by a kick waveform and of a kick type. The former describes the voltage waveform to be applied by the kick component, while the latter decides when to apply the waveform itself. A kick waveform is defined as a sequence of time windows, each one specifying the following parameters: the duration (in seconds) of the time window; the amplitude (in volts) of the window; the kick modality which can be set either equal to ON, to apply in feed-forward the amplitude of the current time window, substituting the value calculated by the controller; 98
4 Technical solutions and implementation 4.2 The JET systems OFF, to ignore the amplitude specified and to turn off the kick logic in the current time window; ADD, to add the amplitude specified to the value calculated by the controller); the time, which can set equal to DEFAULT, to use the value specified by the length parameter as duration of the current time window; WAVEFORM, to use the values specified by a given waveform as duration of the current time window. By using the kick waveform and the kick type parameter a very high level of customization is achieved, allowing the user to specify: timed kicks which are kicks applied at a precise time during the experiment, and which are used to simulate Vertical Displacement Events (VDEs) and to perform halo currents studies [80]; periodic kicks, used for ELM pacing [81]; H α kicks which are triggered at the occurrence of an ELM, and which are used to switch off the controller during an ELM phase; saturation kicks, which are used as protection system when the amplifier current reaches the safety threshold, i.e. when the current is close to the saturation. If this is the case the current is moved far from saturation by using voltage kicks. Finally the Relay Characteristic module implements the same variable hysteresis logic of the power supply ensuring that the correct voltage is applied by the amplifier even in presence of noise or not perfect calibrated DACs. 99
4 Technical solutions and implementation 4.2 The JET systems The DAMGAM is a module created in order to let the VS system act on the divertor coils, which are normally controlled by the Shape Controller [3]. In particular the DAMGAM made possible the application of voltage kicks to the divertor coils. Divertors space SC request for D1 SC request for D2 SC request for D3 SC request for D4 Voltage request for D1 Voltage request for D1 Voltage request for D1 Voltage request for D1 Transformed (P) space JG09.365-6c Figure 4.21: The internal logic of the DAM. A block diagram of the DAMGAM is shown in Figure 4.21, where P is a 4-by-4 invertible matrix which defines a linear transformation that maps the four divertor voltage requests received from the Shape Controller into a custom P-space. In this space a gain and a saturation can be applied to each signal, and the transformed signals pass also through a kick controller which works in almost the same way as the VAMGAM module. Eventually the signals are transformed back in voltage requests to the divertor amplifiers. Thanks to its highly configurable structure the DAMGAM can be effectively used to explore all the possible interactions and advantages of using also the divertors for the task of the vertical stabilization. 4.2.1.4 User Interface Two main graphical interfaces are available, namely the Level 1 Interface (L1-Interface), provided by CODAS, and the Web Interface. The former allows the user to setup all the VS system parameters before the experiment, while the latter permits to monitor the state of the system during the experiment. 100
4 Technical solutions and implementation 4.2 The JET systems The structure of the L1-Interface is made of several graphical layers, each one corresponding to a different level of abstraction. Such layers are organized in two levels: Real-time executor level, which allows the user to load the MARTe configuration. In particular, the user can specify the GAMs to be executed together with their parameters, specifying them by means of text files. It is important to note that this level is common to all MARTe-based applications. Application level, which is customized for the VS system. This level is designed to allow the user to set each controller parameter before the experiment. The Real-time executor level is made of three different graphical pages: the MARTe Layer page, which is used to setup the interfaces between MARTe and the other external systems; The MARTe Thread Layer page, where the user can load all the GAMs that make up the real-time system to be deployed. In particular for the VS system all the GAMs are loaded from this page, together with their configuration files. The Patch page, which is used to change the default values of the system parameters. The Application level deployed for the VS system is made of two graphical pages: The General page, which is used to set the parameters of the controller. In particular this page is organized in four subsections, each one corresponding to one of the following module: SPGAM, Observer GAM, Controller GAM and VAMGAM. 101
4 Technical solutions and implementation 4.2 The JET systems The Scheduler page. This page is dedicated to the Scheduler GAM and allows the user to plan the experiment by setting the VS behavior in each of the 25 available time windows. For example, in each time window the user can choose the estimation of the plasma vertical velocity to be controlled together with the desired control algorithm. This page permits also to set the behavior of both the VAMGAM and the DAMGAM, and to switch on the kicks performed by these two modules. The Web Interface is based instead on the MARTe framework and it is automatically generated by the real-time application. This graphical interface allows the user to navigate into the GAMs structure and check the value of the parameters loaded in the VS system. A sample screenshot of the Vertical Stabilization Web Interface is reported in Figure 4.22. 4.2.1.5 First Results CODAS is collecting an average of 320 signals per pulse, amounting to several hundred of megabytes of data. The data collection modules can be configured to acquire several windows at different frequencies, but higher importance is given to the data acquired by the ADCs, as the magnetic signals can be used later for simulation and modeling purposes. The new vertical stabilization architecture has been running in parallel with the previous version of the system since the summer of 2008 and it was already used several times to control the machine in closed loop. Several consecutive weeks of operation are regularly achieved, with the system running and in real-time 24 hours per day. During these long operation periods the configuration was changed by the operators a considerable amount of times and the system proved to have the capacity to withstand and react to it with remarkable effectiveness. One of the major accomplishments regarding the software side of the 102
4 Technical solutions and implementation 4.2 The JET systems Figure 4.22: A screenshot of the VS5 Web Interface: the VAMGAM. project was the achievement of jitters well under 1 µs, as shown in Figure 4.23 where the standard deviation is 0.12 µs. These figures are always true, not only during the pulse, and were only possible due to key design decisions in the VS configuration, mainly the interrupt and processor isolation. Again, this was only possible due to the uncommitted way MARTe was designed, allowing to configure the system (e.g. threading) in a completely transparent way. The commissioning of the new VS system has been carried out at JET during the C26 experimental campaign. During the commissioning period the old control algorithm has been implemented on the new system, and ran in parallel with the old one. The first tests consisted in comparing the voltages requested made by the new VS controller with the ones provided by the old system, in or- 103
4 Technical solutions and implementation 4.2 The JET systems Figure 4.23: The system is continuously is real-time with a jitter inferior to 1 µs. In this figure 10 5 control cycles were performed and the error relative to the 50 µs is due to the imprecision on the time measurement (using the processor timers) and to the natural jitter associated with accessing a memory location. der to check the accuracy of the new references, and to verify if all the experimental features were being activated when requested. After gaining some confidence on the validity of the acquired data and on the software modules, the new VS started to close the loop in plasma during the ramp down phase, where the plasma current is smaller and the risk of actually endangering the machine very small. Finally, the first plasmas were controlled using the new VS system in different operational scenarios. No software failures were ever observed during the execution of an experiment. After this phase the new system has been employed during the C27 experimental campaign for the commissioning of the ERFA amplifier, and also to choose the optimum number turns for the coils in the RFA circuit. For this purpose, the performance of the vertical controller has been assessed not only with plasmas of varying vertical instability growth rate, 104
4 Technical solutions and implementation 4.2 The JET systems but also with different plasma wall clearance, q-profiles [6], etc. This has been achieved by means of the analysis of the response to controlled perturbations (vertical and divertor kicks) in as wide a range of configurations as possible. In order to avoid disruptions, the kicks durations have been assessed by means of closed loop simulations. As an example, in Figure 4.24 a comparison between experiment and simulation is shown. 1.0 VERFA 2000 IERFA Voltage (V) (10 4 ) 0.5 0-0.5-1.0 Experimental Simulated 23.05 23.10 23.15 23.20 23.25 Time (s) (a) Amplifier voltage. Note that after each positive kick there is a negative counter kick due to controller reaction JG09.365-8a Ampere (A) 1000 0-1000 Experimental Simulated -2000 23.00 23.10 23.20 23.30 Time (s) (b) Amplifier current. JG09.365-8b 2 Vertical velocity estimation (10 7 ) 0-2 -4 Experimental Simulated -6 23.05 23.10 23.15 23.20 23.25 Time (s) JG09.365-8c (c) Vertical velocity estimation. Figure 4.24: Experimental (solid black lines) and simulated values (dashed red lines) for 12 kv positive kicks applied during JET pulse #78376 starting from t = 23 s. 105
4 Technical solutions and implementation 4.3 The new FTU Feedback System 4.3 The new FTU Feedback System Recently effort has been put on the reengineering and porting of the old FTU feedback under the MARTe Framework. Considering the structure of the feedback system shown in Figure 4.13 in the previous chapter, a more organic structure for the system using various GAMs and limiting as much as possible the responsabilities of each one of them has been envisaged. The proposed GAM subdivision is reported in in Figure 4.25. Three GAMs manage the communication with the sensors and actuators (ADC and DAC), and generate the preprogrammed references requested by the users. The SignalProcessingGAM then verifies the plasma presence and diagnoses problems such as plasma runaway, gas immission failures, and so on. The 32 magnetic measures, together with the toroidal current an the V loop integral, are passed to the MomentGAM, which first evaluates and removes the pick-up toridal field offset from the acquired data, and then preforms the toridal multipolar expansion described in [82]. The 12 output signals (external and internal moments) are part of the inputs for the LCMSGAM and are also sent via RTNet [54, 55] to a satellite station whose aim is the evaluation of the plasma equilibrium using a realtime version of the ODIN code [83, 84]. The LCMSGAM calculates the poloidal flux on the limiter contact points, mixing the moments to the geometrical functions that describe the mesh 4. The absolute maximum value for the flux among the contact points is the one of the last magetic surface. The reconstruction of the LCMS is then carried out by iterating this process for all mesh points and stopping each time that the evaluated flux is greater or equal to the contact point one. The last set of inputs of the LCSMGAM are the preprogrammed radiuses 5, which are used to calculate the plasma position error in terms of Ψ (DEP and DEZ signals, for horizontal and vertical position error respectively). These two signals, together with the plasma 4 The actual mesh is made of 128 steps along the radius and 64 steps along the poloidal section 5 Internal, external, upper and lower desidered plasma radius 106
4 Technical solutions and implementation 4.3 The new FTU Feedback System current, are the inputs for the CoilsControllerGAM, which holds the controllers for the three poloidal field amplifiers, and the plasma current one. Before executing this GAM, however, the ExtremuumSeekingGAM, if active, optimises via an extremum seeking algorithm the plasma position, in order to maximise the coupling with the LH antenna [68]. The CoilsControlGAM is made by four PID controller objects 6. In FTU, the gas control is independent from the described process and is made by four GAMs: the PrefillControlGAM, the PlasmaDensityControlGAM, the SwapSignalGAM and the FluxVoltageGAM. The first two GAMs generate the gas flux request for the valves in the prefill and in the plasma phase respectively. The SwapSignalGAM schedules the control signals of the previous two GAMs, and finally the FluxVoltageGAM translates the flux request into the voltage reference for the valves amplifier using a nonlinear calibration curve. In FTU MARTe is being deployed using USB pendrives with a live linux distribution. This allowed to test and deploy different systems without needing to reinstall anything on the VME stations. 4.3.1 Experimental results The completed feedback system is being currently tested in the backup station, running in parallel with the previous feedback system. A comparison some produced signal of the old and new systems is shown in in Figures 4.26 and 4.27, while Figure 4.28 shows the behavior of the gas control system (in closed loop). 6 Note that it was necessary to merge the PIDs and the various nonlinear controllers in a single GAM, as their signals were heavily intertwined. 107
4 Technical solutions and implementation 4.3 The new FTU Feedback System A D C LHTube D A C R T N E T I N Odin Mesh0 Mesh0 Mesh0 Mesh0 Mesh0 LH Satellite Node ODIN Satellite Node RTNET Out LCMS Extremum Seeking Algorithm A D C & W A V E F O R M G E N E R A T I O N Vacuum Moment Signal Proc. & Offset Removal Scheduler Plasma State & Security Check On-Off GasControl LLL Temp. Controller PID Controller F and V Control PID Controller FluxVoltage GasControl Antiwindup System H Control Elongation Controller D A C & N O N R T S T R E A M I N G PID Controller T Control Main FeedBack System Figure 4.25: Block diagram of the MARTe FTU feedback system. 108
4 Technical solutions and implementation 4.3 The new FTU Feedback System Position [m] 0.656 0.654 0.652 0.65 0.648 RS1 MARTe 0.646 0 0.5 1 1.5 Time [s] Position [m] RS2 MARTe 1.235 1.23 1.225 1.22 1.215 1.21 0 0.5 1 1.5 Time [s] Position [m] 0.656 0.654 0.652 0.65 0.648 RS1 Current System 0.646 0 0.5 1 1.5 Time [s] Position [m] RS2 Current System 1.235 1.23 1.225 1.22 1.215 1.21 0 0.5 1 1.5 Time [s] Figure 4.26: Reconstructed internal and external radiuses for the present controller and the MARTe-based one. 109
4 Technical solutions and implementation 4.3 The new FTU Feedback System DEP MARTe 0.06 0.04 Ψ [Wb] 0.02 0 0.02 0.04 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 Time [s] DEP Current System 0.06 0.04 Ψ [Wb] 0.02 0 0.02 0.04 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 Time [s] Figure 4.27: Magnetic flux measurement Ψ, used as horizontal position error for the coils control. 110
4 Technical solutions and implementation 4.3 The new FTU Feedback System x 10 5 Prefill 3 Pressure [mbar] 2.5 2 1.5 1 0.5 0 10 8 6 4 2 0 2 Time [s] Plasma density Density [electrons/m 3 ] 60 50 40 30 20 10 0 10 8 6 4 2 0 2 Time [s] Valve control voltage 8 DAC voltage [V] 6 4 2 0 10 8 6 4 2 0 2 Time [s] Figure 4.28: Pressure and pressure prefill reference, plasma density reference and interferometer density average, valve amplifier request. 111
Chapter 5 Conclusions and future work In this Thesis various control problem in the field of nuclear fusion research have been illustrated, such as the Vertical Stabilization and the Shape Control problem. In particular work has been carried out on: The problem of vertical instability of elongated plasmas, which has been illustrated from a general perspective as well by detailing the solution to the issue carried out in the JET Tokamak, showing the control loop of the european Tokamak, and how the whole system has been revamped in the framework of the european PCU project; The MARTe Framework, developed in the same PCU project as the new JET Vertical Stabilization system; The JET Shape Controller, previously augmented with the extreme Shape Controller (XSC), which has been furtherly upgraded with a Current Limit Avoidance (CLA) module, capable of moving poloidal field currents away from saturations without excessive modifications of the plasma shape; The Frascati Tokamak Upgrade (FTU), in particular concerning the solution to the AL-F amplifier oscillating current output problem, and 112
5 Conclusions and future work on the revamping of the feedback system by porting it to the MARTe Framework). Most of the work done on the FTU Tokamak is still work in progress, and as such will be furtherly developed in the following years. This, together with a better documentation, improvements, and the ideation of tools for rapid control system development related to the MARTe Framework is of evident ITER-relevance, and the accumulated know-how will be reused as much as possible in the future development of the next fusion machines. 113
Bibliography [1] L. Giancarli, V. Chuyanov, M. Abdou, M. Akiba, B. Hong, R. Lsser, C. Pan, and Y. Strebkov, Breeding Blanket Modules testing in ITER: An international program on the way to DEMO, Fusion Engineering and Design, vol. 81, no. 1-7, pp. 393 405, 2006. [2] F. Piccolo, JET Vertical Stabilization System: Modelling and Control. PhD thesis, 2007. [3] F. Sartori, G. De Tommasi, and F. Piccolo, The Joint European Torus, Plasma Position and Shape Control in the World s Largest Tokamak, IEEE Control Systems Magazine, vol. 26, no. 2, pp. 64 78, 2006. [4] A. Neto, F. Sartori, F. Piccolo, R. Vitelli, G. D. Tommasi, L. Zabeo, A. Barbalace, H. Fernandes, D. F. Valcarcel, and A. J. N. Batista, MARTe: a Multi-Platform Real-Time Framework, IEEE Transactions on Nuclear Science, 2010. [5] J. Wesson, Tokamaks. Clarendon Press - Oxford, 3 ed., 2004. [6] J. Freidberg, Plasma Physics and Fusion Energy. Cambridge University Press, 2007. [7] J. D. Lawson., Some criteria for a power producing thermonuclear reactor, in Proceedings of the Physical Society, vol. 70, p. 6, 1957. 114
Bibliography [8] H. Alfvén, Existence of Electromagnetic-Hydrodynamic Waves, vol. 150, pp. 405 406, 1942. [9] M. Ariola and A. Pironti, Magnetic Control of Tokamak Plasmas. Springer, 2008. [10] A. Pironti and M. Walker, Fusion, tokamaks, and plasma control, IEEE Control Systems Magazine, vol. 25, pp. 30 43, Oct. 2005. [11] J. Wesson, The science of JET. Abingdon, Oxon: JET Joint Undertaking, 2000. [12] F. Romanelli and R. Kamendjeon, Overview of JET results, Proceedings of the 22st IAEA Fusion Energy Conference Geneva, 2008. [13] F. Romanelli, J. Paméla, R. Kamendje, M. Watkins, S. Brezinsek, Y. Liang, X. Litaudon, T. Loarer, D. Moreau, D. Mazon, G. Saibene, F. Sartori, and P. de Vries, Recent contribution of JET to the ITER physics, Fusion Engineering and Design, vol. 84, no. 26, pp. 150 160, 2009. [14] N. Holtkamp, An overview of the ITER project, Fusion Engineering and Design, vol. 82, no. 514, pp. 427 434, 2007. [15] N. Holtkamp, The status of the ITER design, Fusion Engineering and Design, vol. 84, no. 26, pp. 98 105, 2009. [16] S. Konishi, S. Nishio, and K. Tobita, DEMO plant design beyond ITER, Fusion Engineering and Design, vol. 6364, no. 0, pp. 11 17, 2002. [17] R. Andreani, E. Diegele, W. Gulden, R. Lasser, D. Maisonnier, D. Murdoch, M. Pick, and Y. Poitevin, Overview of the European Union fusion nuclear technologies development and essential elements on the way to DEMO, Fusion Engineering and Design, vol. 81, no. 1-7, pp. 25 32, 2006. 115
Bibliography [18] V. D. Shafranov and L. E. Zakharov, Equilibrium of toroidal plasma with no circular cross section, Sov. Phys. Tech, vol. 18, pp. 151 156, 1967. [19] Y. Liang, Overview of Edge-Localized Mode Control in Tokamak Plasmas, Fusion Science and Technology, vol. 59, no. 3, pp. 586 601, 2011. [20] A. W. Degeling, Y. R. Martin, P. E. Bak, J. B. Lister, and X. Llobet, Dynamics of edge localized modes in the TCV tokamak, Plasma Physics and Controlled Fusion, vol. 43, no. 12, p. 1671, 2001. [21] P. T. Lang, A. W. Degeling, J. B. Lister, Y. R. Martin, P. J. M. Carthy, A. C. C. Sips, W. Suttrop, G. D. Conway, L. Fattorini, O. Gruber, L. D. Horton, A. Herrmann, M. E. Manso, M. Maraschek, V. Mertens, A. Mck, W. Schneider, C. Sihler, W. Treutterer, H. Zohm, and A. U. Team, Frequency control of type-i ELMs by magnetic triggering in ASDEX Upgrade, Plasma Physics and Controlled Fusion, vol. 46, no. 11, p. L31, 2004. [22] S. H. Kim, M. M. Cavinato, V. Dokuka, A. A. Ivanov, R. R. Khayrutdinov, P. T. Lang, J. B. Lister, V. E. Lukash, Y. R. Martin, S. Y. Medvedev, and L. Villard, Comparing magnetic triggering of ELMs in TCV and ASDEX Upgrade, Plasma Physics and Controlled Fusion, vol. 51, no. 5, 2009. [23] F. Sartori, P. Lomas, F. Piccolo, M. Zedda, and J.-E. Contributors, Synchronous elm pacing at jet using the vertical stabilisation controller, Proocedings of the 35th EPS Conference con Plasma Physics, June 2008. [24] G. Ambrosino, M. Ariola, G. De Tommasi, A. Pironti, F. Sartori, E. Joffrin, and F. Villone, Plasma Strike-Point Sweeping on JET 116
Bibliography Tokamak with the extreme Shape Controller, IEEE Transactions on Plasma Science, vol. 36, no. 3, 2008. [25] A. Cenedese and F. Sartori, Plasma position and current control manmanagement at JET, in 42nd IEEE Conference on Decision and Control, vol. 5, pp. 4628 4633, 2003. [26] L. Zabeo, G. Artaserse, A. Cenedese, F. Piccolo, and F. Sartori, A new approach to the solution of the vacuum magnetic problem in fusion machines, Fusion Engineering and Design, vol. 82, no. 5-14, pp. 1081 1088, 2007. [27] F. Sartori, A. Cenedese, and F. Milani, JET real-time object-oriented code for plasma boundary reconstruction, Fusion Engineering and Design, vol. 66-68, pp. 735 739, 2003. [28] A. Beghi and A. Cenedese, Advances in Real-Time Plasma Boundary Reconstruction, IEEE Control Systems Magazine, vol. 25, pp. 44 64, Oct. 2005. [29] G. Ambrosino, M. Ariola, A. Pironti, and F. Sartori, A new shape controller for extremely shaped plasmas in JET, Fusion Engineering and Design, vol. 66-68, pp. 797 802, 2003. [30] M. Ariola and A. Pironti, The design of the extreme Shape Controller for the JET tokamak, IEEE Control Systems Magazine, vol. 25, pp. 65 75, Oct. 2005. [31] R. Albanese, G. Ambrosino, M. Ariola, A. Cenedese, F. Crisanti, G. De Tommasi, M. Mattei, F. Piccolo, A. Pironti, S. F., and F. Villone, Design, implementation and test of the XSC extreme shape controller in JET, Fusion Engineering and Design, vol. 74, no. 1-4, pp. 627 632, 2005. 117
Bibliography [32] M. Shimada, V. Mukhovatov, G. Federici, Y. Gribov, A. Kukushkin, Y. Murakami, A. Polevoi, V. Pustovitov, S. Sengoku, and M. Sugihara, Performance of ITER as a burning plasma experiment, Nuclear Fusion, vol. 44, no. 2, pp. 350 356, 2004. [33] J. Lister, A. Portone, and Y. Gribov, Plasma control in ITER, IEEE Control Systems Magazine, vol. 26, no. 2, pp. 79 91, 2006. [34] G. De Tommasi, R. Albanese, G. Ambrosino, M. Ariola, M. Mattei, A. Pironti, and F. Sartori, XSC Tools: A Software Suite for Tokamak Plasma Shape Control Design and Validation, IEEE Transactions on Plasma Science, vol. 35, no. 3, pp. 708 723, 2007. [35] G. Ambrosino and R. Albanese, A survey on modeling and control of current, position and shape of axisymmetric plasmas, IEEE Control Systems Magazine, vol. 26, no. 5, pp. 76 91, 2005. [36] R. Albanese and F. Villone, The linearized CREATE-L plasma response model for the control of current, position and shape in tokamaks, Nuclear Fusion, vol. 38, pp. 723 738, May 1998. [37] R. Albanese, G. Calabró, M. Mattei, and F. Villone, Plasma response models for current, shape and position control at JET, Fusion Engineering and Design, vol. 66 68, pp. 715 718, 2003. [38] G. De Tommasi, S. Galeani, A. Pironti, G. Varano, and L. Zaccarian, Trading output performance for input allocation: application to the JET tokamak shape controller, in Proceedings of the 48th IEEE Conference on Decision and Control, December 2009. [39] G. Varano, G. Ambrosino, G. De Tommasi, S. Galeani, A. Pironti, and L. Zaccarian, Performance assessment of a dynamic current allocator for the jet extreme shape controller, in in 26th Symposium on Fusion Technology (SOFT10), Porto, Portugal, September 2010. 118
Bibliography [40] G. Ambrosino, G. De Tommasi, S. Galeani, A. Pironti, G. Varano, and L. Zaccarian, On dynamic input allocation for set-point regulation of the JET tokamak plasma shape, in 2011 IEEE International Conference on Control Applications (CCA), September 2011. [41] G. De Tommasi, S. Galeani, A. Pironti, G. Varano, and L. Zaccarian, Nonlinear dynamic allocator for optimal input/output performance trade-off: Application to the JET tokamak shape controller, Automatica, vol. 47, no. 5, pp. 981 987, 2011. [42] L. Zaccarian, Dynamic allocation for input redundant control systems, Automatica, vol. 45, no. 6, pp. 1431 1438, 2009. [43] L. Boncagni, S. Galeani, G. Granucci, G. Varano, V. Vitale, and L. Zaccarian, Using dynamic input allocation for elongation control at FTU, Fusion Engineering and Design, 2010, to appear. [44] L. Boncagni, S. Galeani, G. Granucci, G. Varano, V. Vitale, and L. Zaccarian, Plasma position and elongation regulation at ftu using dynamic input allocation, IEEE Transactions on Control Systems Technology, 2011. accepted for publication. [45] R. Vitelli, L. Boncagni, F. Mecocci, S. Podda, V. Vitale, and L. Zaccarian, An anti-windup-based solution for the low current nonlinearity compensation on the FTU horizontal position controller, Proceedings of the 49th IEEE Conference on Decision and Control, December 2010. [46] V. Vitale, C. Centioli, F. Iannone, G. Mazza, M. Panella, L. Pangione, S. Podda, and L. Zaccarian, Real-time Linux operating system for plasma control on FTU: implementation advantages and first experimental results, Fusion Engineering and Design, vol. 71, no. 1[U+FFFD], pp. 71 76, 2004. [47] A. Teel and N. Kapoor, The L 2 anti-windup problem: Its definition and solution, in Proc. 4th ECC, (Brussels, Belgium), July 1997. 119
Bibliography [48] L. Zaccarian and A. Teel, A common framework for anti-windup, bumpless transfer and reliable designs, Automatica, vol. 38, no. 10, pp. 1735 1744, 2002. [49] L. Boncagni, C. Centioli, L. Fiasca, F. Iannone, M. Panella, V. Vitale, and L. Zaccarian, Introducing a Virtualization Technology for the FTU Plasma Control System, in Proceedings of the 18th topical meeting on the technology of fusion energy (TOFE), (San Francisco (CA), USA), Sept. 2008. [50] A. Bemporad, A. Teel, and L. Zaccarian, Anti-windup synthesis via sampled-data piecewise affine optimal control, Automatica, vol. 40, no. 4, pp. 549 562, 2004. [51] D. Alves, R. Vitelli, L. Zaccarian, L. Zabeo, A. Neto, F. Sartori, P. Mc- Cullen, and P. Card, The new Error Field Correction Coil controller system in the Joint European Torus tokamak, Fusion Engineering and Design, vol. 86, no. 6-8, pp. 1034 1038, 2011. [52] S. Sastry and M. Bodson, Adaptive Control: Stability, Convergence, and Robustness. Prentice-Hall, 1994. [53] T. Bellizio, G. De Tommasi, N. Risoli, R. Albanese, and A. Neto, A MARTe based simulator for the JET Vertical Stabilization system, Fusion Engineering and Design, vol. 86, pp. 1026 1029, October 2011. [54] L. Boncagni, Y. Sadeghi, D. Carnevale, G. Mazzitelli, A. Neto, D. Pucci, F. Sartori, S. Sinibaldi, V. Vitale, R. Vitelli, L. Zaccarian, S. Monaco, and G. Zamborlini, First steps in the FTU migration towards a modular and distributed real-time control architecture based on MARTe and RTNet, in 17th Real Time Conference, (Lisbona, Portugal), May 2010. [55] L. Boncagni, A. Barbalace, Y. Sadeghi, M. Pompei, L. Zaccarian, and F. Sartori, Switched Ethernet in Synchronized Distributed Con- 120
Bibliography trol Systems Using RTnet, IEEE Transactions on Nuclear Science, vol. 58, pp. 1793 1799, August 2011. [56] T. Weilkiens, Systems Engineering with SysML/UML Modeling, Analysis, Design. Morgan Kaufmann, 2006. [57] K. Thramboulidis, Model-integrated mechatronicstoward a new paradigm in the development of manufacturing systems, IEEE Transactions on Industrial Informatics, vol. 1, pp. 54 61, Feb. 2006. [58] M. Foeken, M. Voskuijl, A. Cabrera, and M. van Tooren, Model generation for the verification of automatically generated mechatronic control software, in IEEE/ASME International Conference on Mechtronic and Embedded Systems and Applications, pp. 275 280, October 2008. [59] Y. Vanderperren, W. Mueller, and W. Dehaene, UML for electronic systems design: a comprehensive overview, Design Automation for Embedded Systems, vol. 12, no. 4, pp. 261 292, 2008. [60] R. Kawahara, H. Nakamura, D. Dotan, A. Kirshin, T. Sakairi, S. Hirose, K. Ono, and H. Ishikawa, Verification of embedded system s specification using collaborative simulation of SysML and simulink models, in International Conference on Model-Based Systems Engineering, pp. 21 28, March 2009. [61] G. Doukas and K. Thramboulidis, A Real-Time-Linux-Based Framework for Model-Driven Engineering in Control and Automation, IEEE Transactions on Industrial Electronics, vol. 58, pp. 914 924, Mar. 2011. [62] C. Huang and P. Hsiung, Model-based verification and estimation framework for dynamically partially reconfigurable systems, IEEE Transactions on Industrial Informatics, vol. 7, pp. 287 301, May 2011. 121
Bibliography [63] Y. Guo and R. Jones, A study of approaches for model based development of an automotive driver information system, in 3rd Annual IEEE Systems Conference, pp. 267 272, March 2009. [64] K. Thramboulidis and A. Buda, 3+1 SysML view model for IEC61499 Function Block control systems, in 8th International Conference on Industrial Informatics, pp. 175 180, July 2010. [65] T. Johnson, C. Paredis, J. Jobe, and R. Burkhart, Modeling continuous system dynamics in SysML, in Proceedings of the ASME International Mechanical Engineering Congress and Exposition, (Seattle, Washington), November 2007. [66] N. Pontisso and D. Chemouil, TOPCASED Combining Formal Methods with Model-Driven Engineering, in Proceedings of the 21st IEEE/ACM International Conference on Automated Software Engineering, pp. 359 360, September 2006. [67] A. Beghi and A. Cenedese, Advances in Real-Time Plasma Boundary Reconstruction, IEEE Control Systems Magazine, vol. 25, pp. 44 64, Oct. 2005. [68] D. Carnevale, A. Astolfi, C. Centioli, S. Podda, V. Vitale, and L. Zaccarian, A new extremum seeking technique and its application to maximize RF heating on FTU, Fusion Engineering and Design, vol. 84, pp. 554 558, Jun. 2009. [69] L. Zaccarian, L. Boncagni, D. Cascone, C. Centioli, S. Cerino, F. Gravanti, F. Iannone, F. Mecocci, L. Pangione, S. Podda, V. Vitale, and R. Vitelli, Nonlinear instabilities induced by the F coil power amplifier at FTU: modeling and control, Fusion Engineering and Design, vol. 84, no. 7 11, pp. 2015 2019, 2009. 122
Bibliography [70] R. Albanese, E. Cocorrese, and G. Rubinacci, Plasma modeling for the control of vertical instabilities in tokamaks, Nuclear Fusion, vol. 29, no. 6, pp. 1013 1023, 1989. [71] F. Sartori, F. Crisanti, R. Albanese, G. Ambrosino, V. Toigo, J. Hay, P. Lomas, et al., The JET PCU project: An international plasma control project, Fusion Engineering and Design, vol. 83, no. 2-3, pp. 202 206, 2008. Proceedings of the 6th IAEA Technical Meeting on Control, Data Acquisition, and Remote Participation for Fusion Research. [72] F. Sartori, A. Barbalace, A. J. N. Batista, T. Bellizio, P. Card, G. D. Tommasi, P. M. Cullen, A. Neto, F. Piccolo, R. Vitelli, and L. Zabeo, The PCU JET Plasma Vertical Stabilisation Control System, Fusion Engineering and Design, 2010. [73] F. Perkins, D. Post, N. Uckan, M. Azumi, D. Campbell, N. Ivanov, N. Sauthoff, M. Wakatani, W. Nevins, M. Shimada, et al., Chapter 1: Overview and summary, Nuclear Fusion, vol. 39, pp. 2137 2174, Dec 1999. [74] A. Neto, F. Sartori, F. Piccolo, A. Barbalace, R. Vitelli, and H. Fernandes, Linux real-time framework for fusion devices, Fusion Engineering and Design, vol. 84, no. 711, pp. 1408 1411, 2009. [75] A. J. N. Batista, J. Sousa, and C. A. F. Varandas, ATCA digital controller hardware for vertical stabilization of plasmas in tokamaks, Review of Scientific Instruments, vol. 77, Oct 2006. [76] J. G. Krom, The evolution of control and data acquisition at JET, Fusion Engineering and Design, vol. 43, no. 3-4, pp. 265 273, 1999. [77] D. G. Luenberger, Introduction to Dynamic Systems: Theory, Models, and Applications. John Wiley and Sons, 1979. 123
List of Figures [78] V. Toigo, L. Zanotto, M. Bigi, E. Gaio, J. Hay, R. Piovan, and S. Shaw, Conceptual design of the enhanced radial field amplifier for plasma vertical stabilisation in JET, Fusion Engineering and Design, vol. 82, pp. 1599 1606, Oct. 2007. [79] G. Franklin, J.D. Powell, and A. Emami-Naeini, Feedback Control of Dynamic Systems. Prentice Hall, 5 th ed., 2006. [80] V. Riccardo, T. C. Hender, P. J. Lomas, B. Alper, T. Bolzonella, P. de Vries, and G. P. Maddison, Analysis of JET halo currents, Plasma Physics and Controlled Fusion, vol. 46, no. 6, pp. 925 934, 2004. [81] E. De la Luna, F. Sartori, P. Lomas, G. Saibene, T. Eich, G. Arnoux, L. Barrera, M. Beurskens, J. Lonnroth, V. Parail, C. Perez von Thun, R. Sartori, E. Solano, L. Zabeo, and M. Zedda, Magnetic ELM triggering using the vertical stabilization controller in JET, in Proceedings of the 36th EPS Conference on Plasma Physics, (Sofia, Bulgaria), Jun. 2009. [82] F. Alladio and F. Crisanti, Analysis of MHD equilibria by toroidal multi-polar expansions, Nuclear Fusion, vol. 26, p. 1143, 1986. [83] F. Alladio and P. Micozzi, Experimental plasma equilibrium reconstruction from kinetic and magnetic measurements in the FTU tokamak, Nuclear Fusion, vol. 35, no. 3, p. 305, 1995. [84] Y. Sadeghi, G. Ramogida, L. Boncagni, C. D Epifanio, V. Vitale, F. Crisanti, and L. Zaccarian, Experimental plasma equilibrium reconstruction from kinetic and magnetic measurements in the FTU tokamak, IEEE Transactions on Plasma Science, vol. 38, no. 3, pp. 352 358, 2010. 124
List of Figures 2.1 Structure and scale of a Tokamak: the JET (Joint European Torus)............................... 6 2.2 Differences between a limiter and a divertor plasma (JET pre-divertor and JET as of today)............... 7 2.3 Structure of the JET Tokamak divertor region........ 9 2.4 3D model of the ITER Tokamak................ 9 3.1 The mechanism of plasma elongation and resulting vertical instability............................. 12 3.2 The JET Vertical Stabilisation controller........... 15 3.3 Photo of an internal discrete coil................ 17 3.4 Position of the magnetic sensors in the JET Tokamak.... 18 3.5 Position of the saddle coils in the JET Tokamak....... 19 3.6 JET weights for Mirnov coils and saddle loops........ 20 3.7 JET Vertical Stabilization system, pulse #79632....... 21 3.8 JET Vertical Stabilization system, pulse #79698....... 22 3.9 Collapse of pedestal causes ELMs............... 23 3.10 Example of ELM pacing via vertical kicks in pulse #78422. 24 3.11 JET circuits generating the poloidal field........... 25 3.12 Main Gaps in the JET Tokamak................ 27 3.13 Block diagram of the Shape Controller system augmented with the XSC........................... 30 125
List of Figures 3.14 Block diagram of the control system with the insertion of the allocator block.......................... 32 3.15 JET pulse #81710 (blue) and #81715 (red) with CLA enabled. Shape error (a) and detail (b)............. 34 3.16 Comparison of currents on the divertor colis for JET pulses #81710 and #81715....................... 35 3.17 Comparison of GAP measures for GAP2 (top right of the vacuum vessel) and RIG/ROG (Radial Inner/Outer GAP) for the JET pulses #81710 and #81715............ 36 3.18 Control system block diagram of horizontal position..... 37 3.19 Electrical scheme of the AL-F converter............ 39 3.20 Simplified electrical scheme of the thyristor bridges of the AL-F converter.......................... 40 3.21 Block diagram of the PHSC................... 43 3.22 Shot number #20838. Open-loop simulation of the AL-F model............................... 44 3.23 Linear LC and HC models behavior compared to the nonlinear response........................... 47 3.24 Shot number #20838. Open-loop simulation of the plasma model............................... 49 3.25 I F response for shots number #28000 (upper plot) and #20838 (lower plot) in solid lines. Corresponding closed-loop simulations in dashed lines...................... 50 3.26 Anti-windup solution...................... 52 3.27 Shot number #20838. Anti-windup simulation........ 54 3.28 Shots #31621 and #31626: same shot type. In the latter the anti-windup system was turned on............. 55 3.29 Shots #32784 and #32786: same shot type. In the latter the anti-windup system is turned on.............. 56 3.30 Shot #32786: signals v 1 and v 2 of the anti-windup system. 57 126
List of Figures 3.31 Shots #32959 and #32960: same shot type. The complete anti-windup code ran on the former. The simplified code shows smaller oscillations.................... 57 3.32 The EFCC coils at the JET Tokamak............. 58 3.33 The proposed advanced controller block diagram....... 59 3.34 Comparison of simulated and experimental results for the EFCC advanced controller................... 60 4.1 The layered structure of BaseLib2............... 62 4.2 Example of a BaseLib2 CDB.................. 64 4.3 Relay logger mechanism..................... 68 4.4 Conceptual passage from a block diagram to a MARTe architecture............................. 69 4.5 The RealTimeThread acts a module micro-scheduler..... 72 4.6 Block definition diagrams used to model the BaseLib2 library. 77 4.7 Example of GAMs modeling.................. 78 4.8 Internal block diagram used to define input and output signals for the PID GAM shown in Figure 4.7.......... 79 4.9 Topcased hierarchical view of the model of the PID GAM block shown in Figure 4.7.................... 80 4.10 Block definition diagram used to model the connections between GAMs........................... 80 4.11 Cross section of the FTU Tokamak.............. 82 4.12 FTU vacuum chamber...................... 83 4.13 Block diagram of the FTU plasma control system...... 84 4.14 BDD of the FTU plasma control system............ 85 4.15 Auto-generated files for the FTU Plasma Control System.. 86 4.16 Photo of the backpane of the VS5 ATCA crate........ 89 4.17 Data synchronization of the ATCA boards.......... 90 4.18 JET LEVEL1 interface for the new Vertical Stabilisation System 5............................. 92 127
List of Acronyms 4.19 All the modules executed for each control cycle........ 95 4.20 Maximum, minimum and mean execution times for all VS5 GAMs............................... 96 4.21 The internal logic of the DAM................. 100 4.22 A screenshot of the VS5 Web Interface: the VAMGAM... 103 4.23 The system is continuously is real-time with a jitter inferior to 1 µs.............................. 104 4.24 Experimental (solid black lines) and simulated values (dashed red lines) for 12 kv positive kicks applied during JET pulse #78376 starting from t = 23 s................. 105 4.25 Block diagram of the MARTe FTU feedback system..... 108 4.26 Reconstructed internal and external radiuses for the present controller and the MARTe-based one............. 109 4.27 Magnetic flux measurement Ψ, used as horizontal position error for the coils control.................... 110 4.28 Pressure and pressure prefill reference, plasma density reference and interferometer density average, valve amplifier request.............................. 111 128
List of Acronyms ADC Analog to Digital Converter. ASDEX Axially Symmetric Divertor EXperiment. ATCA Advanced Telecommunications Computing Architecture. CDB Configuration DataBase. CLA Current Limit Avoidance. CODAS COntrol and Dta Acquisition System. COMPASS COMPact ASSembly. CSV Comma Separated Values. D-T Deuterium-Tritium. DAC Digital to Analog Converter. DAM Divertor Amplifier Module. DDB Dynamic Data Buffer. DSP Digital Signal Processor. EFCC Error Field Correction Coils. 129
List of Acronyms ELM Edge Localised Mode. ERFA Enhanced Radial Field Amplifier. ETB Edge Transport Barrier. FRFA Fast Radial Field Amplifier. FTU Frascati Tokamak Upgrade. GAM Generic Application Module. IDC Internal Discrete Coils. IOGAM Input/Output Generic Application Module (GAM). ISTTOK Instituto Superior Técnico TOKamak. JET Joint European Torus. JPF Jet Pulse File. L1 Level-1. LCMS Last Closed Magnetic Surface. MARTe Multithreaded Application RealTime executor. MHD MagnetoHydroDynamics. MIMO Multiple Input Multiple Output. NIF National Ignition Facility. PCU Plasma Control Upgrade. PDE Partial Differential Equation. 130
List of Acronyms PF Poloidal Field. PHSC Programmable High Speed Controller. PID Proportional Integral Derivative. PPCC Plasma Position and Current Control. RFA Radial Field Amplifier. RIG Radial Inner Gap. ROG Radial Outer Gap. RTAI Real-Time Application Interface. RTM Rear Transition Module. SC Shape Controller. SVD Singular Value Decomposition. TCV Tokamak à Configuration Variable. TF Toroidal Field. VAM Vertical Amplifier Module. VME VERSABUS Module Eurocard. VS Vertical Stabilisation. XSC extreme Shape Controller. 131