Robust Sliding Mode Control for Tokamaks

Nuclear fusion has arisen as an alternative energy to avoid carbon dioxide emissions, being the tokamak a promising nuclear fusion reactor that uses a magnetic field to confine plasma in the shape of a torus. However, different kinds of magnetohydrodynamic instabilities may affect tokamak plasma equilibrium, causing severe reduction of particle confinement and leading to plasma disruptions. In this sense, numerous efforts and resources have been devoted to seeking solutions for the different plasma control problems so as to avoid energy confinement time decrements in these devices. In particular, since the growth rate of the vertical instability increases with the internal inductance, lowering the internal inductance is a fundamental issue to address for the elongated plasmas employed within the advanced tokamaks currently under development. In this sense, this paper introduces a lumped parameter numerical model of the tokamak in order to design a novel robust sliding mode controller for the internal inductance using the transformer primary coil as actuator.


Introduction
The massive use of fossil fuels has led to widely extended contamination hazards while the energy stocks are being depleted, provoking a race against time to develop alternative sources.In this compelling scenario, nuclear fusion has arisen as a promising alternative.Between the chosen reactors, great efforts and resources have been devoted to tokamak devices 1-4 .However, it is still necessary to solve different control problems in order to achieve higher plasma stability 5-7 .In this sense, plasma control composes now a fundamental issue in the development of fusion processes, which brings to light the relevance of the study and research of advanced control laws so as to improve the plasma performance.In this context, this paper provides information about the behavior of the plasma in a tokamak by implementing a sliding mode controller for the internal inductance of the plasma.
Lowering the internal inductance is closely related to improving the vertical stability, a relevant problem for the advanced tokamaks currently under development.Besides, different actuator choices to control the internal inductance, such as the primary discharge, lower hybrid heating, or current drive, produce different current profiles in the plasma, thus simulations of internal inductance control allow for better criteria when selecting one or another actuator.
In this work, the internal inductance control problem in tokamaks is studied by considering a lumped parameter model for the plasma current and the inductance time evolution as function of the plasma resistance, noninductive current drive sources, and boundary voltage or poloidal field PF coil current drive 8-11 , so as to compare the performance of a sliding mode control technique 12 with techniques commonly used to regulate the plasma in tokamaks.Since the most widely used control technique is the Proportional-Integral-Derivative PID , an anti-windup PID controller to avoid actuator saturation has been chosen for comparison.
The controllers were designed using a numerical model of the system and applying sliding mode control over a nonlinear system that is updated at each time step.In a first stage, the study includes a theoretical framework with a local stability analysis of the open loop system.Then, control strategies are designed to obtain a stable sliding mode control strategy that satisfies the tracking criteria for the internal inductance.The local stability analysis is performed from the characterization of the equilibrium points of the model in open loop system and then implementing the Lyapunov theory.
Once the theoretical framework has been established, the numerical scheme is implemented.An initial controller tuning is obtained from a linearized system using an operation point of the open-loop system.Then, the controllers are implemented over the nonlinear system and fine-tuned so as to optimize the controlled variable using the gradient descent algorithm.Besides, the states will be corrected at each step, using a Kalman approach to deal with the system nonlinearities.
Finally, the results of the time evolution of the controlled variables as function of the available actuator and disturbance inputs using the state space formalism are presented, performing robustness analysis by varying the design parameters so as to observe the behavior of the controller and its components.

Tokamak System Model
A tokamak is a fusion reactor with a toroidal chamber where the current is induced by coils acting as the primary circuit of a transformer while the plasma itself is the secondary circuit.The magnetic field that confines this plasma is created in toroidal direction by coils located along the torus toroidal field coil together with another field perpendicular to the first one, created mainly by the plasma current poloidal field .Thus, the resulting magnetic field lines are composed by the combination of these two fields poloidal and toroidal and present a helical shape along the torus, so that the particles pass alternately by internal and external areas of the torus.
This section introduces a brief description of the numerical model that will be used to control the plasma internal inductance.From an electrical point of view the tokamaks are modeled as a toroidal transformer primary coupled with the plasma ring by a mutual inductance M and the plasma acts as the secondary RL circuit, where R and L denotes the plasma resistance and inductance, respectively.The plasma is maintained using poloidal field discharges with the particularity that the total inductance consists of the sum of a constant term external inductance due to the inductance of transmission lines and wiring which are geometrical factors, plus a variable term corresponding to the internal inductance of the system.
Besides, the shape and position of the current at a given time determine the value of the internal inductance, which is a measure of the width of the current profile.Therefore, setting correctly the internal inductance values adjusts the kinematics and shape of the current and the potential drops in the electrical circuit.Since the internal inductance has a direct bearing on the stability at a given equilibrium, there is a growing interest to exploit internal inductance control as a means to extend the duration of tokamak plasma discharges 13, 14 , to reduce the growth rate of the vertical instability of elongated plasmas 15-17 , and to guarantee access to advanced tokamak scenarios 18 .

Numerical Model
The first step when developing a controller is to find a suitable mathematical model of the system.The numerical model under study is the lumped parameter model for the internal inductance of plasma current that was published in 19 , which is derived considering energy conservation and flux balance together with a first order approximation for the dynamics of the flux diffusion and has been validated with experimental data from JET tokamak 20 .Let us recall the equations used to model the plasma current and its internal inductance evolution, and introduce the state space vector x x 1 , x 2 , x 3 T with where L i denotes the internal inductance, I the total plasma current, ψ B the flux at the plasma boundary, ψ R is the resistive flux, and ψ C is the weighted flux average for the current density enclosed by the plasma boundary Ω The following lumped state space system model is derived given that V B is the boundary loop voltage, R the plasma resistance, and I the noninductive current

Mathematical Problems in Engineering
denoting L e the external inductance and where τ and k represent,respectively, the gain and the time constant of the system.This system is accurate, except for an ad hoc first order approximation for the flux diffusion dynamics by considering the voltage at the equilibrium surface as a function of τ and k

State Filter
As a novel approach to estimate the state space vector solution, the predicted states will be corrected to take into account the variation of the system matrices at two consecutive iterations following a similar fashion as with Kalman filters.Given two measurements for the state vectors it is reasonable to assume that it may be estimated with the parametric relationship so that k is a scalar which value varies between 0 and 1.The problem consists of estimating an optimal value for k that gives the best estimation for x, denoted as x.The resulting states will be predicted at each given time for an initial condition x 0 as 2.9 Defining f 3 x f 2 x /x, the final vector state is computed as an average of these two states weighted with an optimal value k that minimizes the variance for the weighted mean

2.10
L i 1 denotes the internal inductance value computed from 2.8 and L i 2 the internal inductance value obtained after updating the system matrices according to 2.9 , where P 1 and P 2 denote their corresponding error variance.Thus, the optimal weight k is given as Substituting this optimal value in the weighted mean leads to the following estimate at each time step Thus, this iterative algorithm approximates the solution at each time step for the linearized system 2.8 and 2.9 with the output equation Where x is chosen so that the solution minimizes the error covariance for the internal inductance.
Even when this scheme is inherently sequential, since the communication overhead maybe reduced to the state vector, there are suitable parallelization schemes to reduce the computational cost while improving the accuracy of its solution 21 .

Robust Control Design
Tokamak control is usually addressed though PIDs even when the presence of parametric uncertainties and disturbances is intrinsic to the system.Since these agents can worsen the system performance and even cause instabilities, they should be taken into account when designing the controller.For this reason, a sliding mode controller will be implemented so as to guarantee robust stability despite external disturbances, measurement errors, and the presence of unmodeled dynamics in the system.Essentially, the Sliding Mode Control SMC uses discontinuous control laws to bring the system states to a specific surface area in the state space, called the sliding surface and once this has been achieved, maintains the system states on this surface.The main advantages of this approach are twofold: on the one hand, while the system is in the sliding surface behaves like a reduced-order system and on the other hand, the dynamics of the system in sliding mode is insensitive to the uncertainties of model and disturbances.Thus, in this paper the implementation of an integral sliding mode controller ISMC based on the incremental dynamics of the system is considered 22-26 , which is proven to be stable by performing closed-loop stability analysis via the Lyapunov theory 27-29 .In this way, the system dynamics takes the following form where incremental formulation has been used to include the nonmodeled dynamics, external disturbances, and parameter uncertainties with f f 3 x , g g 2 x and h g 2 x −Rx 2 /x 3 R I and, where x − x * denotes the tracking error.The error dynamics may then be rewritten as M j dI j dt − ẋ * .

3.2
Considering the integral sliding surface along which the process output can slide to reach its desired final value to be defined by where k is a gain, e t is the error of the system and the sliding control is given by the power trending law u c t ke t − β sgn S , 3.4 β denotes the switching gain and sgn the sign function.First, it is necessary for the reaching mode to be stable.That is to say, that the system reaches the switching surface, S t 0, in finite time and remains on it.This is proven using the Lyapunov function

3.7
Under this condition the equilibrium at the origin is globally asymptotically stable; that is to say, that all trajectories starting off the sliding surface S t 0 reach it in finite time.In order to ensure that after the sliding mode hits the surface it will remain on it, it is necessary and sufficient to enforce that Ṡ t 0, which is equivalent to ė t ke t − fe t k − f e t , 3.8 so that a second condition is needed to achieve error convergence at a reasonable rate, k − f < 0. This condition is satisfied for k < f. 3.9 To summarize, once the control law is defined 3.4 two further assumptions on the controller parameters are required to ensure convergence and stability.That the parameter β ≥ |d| where d t enclose all the uncertainties of the system and that k < f at any time.

Case Study Controllers
The goal is to design a controller for the internal inductance L i through the current variation dI j /dt within the coils, on the premise that the reference of the internal inductance is a stair function from 0.5 to 1.1.The reason to choose these conditions, which are more restrictive than those in a physical setting, is to represent the worst case scenario in the inductance during persistent plasma heating with Lower Hybrid Current Drive LHCD or Electron Cyclotron Resonance Heating ECRH discharges and to provide means to control plasma breakdown and current ramp up in tokamaks 30 .
In order to design the control for the nonlinear system it is necessary a previous study of the linearized open-loop equations.In this case, the Bode and Root locus diagrams provide an effective and intuitive look into its stability.In this way, it may be observed from Figure 1 that the system presents a stable behavior.
Since the open-loop linearized system is stable, some of its closed-loop properties may be directly determined from the Bode diagram.Nevertheless, a useful technique when analyzing the closed-loop system is to determine its step response, which is shown in Figure 2.
As it may be seen, although the initial linear system is stable, it is just marginally stable so that the design of the controller should be able to enforce further requirements on the rise time, overshoot, and steady state error so as to minimize the tracking error for the challenging reference under study.For this purpose, firstly a modified anti-windup PID-based controller coupled with an optimal control strategy to govern the plasma current profile has been implemented, and secondly, a robust SMC-based controller for the same purpose has been proposed.The remainder of the section will deal with the numerical results over the nonlinear system.

PID Controller
Even when PID controllers can seem simple, their choice as a demonstrative study can not be considered by chance due to the fact that most of the controllers currently working on tokamaks are usually based on PID schemes 31-35 .
The general expression for a traditional PID, including a proportional action modulated by an integral action to eliminate the steady-state error and the derivative action to stabilize the system is given by 4.1 whose Laplace transform can be expressed as 4.2 Nevertheless, it was necessary to consider an integral windup effect in order to preserve the control of the system, by avoiding that the saturation of the control actuators breaks the feedback loop 36 .Therefore, the Laplace transform of the controller can be defined by 30 which includes an extra feedback path with a corrective error signal fed to the input of the integrator through the gain K c so that when there is no saturation its value is zero and it will have no effect on the control signal, but when the actuators saturate the signal is fed back to the integrator in such a way that the integral action is decreased accordingly to the saturation error as follows: It is well-known that one of the most relevant issues for the design of a PID is the tuning of the controller parameters.In this case study, this tuning was performed in two steps.An initial PID is tuned based upon the open-loop frequency response of the linearized model so as to satisfy the usual requirements of stability the output remains bounded for bounded input performance large bandwidth , and robustness phase and gain margin  37 .Then, this PID shall be implemented with the nonlinear system and fine-tuned so as to optimize its closed loop response, using the gradient descent algorithm.
According to the simulation results shown in Figure 3, it can be deduced that the proposed anti-windup PID controller with P 903.8231,I 3029.1347, and D −0.5566 achieves the best results for the reference tracking problem in hand since a faster response will provoke an undesired oscillatory behavior.This response has no significant overshoot, the system provides the fastest possible response and the steady-state error has also been minimized.

Robust Sliding Mode Controller
Considering that tokamaks are nonlinear systems, and therefore they are subject to model uncertainties and system disturbances, it was decided to test the lump parameter model with a robust control scheme able to overcome those drawbacks that have not been considered for the PID.Among various control schemes, sliding mode control has been considered as an efficient method for dealing with the control problems of nonlinear systems, due to its ability to overcome disturbances.Therefore, with the purpose of overcoming the weakness of PID controllers in this kind of systems, the integral sliding mode controller ISMC whose closedloop stability has been demonstrated in Section 3 is implemented in this section.This ISMC is based on the use of the integral sliding surface given in 3.3 .
The simulation results represented in Figure 4 show the time evolution for the desired internal inductance that is obtained using the proposed SMC 38-42 .It can be appreciated that after a transitory time the internal inductance tracks the desired reference without the appearance of any relevant chattering phenomenon.This phenomenon is usually due to fast dynamics in the control loop introduce by the switching function when modeling the system, which may be easily overcome by smoothing the commuting function, which in our case is the sign function.

Comparison of Simulation Results
As it has been previously discussed, the main advantage of a SMC is the robustness to deal with perturbations such as disturbances and inaccuracies in parameter estimation that  may occur during a plasma shot.By contrast, the performance of the PID controllers highly relies on the parameter tuning, and therefore on the accurate knowledge of the system.Therefore, performance may degrade when the actual data deviate from the values used to tune the controller.In order to evaluate the performance of both control schemes, it has been introduced a mismatch of 10% in the internal inductance estimation for the same example presented in this section.As it is shown in Figure 5, the system response when applying the proposed SMC is satisfactory, since comparing Figures 4 and 5, there are hardly any differences so that the SMC maintains good performance and the uncertainties are successfully.In contrast with the SMC, it may be observed in Figure 5 that the traditional PIDbased control is not able to assume these uncertainties, and its performance may deteriorate even for relative low values of perturbations in the system.
In order to compare the simulation results obtained using the proposed SMC with those obtained using a traditional PID-based controller is given so as to exemplify the better performance of this robust scheme.For this purpose, a performance evolution function J is used.This performance function is defined by 4.4 in terms of the tracking error, where e τ represents the error between the desired reference value for the internal inductance and the value obtained from the system output J t e 2 τ dτ.

4.4
It can be observed in Figure 6 that the values of the performance evolution function for the case of the PID-based controller are higher than for the sliding mode controllers.It must be taken into account that, although the PID-based controller has been adequately fine-tuned with the step descent to give an optimal response for the Tokamak system plant, it is not able to deal with the 10% white noise disturbances acting on 3.1 .For this reason, although in all cases the accumulated error measured with the cost function J defined above presents an increasing behavior, it can be noticed that the growth rate is much higher for the PID-based controller than for SMC controller since these SMC controllers are intrinsically robust.

Conclusions
Different magnetohydrodynamic instabilities may affect to the plasma equilibrium of the tokamak, causing severe reduction of particle confinement and leading to plasma disruptions.In this sense, plasma control composes now a fundamental issue in the development of fusion processes, which brings to light the relevance of the study and research of advanced control laws so as to improve the plasma performance.In particular, since the growth rate of the vertical instability increases with the internal inductance, lowering the internal inductance is a fundamental issue to address for the elongated plasmas employed within the advanced tokamaks currently under development.Besides, most of controllers currently working on tokamaks are based on PID schemes, even when tokamaks are nonlinear systems which models present several uncertainties.It follows that the development of robust controllers constitutes a field of growing interest because they are more suitable to deal with the unknown and unmodeled features of tokamaks.Thus, in this paper a lumped parameter numerical model has been introduced so as to design a novel sliding mode controller for the internal inductance using the transformer primary coil as actuator.
Diverse actuator choices to control the internal inductance, such as the primary discharge, lower hybrid heating, or current drive, produce different current profiles in the plasma, so that simulations of internal inductance control allow for better criteria when selecting the actuator LHCD, ECRH,... .In this context, the relevance of this paper is twofold, on the one hand controlling the plasma from the primary requires far less energy to correct the current profile than noninductive control and, on the other hand, it provides information about the behavior of the plasma in a tokamak when selecting one or another actuator.

6 Figure 1 :
Figure 1: Open-loop Bode and Root Locus diagrams for the linearized plant.

Figure 2 :
Figure 2: Closed-loop step response for the linearized plant.

Figure 3 :
Figure 3: Controlled internal inductance for the PID controller.

Figure 4 :
Figure 4: Controlled internal inductance for the SMC controller.

Figure 5 :Figure 6 :
Figure 5: Controlled internal inductance for the PID controller left and SMC controller right subject to a 10% white noise disturbances.