Optimal Control Algorithms for Klystron Efficiency in ESS

European Spallation Source (ESS) is a linear particle accelerator planned to be built in Lund, Sweden. There is a need to control the electric field in the cavities in the particle accelerator, according to given specifications of the field. The aim of this thesis is to compare a traditional PI controller to an MPC controller, to see if there is any difference in the performance that can be achieved. One important aspect of the performance analysis is to see whether the klystron efficiency could be increased with either of the controllers. Since ESS is planned to open 2019 and to be fully operational 2025, the evaluation will be based on simulation results in Matlab/Simulink. To be able to do the comparisons a model of the entire system, a realistic model of the klystron, a PI controller and an MPC controller have been implemented. Both the PI controller and the MPC controller give satisfying results in normal operation. The klystron efficiency could be increased with the MPC controller, and probably with the PI controller as well.