Hall effect limit switches for a 3D printer

hall-effect-limit-switches

We’re used to thinking of limit switches as a mechanical device that cuts the motor connection before physical damage can occur. [Anthony] decided to try a different route with this project. He built this set of no-contact limit switches using a hall effect sensor. The small black package sticking out past the end of the protoboard is the sensor. It is used to detect a magnetic field.

[Anthony] chose to use an Allegro A3144 sensor. Apparently it is no longer in production but was easy to find for a song and dance on eBay. When thinking about the design he decided to add two LED indicators, one lights when the switch is open and the other when it has been tripped. This would have been easy to do with just one LED, but he needed to add more parts to get both working. In the lower left corner of the protoboard you can see the configurable gate device (74LVC1G58) he added to monitor the hall effect sensor and switch the output and LEDs accordingly.

37 thoughts on “Hall effect limit switches for a 3D printer

  1. Get an old honeywell keyboard, the type with hall effect key switches, and you can open up the keyswicthes and remove the Hall element, and it works as mentioned here. The Honeywell keyboards were the best and most reliable. Killed of by the cheap membrane ones of course, but surplus stores have them.

  2. The problem is the hysteresis. With a mechanical switch, you can create a very precise sensor that cuts in and out within fractions of a micrometer or better. With a hall sensor, everything around it affects the magnetic field and you need a large hysteresis for the switching, which means a large uncertainty in where the actuator really is when the limit is triggered.

      1. reliability – they still work after being soaked in oil
        unlike mechanical or optical ones

        as long as you are not covering your printer in oil you will be better off with super cheap mechanical, or super precise optical ones

    1. Last page of the write-up addresses hysteresis. The sensor has built in hysteresis. The configurable logic gate also has schmitt trigger input but not necessary because of the sensor’s hysteresis.

    2. Bang on, both in the original comment & the response. Hall effect or VR / proximity are not accurate enough for this sort of thing, you need mechanical or optical.

    3. Hysteresis does not make the trigger point “random” or wander about like your comment seems to imply. The trigger point for a given sensor is always at the same Gauss level, although the level itself might be stated as a range in the datasheet, so the absolute trigger point might differ between sensors. Hysteresis just prevents oscillation around the trigger point. In order to repeat a measurement, just move back a few millimeter until the sensor turns off and then re-approach it. Note that mechanical switches also provide hysteresis if you push the button beyond the trigger point (which in fact you will always do). Some more technical hall sensor info here: http://www.akm.com/Brochures/HallSensorsTechnicalGuide.pdf.

      1. Indeed, but the variability of the magnetic field does. If you place some ferromagnetic metal anywhere near the sensor, it will affect how it senses the magnetic field.

        Mechanical switches have next to no uncertainty in where they switch off as you take the pressure away from the switch. The magnetic sensor however has to assume that the field can fluctuate even when everything stays still, so you’re never quite sure where the switching will actually happen.

        1. Yes, you are correct. I wouldn’t use them for positional sensing in environments with ferromagnetic metals. Luckily, that’s not a problem in this use case (3D printer).

    4. The mechanical switches have a large Hysteresis too. That is why the firmwares all go forward until the switch hits then back up until it turns off and use that as the set point, so the switch is always approached from the same direction. This also does the right thing for hall effect sensors.

      Though, if you are fixing the limit switches on the basic reprap design, moving the z switch from the bottom of the movement to the top is by far the biggest and simplest win for precision.

    1. That’s a Chinese clone of this: http://reprap.org/wiki/Hall-%CE%98

      The design has more parts, but the functionality is exactly the same. They chose to use an Op-Amp to implement a Schmitt trigger, whereas Anthony’s design simply rely on the built-in hysteresis of the Allegro A3144 sensor. The Op-Amp design has the advantage of an adjustable sensitivity, I suppose, at the cost of a bigger board and more parts.

    2. Its actually using a similar circuit or even the same circuit. All the lines on the pc board make it look more complicated.

    3. That circuit is called “Hall-Θ” and uses an analog hall sensor, which is why it needs all the extra components. Also, it’s output is an open collector (10k to Vdd), I much prefer the buffered one in my circuit, especially in noisy environments with motors. You can find more info about the eBay circuit here: http://reprap.org/wiki/Hall-%CE%98.

    1. Hall effect sensors are cheaper than reed switches. Hall effect sensors are about fifteen cents each, reed switches are almost a dollar. Also much more reliable as there are no moving parts.

      1. you would obviously mount the sensor shrouded from strong light. Also those slots are pretty well shrouded from outside light anyway, it is very hard to get enough light in from the outside to get a reading.

      2. Also, I’m pretty sure most photointerrupters use IR light. And some I think use a pulsed source and in-phase pulsed detection to reject false positives.

      1. not really:

        a song and dance (American)
        a long and complicated statement or story, especially one that is not true (usually + about ) She gave me some song and dance about her kids always being sick and not being able to get to the meetings.

        song and dance
        n Informal
        1. Brit a fuss, esp one that is unnecessary
        2. US and Canadian a long or elaborate story or explanation, esp one that is evasive

        1. Yeah, the phrase he was looking for is “for a song” which does indeed mean cheap. He got his sayings confused.

          1. Yes, “singing for your supper”, meaning giving a little of yourself (or wealth) to gain in return something you need.

  3. When we built a robotic tape library (prototype) 23 years ago, we included both “hard” and “soft” limit switches to protect the axis motors from burning out. Optosensors were monitored by software to signal each end of travel, but just beyond those (about 1 cm) were mechanical limit switches that would cut the power to the motor if it went beyond the “soft” limit. This would require physically moving the motor carriage(?) back within the area of the soft limits, but it saved us from burning out expensive stepper motors.
    It was a “belt and suspenders” type of safety, We had experienced several times previously where the software failed to stop/reverse the motors.

  4. Reprap Morgan is using hall effect sensors at the moment, and I am not seeing any calibration or repeatability problems here. It could be because the sensors are located close to the centre of the machine, limiting external interference…

    I’ll have to see how it behaves long term.

    No song and dance here…

  5. Do not forget that limit switches were always intended to be a “HARD WIRED” safety factor that would work when all else fails. Hall effect switches may be appealing in some ways, but when an irrestible force meets an immovable object – the world ends? or we find out that expensive things can be broken

  6. Maybe it’s better to use ready-made inductive proximity sensors. They are easy to use, industrial solution, metal case, good price.

    Inductive Proximity Sensors detect metal objects without touching them. This technology is used in applications where the metal object to be detected is within few millimeters of the sensor face.

    Something like this one http://www.buyincoins.com/new_en/details/new-inductive-proximity-sensor-detection-switch-npn-dc-6-36v-lj12a3-4-z-bx-product-12325.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s