Set certain value of signal when it goes above threshold.

7 visualizaciones (últimos 30 días)
Pawel Rudzki
Pawel Rudzki el 14 de Abr. de 2021
Comentada: Fangjun Jiang el 14 de Abr. de 2021
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

Respuestas (1)

Fangjun Jiang
Fangjun Jiang el 14 de Abr. de 2021
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 comentarios
Pawel Rudzki
Pawel Rudzki el 14 de Abr. de 2021
Editada: Pawel Rudzki el 14 de Abr. de 2021
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 el 14 de Abr. de 2021
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.

Iniciar sesión para comentar.

Categorías

Más información sobre General Applications en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by