Hi, I'm working on a robot controller by PIC16F877A, I've a DC motor driven by L298, and a rotary encoder mounted on the motor's shaft, the resolution of the encoder is 400 PPR, I take the signal from the encoder through a low pass filter and a Schmitt trigger, then an external counter divide the frequency by 16,
Now when I power up the circuit and move manually the motor, the PIC counts right, after a certain number of pulses a led give me a signal.
But when i connect the motor to the driver the PIC doesn't count correctly, it counts more pulses than the correct number, for example if the motor has to stop after 2 rotations, it stops only after a half rotation, that mean that the PIC counts false pulses.
I think these false pulses come over from noise on the PIC that have to count the pulses, but i use 2 low pass filters, and a schmitt trigger,,,
Someone can help me overcome this problem ???
THANK YOU
Now when I power up the circuit and move manually the motor, the PIC counts right, after a certain number of pulses a led give me a signal.
But when i connect the motor to the driver the PIC doesn't count correctly, it counts more pulses than the correct number, for example if the motor has to stop after 2 rotations, it stops only after a half rotation, that mean that the PIC counts false pulses.
I think these false pulses come over from noise on the PIC that have to count the pulses, but i use 2 low pass filters, and a schmitt trigger,,,
Someone can help me overcome this problem ???
THANK YOU