I’ve used two methods here to protect against the NaN error when entering 0 as the period. The first doesn’t completely work, as if you set it to -0.1 it would obvs add 0.1 giving a zero value again.
The second method does stop the error by completely stopping the oscillation steps being carried out.