Close

anaQuad120

A project log for anaQuad!

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

eric-hertzEric Hertz 03/09/2016 at 09:240 Comments

Alright, so here's the spindle-motor from a 5.25in floppy drive...

This guy has 3 Hall-effect sensors to sense the timing necessary to power the motor's windings. There are multiple North/South-pole magnets around the motor, so while these are spaced about 22.5degrees apart around the motor, they sense the magnets at 120 degrees apart.

Low and behold, the crossover-detection method used in anaQuad can be made to work with two of these 120-degree phase-shifted signals (normal 'quadrature' signals are 90-degrees phase-shifted). Here's a plot of 120-degree phase-shift (two channels, and multiples thereof):

So, no problem detecting 12 positions per magnet.

Here's the 'scope output of one of the Hall-Effect sensors as I rotated the motor through one full revolution:

So, there appears to be 12 magnets on the motor.

Thus, with the crossovers shown in the graph, above, there should be no problem detecting 144 positions per revolution. Since this kind of motor has quite a bit of momentum, as well as having particular positions it wants to stay in (kinda like a stepper-motor), higher resolution than that probably doesn't make a whole lot of sense... But, it's probably possible with additional multiples of the input-signals (just as anaQuad2x has been bumped up to 4x and could definitely go to 6x). This motor seems to have 72 positions it wants to rest in ("detents") per revolution...

These particular Hall-Effect sensors have two "outputs." The voltage *between* these outputs is what we're looking for. So, either, use an ADC with differential inputs (and preferably one that has scaling, as well, since 0.25V is pretty small), or we'll need to add some op-amps. (Some, especially newer, Hall-Effect sensors include those op-amps internally, so their single output might swing from 0V to 5V. Some other ones actually contain thresholding circuitry, so couldn't be used with anaQuad, just as there are quadrature optical encoders that only output square-waves).

This particular motor/driver combo has clearly-marked inputs: "12" "5" "G" and "C"... when powered with 5V and 12V, leaving "C" disconnected, the motor spins on its own. Connecting "C" (Control?) to GND causes it to stop, which is perfect for using this system as an input "knob" or whatnot.

So, there you have it. This guy might be handy for some sort of jog-dial or scroll-wheel, where you might want to spin it and allow it to spin-down on its own. Could also be used as something like this:

And, it might be a bit hokey, but it could, I suppose, be attached to another motor's shaft and used as an encoder (at which point higher-scaling might be handy).

Discussions