What is muAO-MPC?¶
stands for
microcontroller applications online model predictive control.
It mainly consists of the muaompc
Python package.
The generated C code is fully compatible with the ISO C89/C90 standard, and is platform independent. The code can be directly used in embedded applications, using popular platforms like Arduino, and Raspberry, or any other application on which C/C++ code is accepted, like many current generation programable logic controllers (PLC). Additionally, MATLAB/Simulink interfaces to the generated code are provided.
is free software released under the terms of the three-clause BSD License.
The ltidt module¶
This module creates a model predictive control (MPC) controller for a linear time-invariant (lti) discrete-time (dt) system with input and (optionally) state constraints, and a quadratic cost function. The MPC problem is reformulated as a condensed convex quadratic program, which is solved using an augmented Lagrangian method together with Nesterov’s gradient method, as described in [KZF12], [KF11].
The MPC problem description is written in a file we call the system module (see The system module for details). After writing this file, the next step is to actually auto-generate the C code. This is done in two easy steps:
- create an
muaompc
object from to the system module, and - write the C-code based on that object.
The MPC setup¶
The plant to be controlled is described by , where , and are the current state and input vector, respectively. The the state at the next sampling time is denoted by . The discrete-time system and input matrices are denoted as and , respectively.
The MPC setup is as follows:
where the integer is the prediction horizon. The symmetric matrices , , and are the state, input, and final state weighting matrices, respectively. The inputs are constrained by a box set, defined by the lower and upper bound and , respectively. Furthermore, the state and input vectors are also constrained (mixed constraints), using and , and delimited by the lower and upper bounds and , respectively. Additionally, the terminal state needs to satisfy some constraints defined by , , and the matrix .
The sequences and denote the state and input references, respectively. They are specified online. By default, the reference is the origin.
For other setups, check out version 1.x of muaompc.