A magnetic rotary encoder measures the angle of a rotating shaft without needing physical contact between the shaft and the sensor. In robotics, this is useful for joint position feedback in arms, wheels, grippers, and actuators. A diametric magnet on the shaft creates a rotating magnetic field pattern, and a Hall sensor chip below it detects the field direction.
The result is an absolute angle reading that can be available immediately at power-up.
Key Facts
- A diametric magnet has its north and south poles on opposite sides of its diameter, not on its flat faces.
- Hall sensors measure magnetic field components, often Bx and By, near the sensor chip.
- The shaft angle can be found from the field components using theta = atan2(By, Bx).
- Absolute encoders report position directly, while incremental encoders report changes in position.
- Angular resolution for an N-bit encoder is resolution = 360 degrees / 2^N.
- Magnetic encoders are often robust against dust, oil, and light contamination because they do not rely on an optical path.
Vocabulary
- Magnetic rotary encoder
- A sensor system that measures the angular position of a rotating shaft using a magnet and magnetic field sensors.
- Diametric magnet
- A cylindrical magnet whose north and south poles are located on opposite sides of the curved surface.
- Hall effect
- The production of a voltage across a conductor or semiconductor when electric current flows through it in a magnetic field.
- Absolute angle
- The actual angular position of a shaft within one full rotation, usually reported from 0 degrees to 360 degrees.
- Resolution
- The smallest change in angle that an encoder can distinguish and report.
Common Mistakes to Avoid
- Placing the magnet too far from the sensor, which weakens the magnetic field and can make the angle reading noisy or unreliable.
- Using an axially magnetized magnet instead of a diametric magnet, which gives the wrong field pattern for many angle sensing chips.
- Confusing absolute position with speed, because an encoder reports angle directly while speed must be calculated from how angle changes over time.
- Ignoring mechanical alignment, because an off-center magnet can introduce angle error even when the electronics are working correctly.
Practice Questions
- 1 A 12-bit magnetic rotary encoder divides one full turn into 4096 counts. What angle in degrees corresponds to 1 count?
- 2 A robot joint uses an encoder with 14-bit resolution. How many distinct angle positions can it report, and what is the angular spacing in degrees?
- 3 A robotic arm works in a dusty workshop with oil mist near its joints. Explain why a magnetic rotary encoder may be a better choice than an optical encoder for this environment.