2
votes

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!!!!

1
what about a multiplicator?Robert Seifert
Im not sure if I got it rigth: you want 3 signals? 1 is square wave, the other is exactly the same, but is zero when the first is square wave? And the second also? Sorry, I just dont understand :( .Can you please elaborate, or put some examples?Ander Biguri
Hi Ander! The first is a square wave, the second has the same origin (same pulse generator) but needs a delay to stay true after it receives a 0, but can't delay to go from 1 to 0(it needs to be a block where I can select the delay time) and the third is the reverse of the second signal(a NOT operator). The problem is that using the delay blocks, I got the entire signal shifted, while what I need is to delay the signal only when it goes from 0 to 1.Julio Santos
What you describe does not sound like a signal delay. Do you want the second signal to stay at 0 longer than the first signal? For this it is easier to create a new signal than generate from first signal.Navan
Hi Navan! It's exactly what I need! It is easier indeed, but I'm trying to simulate an automation controller oscillator and it operates this way. It is not a signal delay then? How should I call it? Perhaps there's another block that can help, but I can't find which oneJulio Santos

1 Answers

3
votes

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)