フィルターのクリア

Error evaluating 'InitFcn' callback of Adaptive MPC block

89 ビュー (過去 30 日間)
Mahdi Mansouri
Mahdi Mansouri 2019 年 6 月 12 日
回答済み: VIDYASAGAR TUMMAKURI 2023 年 8 月 14 日
Hi guys,
I follow one of MATLAB MPC design example, "Design MPC Controller for Position Servomechanism" from here . I could successfully design my own MPC model and the simulation results were fine. Then I headed on to apply to adaptive design instruction, but my simulation fails and I just received the following error:
--> Error evaluating 'InitFcn' callback of Adaptive MPC block (mask) 'ampc_dc/Adaptive MPC Controller'.
Callback string is 'ampcblock_InitFcn'
Caused by: For compatibility with the adaptive mode, the plant model specified in your controller object must be LTI state-space (OK), have the same sampling time as the controller (Violated), and be delay-free (OK). The "ss", "c2d", "d2d" and "absorbDelay" functions perform the necessary conversions. <--
I would be highly appreciated if you help me to lift that bothering notification and run my simulation smoothly. Kindly note that I have attached the file to my query.
Best regards,
Mahdi

採用された回答

Mahdi Mansouri
Mahdi Mansouri 2019 年 6 月 15 日
編集済み: Mahdi Mansouri 2019 年 6 月 24 日
I have keep trying to solve the problem and finally found a solution for. I exported the Simulink file to a previous version (2013b) and surprisingly found that it worked (the new functional version attached). The only point to be considered is that the gear ratio should not be changed abruptly. It means similar to driving a sedan vehicle that we usually shift from 1 to 5 orderly, 1 to 2, 2 to 3, 3 to 4, and 4 to 5, the rate of gear ratio change has to be limited. It is why I have put a rate limit block in the simulation file.
BR,
Mahdi
  1 件のコメント
dekun wang
dekun wang 2021 年 3 月 14 日
Hi Mahdi,
I ran into the same error as you did. I am glad you solved it. But you didn't update the attach files with your simulink model. I didn't get how you fixed the problem by adding a rate limiter. If you can elaborate or share the new files, I would really appreciate that!

サインインしてコメントする。

その他の回答 (2 件)

Ahmed Elgohary
Ahmed Elgohary 2022 年 3 月 5 日
If you are using clear all syntax in your editor, so you have to delete it because when you run the MPC controller, the MPC block sends the mpc parameters to the work station and when you run the model so you are clearing those parameters from the workspace due to using clear or clear all syntax and the mpc can not find "initFcn".
  2 件のコメント
Adesola Bankole
Adesola Bankole 2022 年 4 月 23 日
Thank you Ahmed Elgohary.
I commented the 'clear all' syntax, and everything went fine.
houdatoi brn
houdatoi brn 2022 年 5 月 12 日
hello, i removed clear all but i m still getting the same error, do you know what could be the problem

サインインしてコメントする。


VIDYASAGAR TUMMAKURI
VIDYASAGAR TUMMAKURI 2023 年 8 月 14 日
Hi,
The following checks should be performed while using the Adaptive MPC toolbox to avoid compatibility errors.
  1. Discretizing sample time of the prediction model in "mpcobj.Model.Plant" should be the same as "mpcobj.Ts."
  2. Sample time of the successive linearization MATLAB function should be the same as "mpcobj.Ts."
  3. The simulation sample time should have an integer multiple of "mpcobj.Ts."

カテゴリ

Help Center および File ExchangeLinear Plant Specification についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by