Error in using Adaptive MPC block

Hi everyone,
i am using the adaptive MPC block to control a Park Model of Brushless motor.
With classic MPC block i have no problem but when i use adaptive one there is some problem from size signals matching oint of view that i am not able to solve, which generates this error in Simulink:
Error in port widths or dimensions. The signal connected to the "Model.DX" port of the "Park_Model_FOC_Adaptive_MPC/Adaptive MPC Controller" block must be a matrix signal of 4 rows and 1 columns.
Error in port widths or dimensions. Output port 1 of 'Park_Model_FOC_Adaptive_MPC/Adaptive MPC Controller/MPC/MPC Matrix Signal Check DX/Input' is a one dimensional vector with 4 elements.
I share the files i have used to simulate the control loop.
Basically i exploits the mpc object from classic mpc and use it in adaptive one after convert its internal plant in dicrete time one.
To reproduce the mpc variable launch the "Park_Model_FOC_Linear_MPC" and in the command writes the follows line:
ct_plant = mpc1.Model.Plant;
dt_plant = c2d(ct_plant,0.001);
mpc1.Model.Plant = dt_plant;
then launch the "Park_Model_FOC_Adaptive_MPC" and so you can analyse my simulink model and see the errors.
I do not understand why the sizes does not match...
Thanks to who can respond.
Pierpaolo.

6 Comments

no one is able to help me??
I also tried to define DX = zeros(4,1); but i have the same error in output from the simulation...
Hi Paolo,
I just ran into the same error and I found solution in a Matlab Chinese Forum.
Here is what you need to do. You go to Matlab Function that you created in your simulink model. Find "Edit Data" under "Editor" there you have to define the size of the outputs of your function. For example, for DX [4,1] for A[4,4].
Good luck!
Hi, I'm facing the same issue. How did you solved?
Grazie in anticipo
@dekun wang You are a hero! Thanks so much! It is very stupid that they have hardcoded this into their template/example with the CSTR model. No idea why ... anyways, you are right!
Dear Pierpaolo ,
To solve the problem of widths based on my practical experience , you should go to matlab function and under edit data you will find A,B,....,DX so to speak , you can select the proper size for the matrix ,A(3,3) ,...., DX(3,1) and then you have go to mpc controller and open it from the arrow at the left-lower corner ,you will find blocks of ther you can add signal specifucation block and select the proper size compatible with the sizes you already selected in the matlab function .
hope this helps
Note : if you are phD student or working in industries I can help more if you need .
have a good luck
Hello Zaidan Zyadat,
I need help with this?
Error:Simulink cannot propagate the variable-size mode from the 'Output Port 1' of 'AMPC_New/Adaptive MPC Controller /MPC/MPC Matrix Signal Check Y/Input' to the 'Input Port 1' of 'AMPC_New/Adaptive MPC Controller /MPC/MPC Matrix Signal Check Y/Matrix Dimension Check'. This input port expects a fixed-size mode. The variable-size mode originates from 'AMPC_New/Update Plant Model'. Examine the configurations of 'AMPC_New/Adaptive MPC Controller /MPC/MPC Matrix Signal Check Y/Matrix Dimension Check' for one of the following scenarios: 1) the block does not support variable-size signals; 2) the block supports variable-size signals but needs to be configured for them.
I am working on load frequency control using AMPC.

Sign in to comment.

Answers (0)

Asked:

on 2 Mar 2021

Edited:

on 23 Dec 2024

Community Treasure Hunt

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

Start Hunting!