Filter löschen
Filter löschen

Triggering blocks on simulink

3 Ansichten (letzte 30 Tage)
Maria de Eusebio
Maria de Eusebio am 21 Mai 2020
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?)

Akzeptierte Antwort

Joel Van Sickel
Joel Van Sickel am 21 Mai 2020
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 Kommentare
Joel Van Sickel
Joel Van Sickel am 21 Mai 2020
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 am 21 Mai 2020
This was just what I was looking for! Thanks!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Fangjun Jiang
Fangjun Jiang am 21 Mai 2020
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 Kommentar
Maria de Eusebio
Maria de Eusebio am 21 Mai 2020
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!

Melden Sie sich an, um zu kommentieren.

Communitys

Weitere Antworten in  Power Electronics Control

Kategorien

Mehr zu Schedule Model Components finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by