Reference preview/look-ahead in Simulink

10 views (last 30 days)
Qibin Chen
Qibin Chen on 16 Aug 2019
Answered: Johannes Lips on 29 Nov 2022 at 13:18
Hi all,
I'm doing simulation on model predictive control (MPC) with my own designed solver (so no use of MPC toolbox) in Simulink. I'm wondering how I can implement reference preview/look-ahead in Simulink without using the MPC toolbox, like this example
I'm aware that in Simulink I can use Unit-Delay and Memory to access data in the past, but I don't know how to access data in the future.
Any help is appreciated!

Answers (2)

Rhea Chandy
Rhea Chandy on 31 Mar 2021
As I understand it, you want to use implement a look-ahead in simulink without using MPC toolbox because you have already designed your own solver.
In the example you shared as , Improving Control Performance with Look-Ahead (Previewing), there is an example of a Simulink implementation of a Future Sample Extractor with Memory blocks. That may give you some insight on how to procede.
However your best bet would be to use the MPC toolbox itself.

Johannes Lips
Johannes Lips on 29 Nov 2022 at 13:18
I believe the question is on how to implement the Future Sample Extractor used in the example to enable reference preview.
In the mpcmove documentation ( it is written clearly that the input for the reference can be a p x Ny matrix and in case it is smaller than p rows, the last row is duplicated for the remains of the prediction horizon.
That means the "Future Sample Extractor" would need to output a p x 1 matrix. Since the Memory blocks (or Unit Delay blocks) have only access to past time, the input for the Future Sample Extractor should be the reference signal at the end of the prediction horizon (so shifted forward opposed to what you would normally have!), so that using the delays, it is possible to access earlier points.
A working solution is to use the Tapped Delay block (which can be combined with the Matrix Concatenate block if there are multiple MOs).

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by