From: dkelvey on
On Apr 26, 1:59 pm, -jg <jim.granvi...(a)gmail.com> wrote:
> On Apr 27, 6:19 am, Spehro Pefhany <speffS...(a)interlogDOTyou.knowwhat>
> wrote:
>
>
>
> > If you only care about speed and not direction, one edge on one channel may be sufficient.
>
> A purist could argue, that for position, all edges should be used,
> (you can easily discard precision later) but for speed readings, only
> the same edges should be considered, as quadrature encoders are NOT
> guaranteed to have 50.00% duty cycles (or even 90.00' alignment).
>
> -jg

Hi
One problem to watch out for is to not feed an analog encoder output
in to a Schmidt triggered buffer. The problem is the levels it
switches
at eats up most of the phase margin. I've seen a couple of mouse
designs that were real flaky using a 74HC14 directly from the encoder.
As things ( led ) age, the mouse begins to fail.
You need to amplify the signal some first such that the rise and fall
phase angles are sharper than the sine/cosine of the encoder.
One could also use something like a comparator chip with less
positive feedback than the 74HC14 uses.
Dwight
From: Mark Moulding on

"Magnum" <Multum.In(a)Parvo.invalid> wrote:
>> why is it necessary to clock on rising and falling edge when reading a
>> quadrature encoder?
>
> Because if the encoder changes direction, you will clock on the
> wrong edge and slowly lose registration.

Ah - finally, the correct answer! It's not necessary, or event desirable,
to clock on one of the channels, but for an application where you care about
long-term accuracy, it's *essential* to clock on both the rising and falling
edges of the other channel. Magnum's explanation is exactly right!

That said, there are often times where I ignore this. Specifically, when
using a rotary encoder knob as a user interface input device (most car radio
volume controls are this way, now), an occasional "lost step" isn't really
too important, and the programming to capture the knob data is usually
greatly simplified. In fact, most processors can only be configured to
interrupt on a transition in one direction, some external logic is needed to
get both transition directions. Polling the input is another alternative,
usually not a very good one...
--
Mark Moulding