Julio Santos
Julio Santos

Reputation: 21

Matlab Simulink Square Wave

I am new to Simulink and I am trying to model an oscillator to control an automation controller. The question is: I created a pulse generator that results in a square wave. To design the oscilator I need that 2 others chanels (one is the same signal, while other is the reverse) remain in zero when the input (the square wave) is oscillating. The problem is that I can't make the other 2 signals remain in zero. I tried using the blocks for discrete elements in the library, such as: "Delay", "Unit Delay", and even "Zero Order Hold". Every block just shifted the entire curve, while what I need is to delay the signal when it assumes the "1" value. Follows some prints: enter image description hereenter image description here

I have no reputation for all the images so: the subsystem consists of 3 pulse generators, and theres a scope linked to the subsystem

Please Help!!!!

Upvotes: 2

Views: 5006

Answers (1)

Phil Goddard
Phil Goddard

Reputation: 10762

It sounds like you're asking for a signal that rises at some pre-specified delay after the pulse generator rises, but falls at the same time as the pulse. This is shown in the picture below,

enter image description here

If that's correct, then it can be created using an enabled subsystem, where the subsystem contains only a unit delay, as shown in this picture,

enter image description here

Within the subsystem you must also

  1. Set the Enable block to reset its states.
  2. Set the Outport block to reset its value when disabled AND set an initial value of 0.
  3. Specify an appropriate sample rate in the Unit Delay block (this acts as the amount by which the rising signal is delayed)

Upvotes: 3

Related Questions