Problems with the Merge Block

1 view (last 30 days)
Deepak
Deepak on 26 Jun 2015
Edited: Deepak on 26 Jun 2015
I am trying to implement a logic in Simulink but am having some problems with the output of the merge block. The logic is as follows:
  1. When the Input Signal(Shift) changes from >=1 to 0 then the output signal(Posn) must have an impulse of value 2 at the output for say 20 ms and then switch back to 0.
  2. When the Input Signal (Shift) changes from -1 to 0 then the output Signal (Posn) must have an impulse of value 4 at the output for say 20ms and then switch back to 0.
  3. If the Input Signal changes to -1 then the output should have an impulse for 20 ms with the value 1 and revert back to 0.
  4. If the Input Signal changes to >=1 then the output should have an impulse for 20 ms with the value 8 and revert back to 0.
I have tried to implement this logic with Enabled subsystems and have observed that all the requirements are fulfilled except point number 1 although this should work. On logging the signals without the merge block both the enabled subsystems give the correct output. However with the merge block the output does not shift to 2 even though the driving subsystem has an output 2. Could someone please explain why this is happening or if there is some error in my logic. I am attaching the model developed in Simulink 2012 b with the correct stimuli. Thanks a lot.

Answers (0)

Categories

Find more on Modeling in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!