Hardware Reference
In-Depth Information
Figure 16-2:
How the Hall
efect works.
Now an important word in the description “Hall efect absolute rotary shaft encoder” is the
word absolute. Many rotary encoders, such as the one used in the last chapter, are only rela-
tive encoders - that is, you get a signal only to say something has changed by one notch or
increment. With an absolute encoder you get multiple output bits to indicate the actual
angle. If you thought optical incremental encoders were expensive, then optical absolute
encoders are of the scale of expensive. Fortunately the Hall efect version is relatively cheap.
he one I have chosen to use is the AS5040, which will operate over the full 360 degrees and
return a 10 bit value. hat is, it returns a number between 0 and 1023 for one rotation. his
means that it produces a resolution of 0.35 of a degree. It does this by having four Hall efect
sensors inside the chip and working out the angle from the relative readings they give. It
requires a rather special sort of magnet that is cylindrical and diametrically magnetised.
Normally a cylindrical magnet will have a north pole at one end and a south pole at the other.
However, when it is diametrically magnetised, there is a north and south pole at each end.
hink of this as being two bar magnets glued together and shaped into a cylinder. Fortunately,
this type of magnet is easy enough to get.
You have to arrange the magnet on the end of the shaft to be just about 1 mm above the
chip. he general arrangement of the chip and magnet are shown in Figure 16-3. his chip is
capable of all sorts of outputs, but for this project you are simply going to use the access to
the internal registers using the SPI interface pins.
Search WWH ::




Custom Search