Set certain value of signal when it goes above threshold.

2 ビュー (過去 30 日間)
Pawel Rudzki
Pawel Rudzki 2021 年 4 月 14 日
コメント済み: Fangjun Jiang 2021 年 4 月 14 日
Hello, recently I have been trying to simulate this action in Simulink :
I have a velocity signal, I would like to make it control my valve in Simscape.
When value of velocity goes above set threshold, I want it to create a signal that has specific value and it last for specyfic peroid of time.
I have already tried several methods I have found on internet, but none of them seems working. I also have tried to make it by MATLAb function, but the only thing I have achived are detected peaks of signal.
Do you have any ideas how can I make it

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2021 年 4 月 14 日
Use the Relational Operator block to compare the signal against the threshhold value. The output is a true or false signal. Use this signal to trig (either edge or level) or enable an Enabled/Triggered subsystem. Inside the subsystem, provide the desiged signal. Some signal has the ability to specify duration.
  2 件のコメント
Pawel Rudzki
Pawel Rudzki 2021 年 4 月 14 日
編集済み: Pawel Rudzki 2021 年 4 月 14 日
Thanks for replay!
I did what you suggested, but I have one more problem. When triggered subsystem triggers it seems like it set on signal that is inside it. But it turns it on in triggered time, that means in its current state.
The problem is that I made step block to make signal which has "1" value over 2 secounds and then it goes to "0" for the rest of the time. But due to problem described above the output from subsystem is continiously 0. Is there anythink you can suggest, so I can achive what I need to do?
EDIT :
I know it might now solve my problem, but right now I couldn't find better solution :
It works for me perfectly
Fangjun Jiang
Fangjun Jiang 2021 年 4 月 14 日
Not clear what is the problem based on your comments. Based on your original question, the solution is to let the trigger (the comparison aginst the threshold) determine the timing of the signal, and let your signal source inside the subsystem determine the "duration" of the signal.

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by