# How can I handle the delays in Generalized/Model Predictive Control?

I trying to handle delays in a model who is poorly damped but I haveing som issues to estimate its parameters due to the delay.

Assume that we got a state space model, which is poorly damped:

$$x(k+1) = Ax(k) + Bu(k) \\ y(k) = Cx(k) + Du(k)$$

We find those matricies:

$$F = \begin{bmatrix} CA\\ CA^2\\ CA^3\\ \vdots \\ CA^{N_p} \end{bmatrix} , \Phi = \begin{bmatrix} CB &0 &0 &\cdots & 0\\ CAB & CB & 0 & \cdots & 0\\ CA^2B& CAB & 0 &\cdots &0 \\ \vdots & \vdots & \vdots & \vdots &\vdots \\ CA^{N_p-1}B & CA^{N_p-2}B & CA^{N_p-3}B & \cdots & CA^{N_p-N_c}B \end{bmatrix}$$

$$\bar R = r_{\omega} I_{N_p x N_p}$$

$$\left.\begin{matrix} R_s = \begin{bmatrix} 1\\ 1\\ 1\\ 1\\ \vdots \\ 1 \end{bmatrix} \end{matrix}\right\} N_p$$

Where $r_{\omega}$ is our tuning parameters e.g 0.0001 and $r(k)$ is our reference vector, or parameter.

When we can use this formulula were the first column of $U$ is our input signal.

$$U = (\Phi^T \Phi + \bar R)^{-1} \Phi^T(R_s r(k) - Fx(k)))$$

This is Generalized Predictive Control in state space form.

An arbitary simulation results may looks like this:

Where the green is our reference, and black is our output of the model.

The first element of input $U$ looks like this:

I'm using Recursive Least Square to estimate its parameters, but the problem I got is when the model is delayed.

Question:

Is there a way to handle delays in predictive control?

• Shouldn't $\bar{R}\in\mathbb{R}^{N_p-N_c+1 \times N_p-N_c+1}$ instead of $\mathbb{R}^{N_p \times N_p}$, since $\Phi\in\mathbb{R}^{N_p \times N_p-N_c+1}$ and $\Phi^\top\,\Phi$ should be the same size as $\bar{R}$? Jul 6, 2018 at 9:13
• @KwinvanderVeen Well, it's mathematics. Nothing is clear. ;)
– DanM
Jul 6, 2018 at 10:27

This is not a full answer, but would be too long to be a comment.

A delay would mean that $A$ would have one or more poles at zero, therefore some of the coefficients of its characteristic equation, which are estimated with RLS, would be zero. However least squares is not great at returning exactly zero for these coefficients, they might be really small, but often not exactly zero. Using sparse regression might give you better results and a quick search shows that there are also sparse recursive least squares algorithms.

Once you have found your system with delay you will have that $C\,B$ till $C\,A^d\,B$ will be zero, where $d+1$ is the number of samples delay. But in order to have a good prediction you do want the rank of $\Phi$ equal to its width, so choose $N_c$ such that $C\,A^{N_p - N_c}\,B\neq0$.

• Are you talking in discrete time now?
– DanM
Jul 6, 2018 at 10:29
• Ok. So I need to use another estimation: S-RLS
– DanM
Jul 6, 2018 at 10:32
• What if I know the delay of the system, and I estimate the model, without delay by having a made up delay into the RLS estimator. Can I then using feed forward to handle future delays if i got the model(with no delay) and I know the delay?
– DanM
Jul 6, 2018 at 10:39
• @DanielMårtensson If you know the delay then you do not need a sparse estimator (S-RLS) anymore. Jul 6, 2018 at 11:19
• Ok. Thank you for the advice. How should I write the template difference equations then?
– DanM
Jul 6, 2018 at 11:39