DPRG List  

[DPRG] More quad encoder stuff

Subject: [DPRG] More quad encoder stuff
From: Dan Miner miner at centtech.com
Date: Fri Aug 31 23:16:54 CDT 2001

> From: R. Bickle [mailto:rbickle at swbell.net]
> Why would you need to use gray code encoding for robots?
> This is very useful for absolute encoders, but motor encoders can be
> incremental much more easily.

Actually, I just noticed I answered the wrong question just
now.  I answered the question: "Why use gray code instead of
binary code?"

What you asked was: "Why use absolute encoders when incremental
encoders work just fine for motors?"  Or at least that's the
question I'm going to answer now.  :-)

Generally, incremental encoders work just fine for all of
our hobby robotics motors.  However, a friend recently bought
a pair of the surplus Pitmann motors that has the HP 500cpr
encoder on the motor shaft.  When the motor spins at 6000rpm,
the encoder outputs 6000RPM * 500 cpr / (60 sec/min) = 50,000
ticks per second PER CHANNEL.  Or 100K ticks per second.
That's 1 every 10 microseconds.  It (practically) requires
hardware to keep up with that.  He's planning on using one
of the 68332 chips that has Motorola's nifty TPU modules 
(a Mini Robo Mind board).

OK - you waded through that long winded example, and you're
asking "So what?"  Well, if you had a 6 bit absolute encoder,
you could use the most significant bit as an interrupt to
keep a software version of more bits.  This would only happen
100K / 32 (for rising and falling) = 3125 times per second.
Much easier.  Then when the software wanted to know the 
current position, it would look at the software (upper) bits
and then read the absolute encoder's lower 6 bits.  
(A warning to those actually implimenting this: BEWARE of
the fact that the software and hardware bits will be slightly
out of sync since you're reading them at different times.
This can be a big problem during overflow or underflow times.
But it's not too hard if you think it through.)

				- Dan Miner

More information about the DPRG mailing list