Hi All
I have the following problem. I have two rotary encoders, each rotated by a stepper motor. The two stepper motors receive impulses from the same source, therefore they must rotate the same number of steps in the same direction. The encoders should reflect that. They should send exactly the same number of impulses to the control circuit. However as the system works a difference develops. The difference is completely random, it's not like one encoder consistently counting more than the other. Sometimes one encoder produces less impulses than it should, while the other is exact. Sometimes both count less steps than they should. Sometimes one counts more steps than it should, sometimes both count more. I think this is due to external noises but I'm not sure. And I'm 100% sure that the stepper motors do make the exact number of steps. I.e. the problem is somewhere in the circuit that counts the impulses from the encoders.
My control circuit is a simple one, including a microcontroller (ATmega644) to count the impulses and several analog comparators (LM393) to convert the differential signals sent by the encoders into non-differential. The comparators are in the same PCB close to the MCU. However I haven't included any noise cancelation elements around the comparators. They don't even have hysteresis. That's the first time I deal with such an issue and underestimated the complexity of the issue. I only realized that noises are something that I'll have to deal with, after I got the less than ideal results.
If someone has an experience with encoder tracking and noise cancelation techniques I'd be glad if you shared your experience.
Thanks in advance