필터 지우기
필터 지우기

TurnOffDelay delays a falling edge of the input signal on Simulink

조회 수: 21 (최근 30일)
Giulia
Giulia 2023년 3월 28일
댓글: Giulia 2023년 4월 4일
Hello,
I'm working on a simulink model and I have to compute a function which basically delay the falling edge of my input signal.
This is what the function have to do :
  • if signal switch from true to false, a timer is initialised with a given delay Time.
  • On being false the timer is decremented by the given sampling time.
The output should be:
  • False if the input signal is false and timer <0.
  • Otherwise is set to true.
Thanks in advace.

답변 (1개)

Meet
Meet 2023년 4월 4일
You can implement the function you described using a Stateflow chart in Simulink. Here are the steps to do so:
  1. Create a new Stateflow chart by right-clicking on the Simulink canvas and selecting "Add->Stateflow chart".
  2. Create two input ports for your input signal and your delay time.
  3. Create two output ports for your output signal and your timer value.
  4. Add a state in your Stateflow chart to represent the initial state of your system. This state will be active when the simulation starts.
  5. Add a transition from the initial state to a state that will handle the rising edge of your input signal. In this state, set the timer value to the delay time.
  6. Add a transition from the rising edge state to a state that will handle the falling edge of your input signal. In this state, check if the timer value is greater than or equal to zero. If it is, output true and decrement the timer value by the sampling time. If it is not, output false.
  7. Add a transition from the falling edge state back to the rising edge state.
  8. Connect the input and output ports of your Stateflow chart to the appropriate blocks in your Simulink model.
  9. Set the parameters of the Stateflow chart to match your system requirements.

카테고리

Help CenterFile Exchange에서 Signal Generation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by