Python code generation for explicit MPC in MPT

Authors:

Abstract
The paper shows how explicit representations of model predictive control (MPC) feedback laws can be embedded into Python applications via a new code-generation module of the Multi-Parametric Toolbox. The advantage of the explicit approach is that it provides a simple and fast computation of optimal control inputs without solving optimization problems on-line. To enable implementation of discontinuous feedback laws, the paper proposes an extended version of the sequential search algorithm which resolves possible multiplicities based on a secondary evaluation of the cost function. Two applications are considered. The first one is the Flappy Bird game where we design an MPC-based artificial player to control flapping of the bird's wings. The second application considers the design and implementation of an explicit MPC controller for a quadrocopter.