This code shows how to implement, in a polyhedral framework, the dual-mode receding horizon controller developed in [Angeli et al., Automatica, 2008]. Such a controller, in the literature, is also called "Set-Theoretic MPC (ST-MPC)". Note that the mentioned article developed the control framework assuming an ellipsoidal modelling for disturbances and constraints. On the other hand, the proposed implementation is for a polyhedral framework (i.e., constraints and disturbance sets are polyhedral sets). Nevertheless, the underlying set-theoretic MPC concepts and the used MPC philosophy are the same. The implemented algorithm is described in, e.g., [Lucia et al., CONES, 2022], Section II.A.
It is assumed that the plant is described by a discrete-time LTI model subject to state (
ST-MPC solves a regulation problem for linear systems subject to state constraints, input constriants and bounded disturbances.
Most of the required computations are moved into an offline phase, leaving online a simple and convex optimization problem (MPC optimization problem with prediction horizon set to 1).
OFFLINE, the controller is built resorting to three main ingredients:
- A stabilizing state-feedback controller for the unconstrained and disturbance-free plant model. In the proposed implementation, such a controller is a standard LQR (u=Kx).
- The smallest Robust Positively Invariant (RPI) region
$\mathcal{T}^0$ associated with the closed-loop system and complying with the prescribed constraints and disturbances. In the provided code, the smallest RPI set is computed resorting to the algorithm developed in [Rakovic et al, TAC, 2005]. Note that$\mathcal{T}^0$ is the smallest set such that$\forall x\in \mathcal{T}^0:$ $(A+BK)x\in \mathcal{T}^0$ and$Kx\in \mathcal{U}$ - A family of
$N>0$ Robust One-step Controllable Sets (ROSC)$\mathcal{T}^{i} = \lbrace x \in \mathcal{X}: \exists u \in \mathcal{U}: Ax + Bu + d \in \mathcal{T}^{i-1}, \forall d \in \mathcal{D} \rbrace$ (also known as Robust Backward Reachable Sets) recursively built starting from the smallest RPI region$\mathcal{T}^0$ . The recursive computation of ROSC sets can be terminated when the desired state-space region of initial conditions is covered, or the set's growth saturates (for the presence of constraints and disturbances). Note that the RPI region is associated with an index = 0, while the ROSC sets have an index (>=1) increasing with the number of iterations.
ONLINE, the controller takes the following steps:
- Find the set with the smallest index containing the current state.
- If the set index is zero, then the terminal controller (u=Kx) is used.
- Else, the control input u is obtained solving a convex constrained optimization problem which imposes that the robust one-step evolution of the system goes into a set whose associated index is one unit smaller than the current one.
- The strategy is recursively feasible. In other words, if the strategy admits a solution at t=0, then an admissible solution will be found for any successive iteration of the algorithm.
- For any admissible initial state condition, the state trajectory reaches the RPI region in a finite number of steps where it remains confined.
In short, ST-MPC is suitable for applications requiring a computationally low demanding controller capable of dealing with hard constraints and disturbances.
In the literature, the ST-MPC idea (or extentions of it) has been used to solve (or partially solve) different control problems (partial list):
- Control of autonomous vehicles: [AV 1], [AV 2], [AV 3], [AV 4], [AV 5], [AV 6]
- Data-driven MPC control: [Data-Driven 1] (github)
- Cyber-physical systems security and privacy: [CPS 1], [CPS 2], [CPS 3], [CPS 4], [CPS 5], [CPS 6], [CPS 7], [CPS 8]
- Fault-detection and mitigation: [FD 1]
- Control of switching and switched systems: [SW 1]
This code has been developed and tested for Matlab R2020b. It assumes that the MPT3 toolbox (including the Yalmip package) is correctly installed in Matlab.
The example is developed by assuming a toy mass-spring-damper model (2 states, 1 input) subject to state and input constraints and bounded disturbances. For control design purposes, the model is discretized.
- Run the file "main.m"
- When requested, press any button to go from the offline phase to the online phase. The request to press a button will appear (at the end of the offline phase) in both the title of the current Figure and in the Command Window