Magnetic Encoder Principles and Solutions

磁编码器原理与方案

Magnetic encoders have seen increasing applications in recent years. They feature various measurement principles and solutions. The following mainly discusses the existing technical solutions in the market.

Magnetic Encoder

The moving part of a magnetic encoder is made of magnetic material, which may be ferrite, neodymium iron boron (NdFeB), or samarium cobalt (SmCo).

磁铁

Before introducing the magnets used in magnetic encoders, it’s important to first understand magnetic pole patterning. In everyday life, the magnets we see typically have a simple N-pole and S-pole, created using basic magnetization methods. However, in more complex applications, magnets often feature more intricate magnetization patterns to achieve higher performance. Below are examples of various magnetization shapes. These are created by forming magnetic carriers from magnetic powder and then magnetizing them using custom-shaped magnetization fixtures.

Such as the various magnetization patterns shown below:

异形充磁

For encoders, which are devices used for precise position feedback, the magnetization patterns typically follow specific data formats. Examples used in encoders are shown below:

磁编码器磁环

Multi-pole magnetic encoder

The image below shows the magnetic field distribution of a 128-pole axially magnetized ring, along with its magnetization schematic:

磁编码器磁环实物图
磁编码器磁环原理图

Since it is planar magnetized, the main magnetic flux loops are oriented perpendicular to the ring plane. Therefore, we place a linear Hall sensor on the surface of the ring. When the sensor rotates around the center along the normal direction, the following waveform can be obtained:

霍尔输出

With 128 poles, there are 64 pairs of N and S poles, resulting in 64 sine wave cycles per full rotation. Therefore, such a magnetic encoder can only provide relative angle changes during one full turn and is mainly used in incremental encoders. It cannot deliver absolute position data within a single rotation.

During motion, as with traditional encoders, a 90˚ phase-shifted signal is required to determine the direction of rotation. This can be achieved by placing a second linear Hall sensor 90˚ apart in magnetic angle from the first one.

Absolute magnetic encoder

    To obtain absolute angle data, the encoder principle needs to be improved. The main methods are as follows:
  • Single-pole-pair magnet
  • Magnetic vernier subdivision
  • Magnetic grating subdivision

Single pole-pair magnetic encoder

A single pole-pair magnet has one pair of N and S poles. Unlike the 128-pole magnetic ring mentioned above, it generates only one magnetic cycle. When using two linear Hall sensors spaced 90° apart and aligned with the magnet’s magnetic angle at 90°, as shown in the figure below, the magnetic field strength varies as follows during rotation:

双霍尔测量原理测量
磁场旋转动态图

Below is the surface magnetic field detected by the two Hall sensors:

磁游标编码器

Each of the two Hall sensors captures a single-cycle magnetic field waveform. Since the waveforms are in quadrature, the unique angular position within 360° can be calculated using the arctangent function: arctan(y1, y2). During operation, the encoder reads the current values of y1 and y2, and computes the corresponding angular position of the magnet.

Magnetic vernier encoder

ingle pole-pair magnetic encoders have limited physical accuracy. To achieve higher precision, physical subdivision is required—such as using a 128-pole magnetic ring. However, a 128-pole ring alone cannot provide absolute position within one full rotation. In this case, the vernier approach enables both higher resolution and absolute angle measurement.


The vernier approach uses two magnetic tracks for measurement, each consisting of multiple N–S pole pairs. Within each pair, absolute positioning can be achieved using the same principle as a single pole-pair encoder. The key to determining the absolute angle over a full rotation lies in the number of pole pairs on the inner and outer tracks.

In the illustration, the outer ring consists of 32 pole pairs, while the inner ring has 31 pole pairs. At each radial position, the magnetic field difference between the inner and outer rings is unique. This difference serves as the key data for determining the absolute angular position.

The vernier scheme provides higher precision and resolution than single pole-pair encoders.

Magnetic grating encoder

This is a partial view of the magnetic grating ring.

磁刻线编码器

Magnetic grating uses a more precise approach than the vernier method. It magnetizes the ring into many fine magnetic lines of varying widths. Each line's magnetization direction (N or S) represents binary data (0 or 1), forming a cyclic absolute code. Within a defined segment width, a unique binary code can be read. Multiple dense Hall sensors are used to detect these lines and determine the coarse absolute position—similar to the 32 coarse divisions in the vernier method. Then, the fine physical angle is further calculated based on the total magnetic field vector within that segment.

Advantages of Magnetic Encoders

Magnetic encoders use non-contact measurement, enabling advantages that many other encoder types cannot match. These include high vibration resistance, tolerance to contamination, low assembly precision requirements, and support for high-speed rotation. They can even operate reliably in fully waterproof conditions or in acidic and alkaline environments.

Magnetic encoders are now widely used in fields such as transportation equipment, underwater applications, drones, and biomedical devices—where size and environmental resistance are critical. With diameters as small as 10 mm, they can achieve resolutions that other encoder types cannot match at this scale.

Choosing a Magnetic Encoder

    Find the magnetic encoder solution that best fits your application and needs:
  • If you need high-precision absolute positioning (above 16 bits), consider the magnetic vernier or magnetic coded track solutions.
  • For absolute positioning in harsh or complex environments, the single-pole-pair solution is recommended.
  • For high-precision incremental positioning, the multi-pole-pair solution is recommended.
  • For incremental positioning in standard environments, the single-pole-pair solution is a suitable choice.

Cost is also determined based on the required accuracy for each application scenario. As a specialist in custom magnetic encoders, KingKong Technology offers expert technical support tailored to your needs.