Make Timer in Simulink

33 Ansichten (letzte 30 Tage)
Aashish Bhandari
Aashish Bhandari am 7 Jun. 2023
Kommentiert: Aashish Bhandari am 28 Jun. 2023
Hello. I have 1 or 0 Signal coming as a input from my Ultrasonic Sensor. I want to make a Timer in simulink so that, if my input is 1 continuous for 5 seconds ,it gives me 1 at end, if not the timer starts again ,when 1 comes from the Sensor. I have Speed of Car and my distance. I wanted to integrate the distance to get time. Thankyou so much.
  2 Kommentare
Sathvik
Sathvik am 28 Jun. 2023
You can use Timer APIs to access timers programatically. Here's a link to the documentation.
Aashish Bhandari
Aashish Bhandari am 28 Jun. 2023
Thankyou so much:)

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Fangjun Jiang
Fangjun Jiang am 28 Jun. 2023
It might be easier to implement it through Simulinnk block diagram, similar to this one.
  1 Kommentar
Aashish Bhandari
Aashish Bhandari am 28 Jun. 2023
Thankyou. I also used Integrator (Discrete) with reset to 0, if the conditon doesnot match and if condition match then compare to 10 for 10 seconds.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Simulink finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by