I'm developing a prototype that uses a quadrature encoder to measure it's linear displacement. The encoder is attached to the prototype body and has a wheel in it's shaft. As the prototype moves straight forward the encoder measure the linear distance. All the trouble around the conversion between linear/angular units have been worked out.
The reason to measure the distance with an encoder is that i NEED to know everytime that the prototype has traveled exacly 1 mm (1 millimeter = 0.0393 in). Everytime it moves 1 mm, PIC activates another system.
The way it has been done before I started working on it is by reading the encoder with a PIC (16F688) in it's I/O ports. It was kindda ok but when I added some features to the PIC code, if the prototype linear speed is greater than ~1.77 in/s (~45 mm/s) PIC starts missing the encoder count.
I've tried using the IOC (interrupt on change) from portA to read the quadrature signal (channels A and B) but it wasn't effective.
I know that there are dsPIC's but I need to solve this in my board and I have only 14 pins to do so lol. So i found this PIC16F1825 which has a higher (4x) freq. Could that (my PIC low freq) be my main problem??
I'm was thinking about using the LFLS7183 UP/DOWN signals with the timer/counter from PIC or another counter IC so that would reduce the amount of signaling to PIC. Would that work? Which counter should I use? I don't have 8 pins in my PIC to use as in those http://goo.gl/2Wc3d.
My encoder isn't my problem, I've checked and it can track as far as 76 feet/s for my wheel radius.