Reputation: 23
I would like to know when to enable/disable zero-crossing detection option in Simulink blocks. Please explain with an example. What happens if we disable the option and run the simulation ?
I know that zero-crossing detector will tell number of times signal is crossed zero or changed sign. But I want to know when we've to enable this and a real-time example with its use ?
Example of bouncing ball referred here can be seen in the link provided below by phil Goddard in his comment. I understand the dynamics of bouncing ball. Initially a ball is thrown upward with initial velocity 15 m/s. So if we see the velocity plot, Initially velocity is decreasing and when ball reaches its top, velocity is zero and then ball starts to fall down and velocity is increasing in the -ve direction. when ball touches the ground, kinetic engery is converted into potential energy and little heat energy and again potential energy is converted to kinetic and ball starts to raise. That's why At position zero, velocity is again rise up to maximum and the same sequence follow. I ran the model with both zero-crossing detection enabled and disabled but I didn't see any difference in the scope plot.
Thanks in advance.
Upvotes: 0
Views: 6198
Reputation: 21
You can use a combination of sign block from simulink>math operations library and saturation block by adjusting the limits of saturation block to 1 and 0. Then do product with -1 followed by addition of 1 so that the output shows 1 when signal is below 0 and output is 0 when signal is above 0.
Block diagram of zero crossing detector:
Output of zero crossing detector:
Upvotes: 2