This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Positioning of magnet in 3D space (6 degrees of freedom)

Other Parts Discussed in Thread: TMAG5273, TMAG5170, TMAG3001

Good Day
I'm looking to make a 3d spacemouse with a couple hall sensors and a magnet in the center.
The magnet will be a diametrically magnetised cylinder magnet, with the rotational axis in the z-axis.

Goal is to be able to accurately measure all 6 axis with as few sensors as possible;
within a movement sphere of ~3mm(as in the magnet can travel +1,5 in x, and -1,5 in x, the same range applies to the y and z axis).
with a rotation range of 360° around the z-axis, and +- 20~30° around both x and/or y.

Question is if there are certain (preferably I²C) hall sensors that are designed for exactly this?
Because i wasnt able to find any.

The initial idea was to use a rotational hall sensor in the center(orange rectangle in the picture above), then add 3 3-axis hall sensors(translation in x, y and z; blue in picture) at a small distance with an offset of 120°.
This would give readings in all 6 degrees of freedom (with a bit of math), but would require 4 sensors; using quite a bit of space on a small pcb as well as multiple possible I²C addresses.

Im looking forward to feedback and am happy to answer further questions^^
With kind regards
Florian

  • Florian,

    Thank you for reaching out.  This type of measurement would likely be best done using a 3D Hall-effect sensor like TMAG5170, TMAG5273, or TMAG3001.  If I am understanding, the magnet can rotate about its center, but also orbit about some central point.  Then atop of that, there is a button press function where the range between the magnet and center may change.

    If possible to place the 3D sensor at the central orbit point, then the task might possibly be done with just a single device.  With a diametric cylinder magnet, the field will be parallel to the face of the magnet.  As the magnet rotates, the magnitude should be relatively constant at any given range to the sensor.  Therefore, a press event could be detected by tracking the total magnitude of the field vector:

    m = √ ( Bx2 + By2 + Bz2)

    If we were just interested in the rotation angle without the ability to tilt, we might be able to calculate this using a standard arctangent:

    Θ = atan2(By,Bx)

    However, as the magnet tilts we should now consider this in a spherical reference, and this will require all three field components from the sensor:

    α = atan2(√(By2+Bz2),Bx)

    β = atan2(√(Bx2+Bz2),By)

    This will produce two angle measurements that can be used to track the orientation of the joystick.

    We also have a tool available here which may be of some use to you as you look into evaluating how to take the measurements you need.

    https://webench.ti.com/timss/

    Here you can setup a joystick function using a diametric cylinder and then evaluate the field at various positions.

    Thanks,

    Scott

  • Hey Scott,

    Thanks for your response.

    I guess I misunderstood the use of the 3D Hall sensors, my understanding was they could only detect a magnet moving in x, y and z; not being able to get rotation at the same time.
    For some reason I misregarded the fact that a different magnet orientation would lead to a different magnetic field which affects all sensor readings, thus being able to detect rotation and translation at the same time.

    The tool definitely helped me, not 100% percent sure if there arent any magnet orientations that could be interpreted in two or more different ways, but Ill do a test pcb with the TMAG5273 for now and make a hands-on test. Would be able to do simultaneous movement of translation and rotation then and in realtime.
    The tool doesnt give me 100% intuition as one needs to change settings, simulate again and by that time I already forgot how the previous plot looked like, but certainly got me out of the hole of trying to find a sensor advertised as reading 6 axis at the same time.

    With kind regards
    Florian