In this thesis, we are interested in the control of the safety factor profile or q-profile in a tokamak plasma. This physical quantity has been found to be related to several phenomena in the plasma, in particular magnetohydrodynamic (MHD) instabilities. Having an adequate safety factor profile is particularly important to achieve advanced tokamak operation, providing high confinement and MHD stability. To achieve this, we focus in controlling the gradient of the poloidal magnetic flux profile. The evolution of this variable is given by a diffusion equation with distributed time-varying coefficients. Based on Lyapunov techniques and the Input-to-State stability properties of the system we propose a robust control law that takes into account nonlinear constraints on the control action imposed by the physical actuators.