Is possible uses PLC Code Generation with MPC (Model Predictive Control)

6 ビュー (過去 30 日間)
Yang Gomez
Yang Gomez 2013 年 5 月 27 日
コメント済み: sandeep chowdhury 2019 年 4 月 22 日
Hello Guys, I am working in my final proyect of my career. My goal is implement a Predictive Control in a PAC
The PAC is of Rockwell Automation, Logix5000 Models.
I found the tool of matlab for converter a simulink model to PLC Code, its name is PLC Code Generation. I was make some examples with simple controllers and PID in discrete time. I found a MPC Block, and i was tunning this controller for my plant. I was run a simulation and this is rigth. Now I will want generate the PLC Code.
I converted the MPC Block of simulink in a Subsystem and set the solver type for Fixed-step, i dont change de Solver, now i use ODE3
Then, i activeted Treat as atomic unit. but when Check Subsystem Compatibility, appears some errors
The first error is: Variable-size arrays are currently disable for code generation. Consider selecting the support varable-size signals option on the configuration parameters > code generation > interface page.
And i try enable this option in the options, but this option no appear for any place.
You can helpme, Thanks you and sorry for my bad english
  1 件のコメント
Kaustubha Govind
Kaustubha Govind 2013 年 5 月 29 日
What version of MATLAB are you using? It looks like that pane should have the Support variable-size signals checkbox: http://www.mathworks.com/help/rtw/ref/code-generation-pane-interface.html

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

採用された回答

Arkadiy Turevskiy
Arkadiy Turevskiy 2013 年 5 月 30 日
編集済み: Arkadiy Turevskiy 2015 年 5 月 11 日
At the time this question was asked MPC Controller block did not support structured text generation with Simulink PLC Coder. This support has been since added starting with R2014a, so this will work now.
Here is an example illustrating the workflow.

その他の回答 (2 件)

Yang Gomez
Yang Gomez 2013 年 5 月 31 日
Hello Man, Thanks for your answer.
I was think, MPC Toolboox not supported PLC Code Generation, and you are confirmed my apreciation.
For the moment, i solve this problem with using a OPC Server between MATLAB and RSLINK GATEWAY.
Regards
Yang Gomez
  1 件のコメント
sandeep chowdhury
sandeep chowdhury 2019 年 4 月 22 日
Hi
Does using OPC server works perfectly in real time processes or it adds delay ?

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


Magdi Nabi
Magdi Nabi 2017 年 10 月 3 日
hi, just an inquiry, are you saying i can implement MPC to Rockwell PLC unit (Allen Bradley)?
the reason i am asking i am designing PID cascade control for my system, however i know MPC is a perfect tool and its more precisely that the classic PID so if i can implement MPC to PLC that will be great,
Please correct me if i am wrong.
Thank you

Community Treasure Hunt

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

Start Hunting!

Translated by