This paper presents an online tuning strategy for model predictive control. Specifically, the tuning strategy adjusts automatically the prediction horizon, P, the diagonal elements of the input weight matrix, Λ, and the diagonal elements of the output weight matrix, Γ. The control horizon is left constant because its relative value with respect to P is more important. The MPC parameters are adj...