Triggering blocks on simulink

4 visualizzazioni (ultimi 30 giorni)
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?)

Risposta accettata

Joel Van Sickel
Joel Van Sickel il 21 Mag 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 Commenti
Joel Van Sickel
Joel Van Sickel il 21 Mag 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 il 21 Mag 2020
This was just what I was looking for! Thanks!

Accedi per commentare.

Più risposte (1)

Fangjun Jiang
Fangjun Jiang il 21 Mag 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 Commento
Maria de Eusebio
Maria de Eusebio il 21 Mag 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!

Accedi per commentare.

Community

Più risposte nel  Power Electronics Control

Categorie

Scopri di più su Schedule Model Components in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by