  This work presents a nonlinear MPC framework that guarantees asymptotic
offset-free tracking of generic reference trajectories by learning a nonlinear
disturbance model, which compensates for input disturbances and model-plant
mismatch. Our approach generalizes the well-established method of using an
observer to estimate a constant disturbance to allow tracking constant
setpoints with zero steady-state error. In this paper, the disturbance model is
generalized to a nonlinear static function of the plant's state and command
input, learned online, so as to perfectly track time-varying reference
trajectories under certain assumptions on the model and provided that future
reference samples are available. We compare our approach with the classical
constant disturbance model in numerical simulations, showing its superiority.
