Rings of magnets as an encoder disk
M. Peshkin 2006-09-15

Summary: works just fine with about 20 magnets. You get 40 counts/revolution (quadrature decoding at a full 4x).

The interval between counts is not uniform. This results from positioning inaccuracies: the position of the sensors and of the magnets. Can be improved, but this will be our limiting factor.


I put 20 magnets (1mm diameter, 1mm long) into a ring of radius 0.168 inches. Also one index magnet. Alternating N & S poles.

This is not the intended geometry, which will have magnets on the rim. This was easier to make. Easy to assemble.

The depths were a bit ratty, as seen below (click to see full size)

I bought a micro-soldering station and tools, which are very useful for these surface mount chips. Really fun.

I placed 7 hall sensors. There are 20 magnets, so I defined 80 quarter-intervals, and named them 0-79. On the spinning disk, the north-poles are at positions 0, 8, 16, 24, 32, 40, 48, 56, 64, 72 and the south-poles at 4, 12, 20, 28, 36, 44, 52, 60, 68, 76.

On the sensor side, I put A1101 unipolar hall sensors at positions 0, 11, 22, and 33. I put A3212 bipolar sensors at positions 44 and 66. I put a A1301 linear sensor at position 55 to see the flux profile.

You will have to think about this.

(Why quarter-intervals? I had hoped that I could use four sensors instead of the usual two, and get 80 counts per revolution rather than 40. This should work: A=xor(00,22), B=xor(11,33), clock=quadrature(A, B). But it didn't work, I think because the positions of the sensors has to be still more accurate. It's an idea to keep in mind tho.)

A motor spun the disk. The gap was about 250um, but the sensors worked OK out to 1mm or more.

Pretty pictures

The flux profile was smooth, as reported by the linear sensor at position 55. (The flattening on bottom is sensor clipping, not flux.) The amplitude was +/- 1000 gauss; huge. Since hall switch sensitivity is about 50 gauss, we pass through the switch points very fast, which is good for accurate timing.

This is important: the shape of the magnets doesn't show up. You don't see the flat bottom of the magnets. (The flattening on this scope trace is sensor clipping, not flux; we see 4 successive poles in this trace.)

The magnets blur to a sine-like thing, but fluctuating.

The switch timing will be affected not only by the switch & magnet positions, but also by the field strength variation due to magnet proximity and individual field strength variation. Note the period-10 repetition below, which is the same signal as above, but a slower sweep, showing all 20 magnets several times.

The bipolar switches are useless. They are electrically finicky (very different from the unipolar), and we want 50% duty cycle square waves which we can only get by alternating magnet poles. If the magnets were not alternating, they would blur to a nice uniform "north" with nothing to switch on.

Here are the four switch outputs from positions 0, 11,22, and 33 respectively

Using pairs 2 positions (thus, a half cycle) out of phase as A & B signals, the 4x quadrature decoded clock output is below. Note it's a little ragged. Again, this results from magnet variations (axial & circumferential position, and field strength) and sensor variations (position). There are 40 counts in one revolution.

-end-