Roland Jollivet wrote: > > > 2008/8/6 Jeff Epler <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> > > To accurately read a quadrature signal you must sample it frequently > enough that there is absolutely never more than one input transition per > sample............. > > > Hi > Why aren't simple set-reset latches used? with interrupt on change? Then > you only need to act when something happens, instead of spending a lot > of time checking to see if it might happen, and you'll never miss a > change, ever. OK, here's a test case :
Assume A and B were both low, you wait a while and check again, now both are high. You have no way to know whether this is two counts plus, or two counts minus. Or, if they both changed at the same time, you should ignore the invalid state transition and wait for a valid change of only one signal at a time. Some encoders jitter a LOT, and you need to decode the changes fast to make sure not to miss a valid transition in between all the dithering. As for the interrupt, if you want to write your own interrupt handler, be my guest. I'd love to see the code when you get it done. An interrupt-driven encoder counter would be a cool component to have. > Add another simple circuit that will monitor > -another-trigger-before-latch-cleared-, and you will immediately be > alterted that the PC was not fast and missed a pulse. > And then, what do you do? Estop? force the user to rehome the axes? They won't be happy. > Maybe it's the style of the algorithims that make this difficult? You could use the relatively cheap US Digital encoder counter chips that have all this built in, or some other scheme. Jon ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
