Electronic compass instead of potentiometers

The measurement of articulation angle commanded by one or several motors is always a mechanical issue. I just tested an electronic compass to detect north… It is very accurate. But when I did put a magnet close to the sensor, it could measure it’s orientation in 3d! Have you ever tested this kind of idea ? Is it already used ?
I imagine the complex shoulder articulation with a rotule joint with a magnet inside and a 3d compass sensor just next (or vice-versa)

We used the Razor 9dof IMU from sparkfun, which include a 3-axis magnetometer (tutorial). The problem is that running motors create noisy magnetic fields disturbing the magnetometers’ readings. Even the calibration procedure proposed in the tutorial does not solve the problem - the magnetic noise from the motors is fluctuating.

However we only tried this board to track the absolute orientation of the robot in space. Your idea of using a strong magnet close to the magnetometer is interresting to measure relative motion between parts. Can you provide more information? Maybe a photo of the setup or a video with things moving?

For the dynamixel servos, they used a hall effect sensor to detect the angular rotation, it is very precise but the magnet should remain close to the sensor. AS5040 is a popular hall effect rotary sensor (adapter board). We could also consider on/off hall effect sensors, to detect if some body parts are going out of range for example (small review, plenty of applications).