How can I demonstrate the pulse width as number on display in Simulink?

조회 수: 4 (최근 30일)
mohamed Elarayshi
mohamed Elarayshi 2019년 12월 19일
답변: Divya Yerraguntla 2020년 1월 6일
Hi, i have a pulse generator that i made frome delay as shown in picture, that is used to drive a motor through H-bridge, then i would to do some action based on the duration of one pulse, for example if i have apulse width =2msec, i would to perform an action if = 1msec another action, and etc.. with diffrent pulse width, the problem that i dont know how to get the puls width as double or boolean data to pe used with a stateflow or if function. can someone help me?? thanks.Screenshot 2019-12-19 at 17.07.32.png

답변 (1개)

Divya Yerraguntla
Divya Yerraguntla 2020년 1월 6일
Hi Mohamed,
Assuming you have the Frequency and Duty_Cycle as inputs to the model, you could calculate the Pulse Width as:
where PW = Pulse Width in sec, f = frequency in Hz , D = Duty Cycle in %.
using Product or Divide blocks in Simulink.
Hope it helps!

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by