0
votes

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.

1
The doc has an example of zero crossing detection with explanations. Note that zero crossing detection is something that only works in simulation because it involves the possibility of going backwards in time (looking for the zero crossing point). It has no equivalent in real-time. - Phil Goddard
@PhilGoddard Why we have to look for zero crossing point ? and also i noticed in the documentation that there are a set of zero crossing variables for some blocks which is used to detect upper threshold or lower threshold. why we have to detect upper or lower threshold ? - Harsha
If you are modelling a bouncing ball (which is the example in the link in my previous comment), do you want to know the exact time that the ball hit the ground? If so, then you need zero crossing detection turned on. If you are happy for the simulation to show the ball starting to rise before it hits the ground then you don't need zero-crossing detection. The thresholds just specify how close to the ground you are happy with. A small threshold indicates a more accurate simulation is required. - Phil Goddard
@PhilGoddard I edited the question. I was not able to add comment here as it was too long. - Harsha

1 Answers

2
votes

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:

Block diagram of zero crossing detector &

Output of zero crossing detector:

output of zero crossing detector