View Single Post
  #3   Spotlight this post!  
Unread 19-02-2005, 07:44
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Encoders, interrupts, and edge-triggering issues

Quote:
Originally Posted by Kevin Watson
Yes, this effect is easy to produce with encoder in hand, but I can't imagine this would ever be a problem in practice because any mechanical system that you'd couple the encoder's shaft to will possess far more rotational mass than the shaft alone. This coupled mass, in general, will strongly dampen vibrations that might cause this effect.
It's a problem in our practice. The mechanical system to which we have connected our encoder is a very small, very light omniwheel which rolls on the carpet. Like any simple omniwheel, it bounces some as it rolls. I guarantee that without the additional interrupt-edge-switching logic we get spurious counts, and with it we do not.

We're using a 64 count per revolution encoder. At an unreasonably high 15 fps, it would normally generate about a thousand interrupts per second. We figure the PIC can easily handle "several" thousand interrupts per second, so doubling the rate shouldn't break anything. Even at the unreasonably fast rate, the time between Phase A changing and Phase B changing is greater than 200 microseconds, plenty of time for the interrupt service routine to read the Phase B state. In our application, at least, the pulse catcher circuit is not needed. Indeed, it would not work for us at all without significant modification to clock on both transitions of Phase A.

Last edited by Alan Anderson : 19-02-2005 at 07:46.