Triggering blocks on simulink

4 ビュー (過去 30 日間)
Maria de Eusebio
Maria de Eusebio 2020 年 5 月 21 日
コメント済み: Maria de Eusebio 2020 年 5 月 21 日
Hello!
I have a simulink system with two blocks, a and b. When block a outputs a value 0.75, block b has to stay up and runnning, which will alter the value of block a. And once block a has reached a value 0.85, block b shuts down. How can I simulate this? I'm trying to use the triggered subsystem but I don't know if it is correct (the triggered subsystem with a rising edge, the output of block a as input, 0.75 as the minimum signal value and 0.85 as the maximum. Is this correct?)

採用された回答

Joel Van Sickel
Joel Van Sickel 2020 年 5 月 21 日
Hello Maria,
you may want to consider using the enabled subsystem, so that it keeps running till the enable signal goes low again. Then you can have it on while the values is between 0.75 and 0.85 by using basic comparisons and logic.
Regards,
Joel
  3 件のコメント
Joel Van Sickel
Joel Van Sickel 2020 年 5 月 21 日
ah, the enabled subsystem will still work, you just need to modify your logic to stay high after passing 0.75, and then you want to reset it to 0 once it passes 0.85. You can do this with a latch or flip flop type logic.
If you use the block in the link below, you can feed a rising edge trigger n 0.75 to S, and a rising edge trigger to R on 0.85 and I think it will do what you want. I haven't tested it out though.
Maria de Eusebio
Maria de Eusebio 2020 年 5 月 21 日
This was just what I was looking for! Thanks!

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

その他の回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2020 年 5 月 21 日
It sounds right. Comparing a with 0.75 and 0.85 will generate two high or low logical signals. Combine these two logical signals to determine triggering the subsystem, either use edge trigger or enable/disable the subsystem.
  1 件のコメント
Maria de Eusebio
Maria de Eusebio 2020 年 5 月 21 日
Thanks a lot for your answer. Sadly, It doesn't really make the code run how I want. What I want is that the first time block a has a value <=0.75, block b becomes active. Afterwards, block a can have any value smaller or larger than 0.75, block b will still be active. And it will remain active until a is 0.85. So the first time a is <=0.75, b will kick in and remain active no matter what, until a is 0.85.
Thanks!

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

コミュニティ

カテゴリ

Help Center および File ExchangeSchedule Model Components についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by