Error evaluating 'InitFcn' callback of Adaptive MPC block
이전 댓글 표시
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
채택된 답변
추가 답변 (3개)
Ahmed Elgohary
2022년 3월 5일
1 개 추천
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
2022년 4월 23일
Thank you Ahmed Elgohary.
I commented the 'clear all' syntax, and everything went fine.
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
2023년 8월 14일
0 개 추천
Hi,
The following checks should be performed while using the Adaptive MPC toolbox to avoid compatibility errors.
- Discretizing sample time of the prediction model in "mpcobj.Model.Plant" should be the same as "mpcobj.Ts."
- Sample time of the successive linearization MATLAB function should be the same as "mpcobj.Ts."
- The simulation sample time should have an integer multiple of "mpcobj.Ts."
said belhadj
2024년 11월 5일
0 개 추천
bonjour Mr MAHDI MANSOURI. Je souhaite faire un controleur MPC POUR COMMANDEr un convertisseur dc-dc
j'ai comme entree un courant de reference et un courant mesuré
la sortie est un signal de l'interupteur avec son opposé
comment utilise ce controlleur MPC
MERCI
카테고리
도움말 센터 및 File Exchange에서 Model Predictive Control Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!