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.

DRV5056: Accurately measuring distance using hall effect

Part Number: DRV5056

I am interested in using a non-contact measurement for gap detection between a tool base and lid.  The lid and base will be between 0 to 10mm apart where only closure needs to be detected accurately, ideally within 40um.  Sensor placement along the tool is flexible to best optimize the nominal closed position.  The tool temperature will increase from 25C to 125C so components should minimize drift and more importantly survive.  Hall effect sensors seem to be capable of meeting all these requirements but cases on this application seem limited.

So far I have set up a system moving a neodymium magnet in 60um increments and reading mV, then plotting and checking accuracy against the predictive formula.  Using this approach the accuracy I can achieve is about +/- 120um.  That's before machine environment factors, temperature drift, and weaker alnico/cobalt magnets.

Does anyone have experience using hall effect sensors to accurately measure distance?  Could anyone advise on strategies to improve measurement accuracy?

  • Steven,

    Thank you for your inquiry.  Hall sensors are used to detect lid closures commonly.Typically, a lid closure would be easily implemented using a Hall Switch.  In this way there's an on/off output.  However, in your case we must consider a very tight range of motion.  Sensitivity Min/Max values of many of our currently available switches are likely too wide to effectively detect this small degree of movement.  You will find that variations in the magnet, sensor, and mechanical alignment will all impact your ability to trigger within a 40 um window. Given this, a linear (or ratiometric) sensor such as DRV5056 would likely be your bet.

    You can use a quick 2D field calculator such as the one available at the link below. 

    There is a calculator and excel tool available on the DRV5056 landing page that allows for more magnet geometries

    https://www.ti.com/product/DRV5056#design-development

    This one allows you to select arbitrary placement in the XY plane relative to the magnet.

    https://www.kjmagnetics.com/fieldcalculator.asp

    For more complete and thorough simulations, you may find it best to use the open source tool  FEMM (Finite Element Method Magnetics)

    http://www.femm.info/wiki/HomePage

    You can find some tips for using FEMM here:

    https://www.ti.com/lit/an/snoaa04/snoaa04.pdf?ts=1592492079596&ref_url=https%253A%252F%252Fwww.google.com%252F

    For example, suppose we use a cylindrical N35 magnet with a thickness of 1/2 inch and a diameter of 1 inch.  We can try placing the sensor at various distances to and estimate the impact of 40 um movement.

    Sensor Spacing to Magnet (mm) Maximum Field (mT) Sensor 40 um Transit (mm) 40 um Field (mT) Approximate Field Change (mT)
    10 153.86 10.04 153.15 0.71
    12 120.29 12.04 119.56 0.73
    14 98.25 14.04 97.76 0.49
    16 79.28 16.04 78.97 0.31
    18 65.03 18.04 64.82 0.21

    Here we see that we expect to see the largest changes for a 40 um transit with the sensor placed closer to the magnet.  However, with this particular magnet we find that the field is too strong to have any less than a 10 mm gap for any DRV5056 sensitivity option.  Suppose we chose to use the A3 option with the sensor placed approximately 18 mm from the edge of the magnet when fully closed.  We would then only see a typical change in output voltage of about 10 mV with this motion.

    What is concerning is that the input referred noise for this device is about 0.12 mTpp. This is about half of the field change we are attempting to measure.  So at this point, our travel is going to be difficult to discern from the noise. It is probably necessary to add a filter on the output to limit the observable output noise.  Additionally, it will be very necessary to specifically select the magnet and tune the spacing to maximize the variation in output voltage you will produce.

    If you used a DAC capable of averaging several samples with better resolution than this, you might be able to discern this degree of travel, but you would also need to calibrate each system to account for variations in sensitivity and magnet strength.    

    You can also get a little more information on how to implement this specific solution in the TI Precision Labs video at the link below

    https://training.ti.com/ti-precision-labs-magnetic-sensors-designing-analog-proximity-sensor?context=1139747-1139746-1137749-1139635-1137746

  • Scott,

    Thank you for the detailed reply.  This has helped uncover several errors through checking our work in our process which will help improve accuracy and overall system reliability.  I had seen those calculators before but now their utility is much clearer.

    A few assumptions I neglected to include.  To compensate for the 125C max temperature I planning to use a SmCo cylindrical magnet (R 4.76mm D 5.08mm).  It looks like this outputs a reasonable 10,000G so not a huge loss of magnetic field.  The system will need to read at point of closure to 40um with loosening tolerance as it moves away, up to a maximum of 10mm with tolerance of say 200um.  As such the degree of scrutiny aligns with discernible field change.

    Looking at the calculator with these assumptions, by optimizing sensor spacing to magnet A1 senses around 0.2mT/40um and A4 senses around 2.4mT/40um.  Also considering temperature drift of SmCo is 1/3 that of Neodymium the Z4 may be preferable.  I'll be ordering more sensors and may have follow up questions next week.  Thanks again.

  • Steven,

    Sure.  Let me know if things work out or if you have more questions once you get the additional sensors.

  • Scott,

    The calculator tool has been very useful for optimizing sensor type and distance from the magnet as a function of field density.  I'm curious if you know of an equation which will output distance (Z) as a function of field density (B)?  From the Ti instructional video on designing proximity sensors it is recommended to take multiple linear regressions to form a curve.  Over a small range of measurements this is a reasonably accurate conversion but I am hoping such a formula works to reverse the magnetic field curve.

  • Steven,

    I'm glad the tools so far have been a help for you.  Please check out the materials in the presentation linked below

    https://training.ti.com/sites/default/files/docs/magnetic_field_calculator.pdf

    Slide 3 has the equation I think you are looking for.  Let me know if you have any further questions.

  • Scott,

    The equation on slide 3 references magnetic flux density B as a function of distance D.  I am looking to flip this to show distance as an output of magnetic flux density.  This will help convert measured voltage into predicted distance.  My algebra is a little rusty I could not solve for D(B).  Do you have this equation handy?

    Thanks,

  • Steven,

    I'm sorry, no I don't have the inverse of the equation handy.  I agree the algebra gets quite messy trying to flip it to solve for D.  What you might find an easier approach would be to create a lookup table of known distances and field strengths and to then approximate the distance from the measurement.  You may find that with sensitivity and offset differences from device to device that a calibration lookup table will be needed to distinguish critical points in your system.

    Thanks,

    Scott