Linear-Quadratic MPC Examples

2-DOF double integrator

Let control a 2-DOF double integrator with an MPC controller with a prediction horizon of one second and quadratic running cost penalizing the state-error and input level.

We will use the first order approximation with a timestep of s to discretize its continuous dynamics

We will formulate the running cost as and place additional constraints on the controllers inputs.

Code