triggering a pulse signal

조회 수: 24 (최근 30일)
Tommaso Colamartino
Tommaso Colamartino 2021년 5월 1일
편집: Tommaso Colamartino 2021년 5월 6일
Goodmorning to all,
I would like to create a simulink model where a boolean true triggers a pulse signal that lasts a precise n. of periods, even if in the meanwhile the trigger goes off. Does anyone know how to do it?
  댓글 수: 2
Nagasai Bharat
Nagasai Bharat 2021년 5월 4일
Hi,
Do you mean a single pules with period "n" or n pulses of a particular period are to be generated when the boolean goes true?
Tommaso Colamartino
Tommaso Colamartino 2021년 5월 5일
편집: Tommaso Colamartino 2021년 5월 5일
@Nagasai Bharat sorry, I realized now it wasn't so clear.
I've got this true signal of 10ms that can arrive whenever it wants, it could income at simulation time > 0, it depends on an other subsystem; when it arrives, after it switches again from T to F (i.e. 10ms) i want n pulses with given freq exiting my subsys.
I tried with enable subsys but it doesn't seem to work. Any idea?
thanks!

댓글을 달려면 로그인하십시오.

답변 (1개)

Nagasai Bharat
Nagasai Bharat 2021년 5월 5일
Hi,
I have tried a logic with both enable and triggered subsystems and it seems to work for your use case.
I have attached the Simulink file.
Here in the Triggered subsystem I am trying to get the point when your true signal comes and then this would be passed into the Enabled subsystem where a Counter (Counts the rising edges of the pulse passed to it) is implement with a Switch Block to discards the pulses greater than the number specified.
  댓글 수: 1
Tommaso Colamartino
Tommaso Colamartino 2021년 5월 5일
편집: Tommaso Colamartino 2021년 5월 6일
@Nagasai Bharat Nice! I don't know why the enabled subsys didn't work for me. Did you change something in the solver?
There is only one problem: if my triggering signal comes at an instant different form a multiple of the period of the pulse generator, I will have the first pulse with a period different from the others. To understand what I'm saying, try to change in the model you sent the step time of the step input with a non-integer number.
is there any possibility to put the pulse inside the enabled subsystem so that it starts when the subsystem is enabled?
Thanks a lot!
UPDATE: I was able to put the pulse gen inside the enabled sys. but it starts counting when the simulation begins, so it doesn't seem to be the solution

댓글을 달려면 로그인하십시오.

카테고리

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