Question on counter roll-over

I'm reading an encoder-disk from a wind speed indicator. The encoder-disk will be turning at various rates, 7/24, as the wind blows... Currently I have Arduino INT0 tied to the photo-interrupter which the encoder holes pass thru, and on each falling edge, the ISR simply increments a counter. This will be evaluated every second.

Obviously this counter, no matter how large, will eventually overflow and a Previous reading will be some large number and the Current reading will be 0. I'm wondering how to handle this.

When the wind is at the max (100 knots) the encoder will be producing a 793 hz pulse-train, and at 1 knot (assuming system linearity) the signal will be 7.93 hz. I save the current encoder pulse-count reading as PrvCount, then read the encoder-counter to CurCount. PrvCount is always subtracted from CurCount and the difference is the signed speed change which is converted and sent to a stepper to move to the output system. Negative steps go counter-clockwise.

The output stepper should never move across 360 degrees. As it increases it will go to 359, and either just stay there and when things slow down, return counter clockwise to 0.

I've just started testing, and often I'm getting movement past 360 in both directions! Since the greatest frequency/pulse-ct I want is 793 - I'm wondering if I should increment the encoder-counter mod 793, and if this would avoid the roll-over prob.

There is no code included here as I feel this is a code-independent question.

Why not just clear the counter as you read it at periodic intervals? I think that is the standard approach for pulse counting tachometers.

aarg:
Why not just clear the counter as you read it at periodic intervals? I think that is the standard approach for pulse counting tachometers.

Hmm - I was thinking of that, but was afraid it might cause errors. Easy enough to give it a go!

Delta_G - thanks for the mention of BWD - think I'd seen that before, but forgot where it was!