If you have the opportunity to disassemble a magnetic rotary encoder , you will usually see an internal structure similar to the one shown in the picture above. Compared with a regular encoder (or resolver), a magnetic encoder has the same mechanical shaft and housing structure, but its position detection mechanism is very simple, consisting of only a small magnet mounted at the end of the mechanical shaft that rotates with the shaft and a PCB circuit board at the tail of the encoder.
So, how does a magnetic encoder measure rotational position feedback?
Let's first look at a classic physics (more precisely, electromagnetism) phenomenon.
As shown in the figure above, a voltage is applied to both ends of a flat rectangular conductor, causing it to generate current in one direction (such as the longitudinal direction).
If a magnetic field perpendicular to the plane of the conductor is applied to the current-carrying conductor (as shown in the figure above), the charge flowing on the conductor will be deflected due to the Lorentz force induced by the magnetic field.
According to the left-hand rule learned in high school physics, we can determine the direction of charge deflection when it flows, and the positive and negative charges deflect in opposite directions when flowing in a magnetic field. This means that when a current flows through this flat conductor in a magnetic field, its positive and negative charges will pass through it along two separate paths, one on the left and one on the right.
At this point, a potential difference will be generated on both sides of the conductor, that is, in the direction perpendicular to the current flow.
This is the Hall effect, discovered in 1879 by a physicist named Edwin Herbert Hall.