Set certain value of signal when it goes above threshold.

조회 수: 7 (최근 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 CenterFile Exchange에서 General Applications에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by