I am trying to calculate the motor velocity using Incremental Encoder. I understand how its work and the method to calculate the pulses, also when it will take clockwise turn and anticlockwise turn.
Based on the above understanding I wrote a code to count the pulses of Channel A and B.
But when I am running it the value of the count is showing -1 only instead of giving the motor any RPM.
Can you please let me know where I am going wrong ? Please Ignore the comment if it does not make sense to you ?
I believe the condition of counting the pulse for A and B is not written properly.
Pls : I am using Incremental Encoder attached on the DC Motor, I am writing the code on FPGA.