Error:Error evaluating 'InitFcn' callback of MPC block (mask) 'ControlSyst/MPC Controller1'. Callback string is 'impcblock_InitFcn' Caused by: You have connected a signal

23 vues (au cours des 30 derniers jours)
I would be highly appreciated if you help me to remove that bothering notification and run my simulation smoothly. Kindly note that I have attached the file to my query.
Best regards,
Moaaz

Réponses (1)

Githin George
Githin George le 4 Déc 2024 à 6:49
Hi Ahmad,
I have tried running the model with the “param_init” script that you have provided but it seems that “mpcobj” (MPC Controller) is not specified in the “MPC Controller Block” and I end up with another error.
But assuming that you have received an error message as shown below:
```
You have connected a signal to the "Measured Disturbance (md)" inport of the MPC block "ControlSyst/MPC Controller1",
but the MPC controller referred in this block does not have measured disturbance inputs.
```
I suspect that the error is originating because you haven’t provided the information related to the MPC signal types for the input and output signals in the LTI system object (plant) used for creating the “mpc” object, specifically for the “Measured Disturbance (md)”. You can refer to the function “setmpcsignals” to do so:
Note that the “Measured Disturbance” port is optional for the “MPC Controller Block” but the port is only valid assuming that the MPC Struct contains information related to the “Measured Disturbance” signals.
You may want to refer to the script in the following example for more information on the setup:

Community Treasure Hunt

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

Start Hunting!

Translated by