Run sections of Simulink diagram separately

9 ビュー (過去 30 日間)
Dalton Dune
Dalton Dune 2019 年 6 月 18 日
回答済み: Raj 2019 年 6 月 19 日
So just as MATLAB code can section parts of the code and run them individually, I would like to do the same with Simulink. Some background: I have a robotic arm inverse kinematics as one section, the second section is a PID control on a DC motor. I want the end effector of the robotic arm to get in place first (the inverse kinematics section to run first) before the DC motor runs. The DC motor is separate from the robotic arm but the time and speed that it runs will depend on the robotic arm.
Is there a way to run them separately with some block, or have the program pause? Maybe I should keep the sections in separate files, save data from the first section to Workspace, then use that workspace data in the second section. Not sure, any advice?

採用された回答

Raj
Raj 2019 年 6 月 19 日
1)"keep the sections in separate files, save data from the first section to Workspace, then use that workspace data in the second section" Yes that's one way but quite cumbersome i think.
2) Convert your DC motor section of model into an 'Enabled Subsystem'. Once your robotic arm model completes its run, set a control flag/signal which can be used as a trigger for the DC motor subsystem. See details here.
3) Convert your DC motor section to a 'If action subsystem' and use the time vector from a clock to start the DC motor section after sometime(this time should be sufficient for the robotic arm model to complete its run). See details here.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRobotics についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by