Enabling a subsystem in a multi rate Simulink model at specific time or with a delay
11 次查看(过去 30 天)
显示 更早的评论
I have a multi rate model in Simulink with 3 rates. A (0.1), B (0.2) and C (0.8). This is meant to run in real-time and the rates are specified based on how long each the Subsystems take to execute.
The base rate of the model is 0.1. I have 3 subsystems, each running at the separate rates. I am using Enabled Subsystems to control when I execute each one. I have a drawing of what I am attempting to do.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/162077/image.png)
A has a pulse that is sampled at 0.1, 1 sample wide and 12 samples long with 0 delay. This lets it execute once every 1.0 seconds.
B takes 0.2 seconds to complete and I use a pulse that is sampled at 0.2, 1 sample wide and 6 samples long.
The problem is with C. I can't figure a way to enable C to start at 0.2. I want the periodic rate of C to be delayed by 0.2. So I tried using a pulse sampled at 0.1, 8 samples wide, 10 samples long, 2 sample delay. The pulse works but the system doesn't get enabled correctly. It enables at 0.8.
So the question is how do I get Subsystem C to execute with a delayed start?
0 个评论
回答(1 个)
Richard Zappulla
2017-3-30
To me, it sounds like you are trying to use the enabled sub-systems and pulse generators as a "scheduler" of sorts. I am not sure if this is an option, but you could try making the appropriate blocks in your model "atomic blocks", specify the sample time for each system, and then add rate transition blocks as appropriate. From there, the Simulink "scheduler" will take care of the rest.
Have you explored this option?
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Schedule Model Components 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!