# Model Predictive Control with reference tracking and terminal weight

In Model Predictive Control (MPC), When a reference is supposed to be tracked, we like an objective function in form of

$$J=\sum_{i=1}^N ||\boldsymbol{r}(k+i)-\boldsymbol{y}(k+i)||^2_{\boldsymbol{Q}(i)}+\sum_{i=0}^{M-1} ||\boldsymbol{u}(k+i)||^2_{\boldsymbol{S}(i)}+\sum_{i=0}^{M-1} ||\Delta\boldsymbol{u}(k+i)||^2_{\boldsymbol{R}(i)}$$

There is no problem so far.

But, when it comes to stability and a terminal weight is supposed to be imposed everyone turns into a different form of cost function

$$J=\boldsymbol{x}^T(k+N)\boldsymbol{Q}_N\boldsymbol{x}(k+N)+\sum_{i=0}^{N-1} ||\boldsymbol{x}(k+i)||^2_{\boldsymbol{Q}(i)}+\sum_{i=0}^{M-1} ||\boldsymbol{u}(k+i)||^2_{\boldsymbol{S}(i)}$$

First of all, they count $i$ from $0$ to $N-1$ instead of $1$ to $N$. But, we know the manipulated variables effect only the next sample times. Thus the $0^{th}$ phrase is redundant.

The second point is does terminal weight works well with reference tracking? Is there any definition of cost function for reference tracking including a terminal weight? (Please provide a reference.)

Reference tracking formulation: Wang 2009

• For your problem formulation the error $e = r - y$ might not go to zero, since in steady state $u$ is some constant value, so $\Delta u = 0$. So when minimizing $\|e\|_Q^2 + \|u\|_S^2$, then $e\neq0$ if $S\neq0$. – Kwin van der Veen May 16 '18 at 7:03
• Instead often in MPC the desired steady state is subtracted from the actual state in the cost function. So in your cost function $\|u(k+i)\|_{S(i)}^2$ would become $\|u(k+i) - u_r(k+i)\|_{S(i)}^2$, where $u_r(k)$ is the input required such that $y(k) = r(k)$. – Kwin van der Veen May 16 '18 at 7:08
• You would shift the origin and penalize $x-x_r$ and $u-u_r$ instead, where $x_r$ and $u_r$ are the stationary state and input for the desired reference output. With that, terminal state penalty based on LQ cost etc is reasonable and justified. Stability arguments are subtle though and standard proofs based on regulation around the origin with terminal weights + terminal constraints etc do not transfer directly. – Johan Löfberg May 16 '18 at 10:40