Close

4x (16*numSlots) GO! + Video

A project log for anaQuad!

Reliably increase your quadrature-encoder's resolution using an ADC (or a bunch of comparators?)

eric-hertzEric Hertz 03/06/2016 at 16:080 Comments

OK, I managed to achieve 4x... that's four times the resolution achievable with a *digital* quadrature signal, or 16 discernible positions per slot.

That's right... My encoder has 72 slots, I can detect 1152 discernible positions per revolution!

Here's the basic idea... Look for crossovers:

From the ADC values of channel A and channel B, I'm using A, B, -A, -B, 2A, and 2B...

Thankfully, these are pretty simple math-operations... which means they're *quick*.

I was excited about the 'no-mult' case, described in a previous log, but that is incapable of detecting a position unless (nearly) every *transition*/crossover is detected *immediately*... which is darn-near impossible upon powerup, at the least.

So, instead, 2x... that's a simple enough operation. No multiplication necessary (still) just A+A or B+B, or even A<<1, etc...

This guy, well, I tested it from every possible starting-angle (integer values 0-360), and it had no problem finding its initial position (within the "hysteresis" range). That means it 'auto-aligns' upon power-up, and also means that if one (or several) transitions are somehow "missed" (while processing something else?), it will eventually find the actual location. COOL. No interrupts necessary. Excellent.

SO...

Here's a video. (maybe still uploading...)

Discussions