Introducción al control de modelo predictivo

IE3041 - Sistemas de Control 2

El "PID" del control moderno

Motivación

\mathbf{x}_0
\mathbf{x}_f

Motivación

\begin{aligned} & \displaystyle\min_{\mathbf{u(t)}} \displaystyle\int_{t_0}^{t_f} \mathcal{L}\left(\mathbf{x}(\tau), \mathbf{u}(\tau) \right)d\tau + \varphi\left(\mathbf{x}_0,\mathbf{x}_f\right) \\ & \ \ \textrm{s.t.} \quad \dot{\mathbf{x}}=\mathbf{f}\left(\mathbf{x}, \mathbf{u}\right) \\ \end{aligned}
\mathbf{x}_0
\mathbf{x}_f

Motivación

\begin{aligned} & \displaystyle\min_{\mathbf{u(t)}} \displaystyle\int_{t_0}^{t_f} \mathcal{L}\left(\mathbf{x}(\tau), \mathbf{u}(\tau) \right)d\tau + \varphi\left(\mathbf{x}_0,\mathbf{x}_f\right) \\ & \ \ \textrm{s.t.} \quad \dot{\mathbf{x}}=\mathbf{f}\left(\mathbf{x}, \mathbf{u}\right) \\ \end{aligned}
\mathbf{x}_0
\mathbf{x}_f

encuentra la trayectoria óptima de \(\mathbf{x}_0\) a \(\mathbf{x}_f\)

Motivación

\begin{aligned} & \displaystyle\min_{\mathbf{u(t)}} \displaystyle\int_{t_0}^{t_f} \mathcal{L}\left(\mathbf{x}(\tau), \mathbf{u}(\tau) \right)d\tau + \varphi\left(\mathbf{x}_0,\mathbf{x}_f\right) \\ & \ \ \textrm{s.t.} \quad \dot{\mathbf{x}}=\mathbf{f}\left(\mathbf{x}, \mathbf{u}\right) \\ \end{aligned}
\mathbf{x}_0
\mathbf{x}_f

encuentra la trayectoria óptima de \(\mathbf{x}_0\) a \(\mathbf{x}_f\)

(open loop)

Motivación

\mathbf{x}_0
\mathbf{x}_f

¿Qué ocurre si el sistema no puede* ejecutar perfectamente el plan? 

\mathbf{x}_1

Motivación

\mathbf{x}_0
\mathbf{x}_f

¿Qué ocurre si el sistema no puede* ejecutar perfectamente el plan? 

  • perturbaciones.
  • errores en el modelado | estimación.
  • error en la condición inicial.
\mathbf{x}_1

Motivación

\mathbf{x}_0
\mathbf{x}_f

idea principal detrás del Control de Modelo Predictivo (MPC):

\mathbf{x}_1

Motivación

\mathbf{x}_0
\mathbf{x}_f
\mathbf{x}_1

recalcular la trayectoria óptima

\begin{aligned} & \displaystyle\min_{\mathbf{u(t)}} \displaystyle\int_{t_1}^{t_f} \mathcal{L}\left(\mathbf{x}(\tau), \mathbf{u}(\tau) \right)d\tau + \varphi\left(\mathbf{x}_1,\mathbf{x}_f\right) \\ & \ \ \textrm{s.t.} \quad \dot{\mathbf{x}}=\mathbf{f}\left(\mathbf{x}, \mathbf{u}\right) \\ \end{aligned}

idea principal detrás del Control de Modelo Predictivo (MPC):

Motivación

\mathbf{x}_0
\mathbf{x}_f
\mathbf{x}_1

recalcular la trayectoria óptima

(en lugar de estabilizar la original)

\begin{aligned} & \displaystyle\min_{\mathbf{u(t)}} \displaystyle\int_{t_1}^{t_f} \mathcal{L}\left(\mathbf{x}(\tau), \mathbf{u}(\tau) \right)d\tau + \varphi\left(\mathbf{x}_1,\mathbf{x}_f\right) \\ & \ \ \textrm{s.t.} \quad \dot{\mathbf{x}}=\mathbf{f}\left(\mathbf{x}, \mathbf{u}\right) \\ \end{aligned}

idea principal detrás del Control de Modelo Predictivo (MPC):

Motivación

\mathbf{x}_0
\mathbf{x}_f
\mathbf{x}_1

recalcular la trayectoria óptima

(en lugar de estabilizar la original)

\begin{aligned} & \displaystyle\min_{\mathbf{u(t)}} \displaystyle\int_{t_1}^{t_f} \mathcal{L}\left(\mathbf{x}(\tau), \mathbf{u}(\tau) \right)d\tau + \varphi\left(\mathbf{x}_1,\mathbf{x}_f\right) \\ & \ \ \textrm{s.t.} \quad \dot{\mathbf{x}}=\mathbf{f}\left(\mathbf{x}, \mathbf{u}\right) \\ \end{aligned}

idea principal detrás del Control de Modelo Predictivo (MPC):

"feedback" mediante el recálculo de la trayectoria óptima

Motivación

hacer constantemente el recálculo de la trayectoria óptima

\begin{aligned} \mathbf{u}^\star(t) = & \displaystyle\arg\min_{\mathbf{u(t)}} \displaystyle\int_{t_0}^{t_f} \mathcal{L}\left(\mathbf{x}(\tau), \mathbf{u}(\tau) \right)d\tau + \varphi\left(\mathbf{x}_0,\mathbf{x}_f\right) \\ & \textrm{s.t.} \quad \dot{\mathbf{x}}=\mathbf{f}\left(\mathbf{x}, \mathbf{u}\right) \\ \end{aligned}

Control de Modelo Predictivo

hacer constantemente el recálculo de la trayectoria óptima

\begin{aligned} \mathbf{u}^\star(t) = & \displaystyle\arg\min_{\mathbf{u(t)}} \displaystyle\int_{t_0}^{t_f} \mathcal{L}\left(\mathbf{x}(\tau), \mathbf{u}(\tau) \right)d\tau + \varphi\left(\mathbf{x}_0,\mathbf{x}_f\right) \\ & \textrm{s.t.} \quad \dot{\mathbf{x}}=\mathbf{f}\left(\mathbf{x}, \mathbf{u}\right) \\ \end{aligned}

puede llegar a ser computacionalmente imposible (o ineficiente en el peor de los casos)

Control de Modelo Predictivo

por lo tanto, el MPC propone

\begin{aligned} \mathbf{u}^\star(t) = & \displaystyle\arg\min_{\mathbf{u(t)}} \displaystyle\int_{t_0}^{T_p} \mathcal{L}\left(\mathbf{x}(\tau), \mathbf{u}(\tau) \right)d\tau + \varphi\left(\mathbf{x}_0,\mathbf{x}_f\right) \\ & \textrm{s.t.} \quad \dot{\mathbf{x}}=\mathbf{f}\left(\mathbf{x}, \mathbf{u}\right) \\ \end{aligned}

Control de Modelo Predictivo

por lo tanto, el MPC propone

\begin{aligned} \mathbf{u}^\star(t) = & \displaystyle\arg\min_{\mathbf{u(t)}} \displaystyle\int_{t_0}^{T_p} \mathcal{L}\left(\mathbf{x}(\tau), \mathbf{u}(\tau) \right)d\tau + \varphi\left(\mathbf{x}_0,\mathbf{x}_f\right) \\ & \textrm{s.t.} \quad \dot{\mathbf{x}}=\mathbf{f}\left(\mathbf{x}, \mathbf{u}\right) \\ \end{aligned}

\(<< t_f\)    horizonte de predicción

Control de Modelo Predictivo

por lo tanto, el MPC propone

\begin{aligned} \mathbf{u}^\star(t) = & \displaystyle\arg\min_{\mathbf{u(t)}} \displaystyle\int_{t_0}^{T_p} \mathcal{L}\left(\mathbf{x}(\tau), \mathbf{u}(\tau) \right)d\tau + \varphi\left(\mathbf{x}_0,\mathbf{x}_f\right) \\ & \textrm{s.t.} \quad \dot{\mathbf{x}}=\mathbf{f}\left(\mathbf{x}, \mathbf{u}\right) \\ \end{aligned}
\mathbf{u}(t)=\mathbf{u}^\star(t\le T_c)

\(<< t_f\)    horizonte de predicción

Control de Modelo Predictivo

por lo tanto, el MPC propone

\begin{aligned} \mathbf{u}^\star(t) = & \displaystyle\arg\min_{\mathbf{u(t)}} \displaystyle\int_{t_0}^{T_p} \mathcal{L}\left(\mathbf{x}(\tau), \mathbf{u}(\tau) \right)d\tau + \varphi\left(\mathbf{x}_0,\mathbf{x}_f\right) \\ & \textrm{s.t.} \quad \dot{\mathbf{x}}=\mathbf{f}\left(\mathbf{x}, \mathbf{u}\right) \\ \end{aligned}
\mathbf{u}(t)=\mathbf{u}^\star(t\le T_c)

\(<< t_f\)    horizonte de predicción

horizonte de control (pequeño)

Control de Modelo Predictivo

por lo tanto, el MPC propone

\begin{aligned} \mathbf{u}^\star(t) = & \displaystyle\arg\min_{\mathbf{u(t)}} \displaystyle\int_{t_0}^{T_p} \mathcal{L}\left(\mathbf{x}(\tau), \mathbf{u}(\tau) \right)d\tau + \varphi\left(\mathbf{x}_0,\mathbf{x}_f\right) \\ & \textrm{s.t.} \quad \dot{\mathbf{x}}=\mathbf{f}\left(\mathbf{x}, \mathbf{u}\right) \\ \end{aligned}
\mathbf{u}(t)=\mathbf{u}^\star(t\le T_c)

\(<< t_f\)    horizonte de predicción

horizonte de control (pequeño)

todo bajo un planteamiento en tiempo discreto

Control de Modelo Predictivo

t
t
\mathbf{x}(t)
\mathbf{u}(t)

Control de Modelo Predictivo

t
t
\mathbf{x}(t)
\mathbf{u}(t)

Control de Modelo Predictivo

t
t
\mathbf{x}(t)
\mathbf{u}(t)
k
k+N_p-1

Control de Modelo Predictivo

t
t
\mathbf{x}(t)
\mathbf{u}(t)
k
k+N_p-1

Control de Modelo Predictivo

t
t
\mathbf{x}(t)
\mathbf{u}(t)
k
k+N_p-1
k+N_c

Control de Modelo Predictivo

t
t
\mathbf{x}(t)
\mathbf{u}(t)
k
k+N_p-1
k+N_c

Control de Modelo Predictivo

t
t
\mathbf{x}(t)
\mathbf{u}(t)

Control de Modelo Predictivo

t
t
\mathbf{x}(t)
\mathbf{u}(t)
k
k+N_p-1

Control de Modelo Predictivo

t
t
\mathbf{x}(t)
\mathbf{u}(t)
k
k+N_p-1

Control de Modelo Predictivo

t
t
\mathbf{x}(t)
\mathbf{u}(t)
k
k+N_p-1
k+N_c

Control de Modelo Predictivo

t
t
\mathbf{x}(t)
\mathbf{u}(t)
k
k+N_p-1
k+N_c

Control de Modelo Predictivo

t
t
\mathbf{x}(t)
\mathbf{u}(t)
k

Control de Modelo Predictivo

t
t
\mathbf{x}(t)
\mathbf{u}(t)
k

se va "jalando" el horizonte de predicción y sólo se toman unas pocas muestras (sólo 1 en el mejor de los casos) de la solución

Control de Modelo Predictivo

t
t
\mathbf{x}(t)
\mathbf{u}(t)
k

se va "jalando" el horizonte de predicción y sólo se toman unas pocas muestras (sólo 1 en el mejor de los casos) de la solución

Receding Horizon Control (RHC)

Control de Modelo Predictivo

Control de Modelo Predictivo

\begin{aligned} \mathbf{u}^\star_k = & \displaystyle\arg\min_{\mathbf{u}_k,\mathbf{x}_k} \displaystyle\sum_{k=0}^{N_p-1} \ell\left(\mathbf{x}_k, \mathbf{u}_k \right) \\ & \ \quad \textrm{s.t.} \quad \mathbf{x}_{k+1}=\mathbf{F}\left(\mathbf{x}_k, \mathbf{u}_k\right) \\ & \ \ \quad \qquad \mathbf{x}_0=\mathbf{x}(t_k) \\ & \ \ \quad \qquad \mathbf{u}_k \in \mathcal{U}, \ \forall k \in [0,N_p-1] \\ & \ \ \quad \qquad \mathbf{x}_k \in \mathcal{X}, \ \forall k \in [0,N_p] \end{aligned}

Control de Modelo Predictivo

\begin{aligned} \mathbf{u}^\star_k = & \displaystyle\arg\min_{\mathbf{u}_k,\mathbf{x}_k} \displaystyle\sum_{k=0}^{N_p-1} \ell\left(\mathbf{x}_k, \mathbf{u}_k \right) \\ & \ \quad \textrm{s.t.} \quad \mathbf{x}_{k+1}=\mathbf{F}\left(\mathbf{x}_k, \mathbf{u}_k\right) \\ & \ \ \quad \qquad \mathbf{x}_0=\mathbf{x}(t_k) \\ & \ \ \quad \qquad \mathbf{u}_k \in \mathcal{U}, \ \forall k \in [0,N_p-1] \\ & \ \ \quad \qquad \mathbf{x}_k \in \mathcal{X}, \ \forall k \in [0,N_p] \end{aligned}

\(\approx\mathrm{ForwardEuler}\left\{\mathbf{f}(\mathbf{x},\mathbf{u}),\Delta t\right\}\) ó

\(\mathrm{RK4}\left\{\mathbf{f}(\mathbf{x},\mathbf{u}),\Delta t\right\}\)

Control de Modelo Predictivo

\begin{aligned} \mathbf{u}^\star_k = & \displaystyle\arg\min_{\mathbf{u}_k,\mathbf{x}_k} \displaystyle\sum_{k=0}^{N_p-1} \ell\left(\mathbf{x}_k, \mathbf{u}_k \right) \\ & \ \quad \textrm{s.t.} \quad \mathbf{x}_{k+1}=\mathbf{F}\left(\mathbf{x}_k, \mathbf{u}_k\right) \\ & \ \ \quad \qquad \mathbf{x}_0=\mathbf{x}(t_k) \\ & \ \ \quad \qquad \mathbf{u}_k \in \mathcal{U}, \ \forall k \in [0,N_p-1] \\ & \ \ \quad \qquad \mathbf{x}_k \in \mathcal{X}, \ \forall k \in [0,N_p] \end{aligned}

inicio del horizonte de predicción en el tiempo actual de muestreo

\(\approx\mathrm{ForwardEuler}\left\{\mathbf{f}(\mathbf{x},\mathbf{u}),\Delta t\right\}\) ó

\(\mathrm{RK4}\left\{\mathbf{f}(\mathbf{x},\mathbf{u}),\Delta t\right\}\)

Control de Modelo Predictivo

\begin{aligned} \mathbf{u}^\star_k = & \displaystyle\arg\min_{\mathbf{u}_k,\mathbf{x}_k} \displaystyle\sum_{k=0}^{N_p-1} \ell\left(\mathbf{x}_k, \mathbf{u}_k \right) \\ & \ \quad \textrm{s.t.} \quad \mathbf{x}_{k+1}=\mathbf{F}\left(\mathbf{x}_k, \mathbf{u}_k\right) \\ & \ \ \quad \qquad \mathbf{x}_0=\mathbf{x}(t_k) \\ & \ \ \quad \qquad \mathbf{u}_k \in \mathcal{U}, \ \forall k \in [0,N_p-1] \\ & \ \ \quad \qquad \mathbf{x}_k \in \mathcal{X}, \ \forall k \in [0,N_p] \end{aligned}

inicio del horizonte de predicción en el tiempo actual de muestreo

\(\approx\mathrm{ForwardEuler}\left\{\mathbf{f}(\mathbf{x},\mathbf{u}),\Delta t\right\}\) ó

\(\mathrm{RK4}\left\{\mathbf{f}(\mathbf{x},\mathbf{u}),\Delta t\right\}\)

costo de parqueo

Control de Modelo Predictivo

\begin{aligned} \mathbf{u}^\star_k = & \displaystyle\arg\min_{\mathbf{u}_k,\mathbf{x}_k} \displaystyle\sum_{k=0}^{N_p-1} \ell\left(\mathbf{x}_k, \mathbf{u}_k \right) \\ & \ \quad \textrm{s.t.} \quad \mathbf{x}_{k+1}=\mathbf{F}\left(\mathbf{x}_k, \mathbf{u}_k\right) \\ & \ \ \quad \qquad \mathbf{x}_0=\mathbf{x}(t_k) \\ & \ \ \quad \qquad \mathbf{u}_k \in \mathcal{U}, \ \forall k \in [0,N_p-1] \\ & \ \ \quad \qquad \mathbf{x}_k \in \mathcal{X}, \ \forall k \in [0,N_p] \end{aligned}

inicio del horizonte de predicción en el tiempo actual de muestreo

\(\approx\mathrm{ForwardEuler}\left\{\mathbf{f}(\mathbf{x},\mathbf{u}),\Delta t\right\}\) ó

\(\mathrm{RK4}\left\{\mathbf{f}(\mathbf{x},\mathbf{u}),\Delta t\right\}\)

costo de parqueo

obviar si no se está empleando colocación

Control de Modelo Predictivo

\begin{aligned} \mathbf{u}^\star_k = & \displaystyle\arg\min_{\mathbf{u}_k,\mathbf{x}_k} \displaystyle\sum_{k=0}^{N_p-1} \ell\left(\mathbf{x}_k, \mathbf{u}_k \right) \\ & \ \quad \textrm{s.t.} \quad \mathbf{x}_{k+1}=\mathbf{F}\left(\mathbf{x}_k, \mathbf{u}_k\right) \\ & \ \ \quad \qquad \mathbf{x}_0=\mathbf{x}(t_k) \\ & \ \ \quad \qquad \mathbf{u}_k \in \mathcal{U}, \ \forall k \in [0,N_p-1] \\ & \ \ \quad \qquad \mathbf{x}_k \in \mathcal{X}, \ \forall k \in [0,N_p] \end{aligned}

inicio del horizonte de predicción en el tiempo actual de muestreo

\(\approx\mathrm{ForwardEuler}\left\{\mathbf{f}(\mathbf{x},\mathbf{u}),\Delta t\right\}\) ó

\(\mathrm{RK4}\left\{\mathbf{f}(\mathbf{x},\mathbf{u}),\Delta t\right\}\)

costo de parqueo

obviar si no se está empleando colocación

\mathbf{u}_k=\left\{\mathbf{u}^\star_0, \cdots, \mathbf{u}^\star_{N_c-1}\right\}

Control de Modelo Predictivo

en resumen, la estrategia del MPC consiste en:

  1. predicción.
  2. optimización online.
  3. corrimiento del horizonte de predicción.

Control de Modelo Predictivo

  1. puede aplicarse de forma general a sistemas MIMO no lineales.
  2. considera restricciones en las entradas y los estados en su planteamiento.
  3. la predicción permite tomar acción anticipadamente.
  4. es aproximadamente la solución al problema de control óptimo.
  5. empleado en aplicaciones industriales desde mediados de los 70s.

Ventajas del MPC

  1. puede aplicarse de forma general a sistemas MIMO no lineales.
  2. considera restricciones en las entradas y los estados en su planteamiento.
  3. la predicción permite tomar acción anticipadamente.
  4. es aproximadamente la solución al problema de control óptimo.
  5. empleado en aplicaciones industriales desde mediados de los 70s.

Ventajas del MPC

  • ¿Cuándo es capaz el MPC de estabilizar el sistema?
  • ¿Qué tan bueno es el rendimiento del MPC?
  • ¿Qué tan largos deben ser los horizontes de predicción y control?
  • ¿Cómo puede implementarse numéricamente?

Principales problemas del MPC

  • ¿Cuándo es capaz el MPC de estabilizar el sistema?
    • estabilidad, factibilidad de la optimización.
  • ¿Qué tan bueno es el rendimiento del MPC?
    • optimización online, velocidad de la dinámica, tipo de problema de optimización.
  • ¿Qué tan largos deben ser los horizontes de predicción y control?
  • ¿Cómo puede implementarse numéricamente?
    • recursos en Canvas.

Principales problemas del MPC

Herramientas de software

Algunas aplicaciones

Algunas aplicaciones

Algunas aplicaciones

Algunas aplicaciones

IE3041 - Lecture 15 (2025)

By Miguel Enrique Zea Arenales

IE3041 - Lecture 15 (2025)

  • 1