Hey All-
Thanks to everyone who helped me get my rotary encoder up and running a bit ago. I switched from mechanical to optical like most of you suggested (Aligent Technologies HRPG series). It's working now...part of the time.
When I spin the shaft by hand it registers correctly. I've tried spinning both directions by hand at about .5 RPM and up to about 300 RPM. It registers correctly, registering approximately 500 “clicks” per rotation and counting properly on my readout.
But when I mechanically attach the encoder to a drive shaft on my machine and then run the machine, the encoder gives very erroneous measurements. The machine's shaft spins the encoder quite slowly, ranging from .25 RPM to about 10 RPM in either direction. With the machine driving, the readout I have hooked up shows unpredictable counting, sometimes jumping back when the count should be going up, and generally counting orders of magnitude too fast.
While the machine is stopped the encoder readout is static.
The encoder has five leads, which i've wired as follows:
Data Line 1 with external 10k pull down
Date Line 2 with external 10k pull down
+5 V coming from the arduino
Ground
“Body” ground
The cable between the encoder to the control box is about 50' of 20 GA unshielded wires.
Any thoughts about how to chase down/correct the problem would be appreciated. I'm not very experienced with electronics so please keep that in mind with your explanations.
Thanks!