Altera_Forum
Honored Contributor
9 years agoIncremental Motor Encoder -- How Best to Count Transitions
I need to count the transitions (high and low) of a incremental motor encoder.
I wrote a simple async counter, using only the encoder output signal as the my stimulus (i.e. always @ (posedge relEnc)) but it doesn't seem to work very well, especially at high speeds of the motor. Is there a way to know how fast I could operate this portion of the design? Like an fmax for the relative encoder speed? Otherwise, to get better more accurate counts, should it be done synchronously - use the main system clock 100mhz, to monitor and count the transitions of the encoder clock? Also, I must be blind, but I don't see an Altera LPM block for a simple counter! I wanted to experiment and see if my 'fmax' would be improved using an altera counter.