Reference preview/look-ahead in Simulink

23 views (last 30 days)
Qibin Chen
Qibin Chen on 16 Aug 2019
Answered: MARTIN MA on 27 Jun 2023
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 https://nl.mathworks.com/help/mpc/ug/improve-control-performance-with-look-ahead.html.
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 (3)

Johannes Lips
Johannes Lips on 29 Nov 2022
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 (https://de.mathworks.com/help/mpc/ref/mpc.mpcmove.html) 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).

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.

MARTIN MA
MARTIN MA on 27 Jun 2023
For the people who wonder why a reference preview is needed, the below picture (from professor Alberto Bemporad and his course ppts: http://cse.lab.imtlucca.it/~bemporad/mpc_course.html)may give you a hand.
By the way, the FIFO Buffer block mentioned in the video https://www.mathworks.com/videos/matlab-and-simulink-robotics-arena-walking-robots-pattern-generation-1546434170253.html looks like doing the reference previewing job. However, how to build the FIFO Buffer really confused me after reading its code, appreciate it if anyone can give some insights.
Regards.

Products

Community Treasure Hunt

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

Start Hunting!