The ability to reset the state of a signal such as a Pulse Generator is currently not available in Simulink 7.8 (R2011b). This is because the Pulse Generator signal works under the following calculation, which is based on simulation time:
if (t >= PhaseDelay) && Pulse is on
Y(t) = Amplitude
else
Y(t) = 0
end
As a workaround, the pulse generator can be connected to an external time signal which is fed by a Counter Free-Running block. Whenever the subsystem is re-enabled, the counter is reset to zero to denote zero time and therefore zero phase.
One thing to note with this is that the counter is incremented by 1 at every time step, so the period of the pulse generator signal will need to be "normalized" to account for the simulation time step size.
Please see the attached model for more information on this workaround. The pulse generator signal is interrupted with a negative pulse. When the enabled subsystem is re-enabled after this interruption, the pulse begins from its zero-phase point no matter what time the simulation is in.
Best Answer