<p>There are some different criteria that we should use to select a switch type:</p>

<ul>
<li>Precision / repeatability: does the switch trigger at the same place every time? How much spread is there in the trigger position? Do environmental changes or machine setting changes affect the trigger position?</li>
<li>Contact distance: does the switch register with enough clearance to its hard-stop that the homing axis can stop before colliding with something?</li>
<li>Noise-rejection: does the switch ONLY trigger when it is supposed to? </li>
</ul>

<p>It's important to ask, how much switch precision do we actually need? A typical 3d printer drivetrain using a microstepping stepper motor can only accurately position the moving load within +/- one 1/16th microstep (even if using finer microstepping than that) due to error-inducing effects like friction torque and magnetic detent angle error. That's around +/-0.01mm for most printers. The homing switch only needs to be as precise as the motor's positioning! Nothing is gained by having, say, 0.001mm precision endstops. </p>

<p>This precision of +/-0.01mm is achievable for all types of endstop switches, with proper switch selection and configuration. </p>

<p>Then there are three "standard" switching types in use in consumer/hobbyist 3d printers:</p>

<ul>
<li>Mechanical switches, typically dual NO/NC limit switches, which either pull up or pull down a signal pin by connecting an electrical circuit when triggered</li>
<li>Optical switches, which use transistors to detect when an obstacle ("flag") is blocking the window between the emitter and sensor</li>
<li>Hall effect switches, which use transistors to detect when a magnetic field exceeds a particular field strength cutoff</li>
</ul>

<p><strong>Mechanical Switches</strong></p>

<p>Precision/repeatability depends on the switch quality, length of lever arm attached (longer increases contact distance but is worse for precision), and impact speed of the carriage with the switch. It's possible to have a good mechanical switch or a bad mechanical switch. This is typically a reasonable default choice because it is simple and cheap. </p>

<p>A small mechanical switch with a short lever arm (or the lever arm removed) will generally achieve the required +/-0.01mm switching precision. Very cheap switches, high contact speeds, and long lever arms may provide inadequate resolution for Z homing or probing, but will still be adequate for low-precision X and Y homing purposes. </p>

<p>Where mechanical switches tend to cause issues is in noise rejection. Different controller boards use different ways of wiring the switch: some use two wires and only send a signal when triggered. When not triggered, the signal wire is left floating or weakly pulled up by the microcontroller, while attached to a long wire that acts as an antenna to pick up EM noise. It is VERY common for heater or stepper wiring to emit nasty EMR due to the PWM current control. Two-wire endstop cables should always be run away from stepper and heater wiring. Shielding and twisting the conductors is a good idea too. </p>

<p>A more robust approach is to use three-wire switches that actively pull the signal line high or low depending on the switch position. These will tend to reject noise better. </p>

<p>Very cheap mechanical switches may fail within the life of the printer. However, most limit switches are rated for millions of cycles, which is unlikely to occur over any normal printer's lifespan. </p>

<p>Mechanical switches are easy to align and easy to trigger by hand during troubleshooting. </p>

<p><strong>Optical Switches</strong></p>

<p>These rely on a flag blocking a window between a light emitter and a detector. This is non-contact and can be quite reliable, but introduces some challenges. The exact trigger position (and thus precision) may depend on ambient light levels in the room, because the sensor is monitoring for light to decrease below a specific intensity. So it may be very repeatable/precise in the short term but have some drift if the sensor moves in and out of the sun through the day.</p>

<p>Switching tends to be more consistent and reliable if the flag enters the window from the side, rather than the top. </p>

<p>Optical switches will actively pull the signal line high or low, and thus have good electrical noise rejection.</p>

<p><strong>Hall Effect Switches</strong></p>

<p>These measure the intensity of the nearby magnetic field and trigger when it exceeds a certain amount in a certain polarity. This is highly precise/repeatable (better than +/-0.01mm) and extremely resistant to noise and environmental conditions. (Unless your printer is next to something that emits large magnetic fields, anyway.) </p>

<p>The hall switches I've seen have an adjustable trim pot to tune the trigger distance. That's a nice feature when trying to manually calibrate a Delta or a Z-bed for first layer height. </p>

<p>The primary downside to hall switches is that they need a magnet to trigger the switch. This can be difficult to trigger by hand during troubleshooting, and requires attaching a magnet somewhere on the moving carriage. Glue works fine... but don't glue the magnet in place backwards!</p>

CC BY-SA 4.0
2019-10-16T18:39:56.547Z
One should also consider how many cycles before failure. In this regard, optical and hall-effect sensors outperform mechanical sensors greatly (in similar price ranges).
Davo
CC BY-SA 4.0
2019-10-16T21:23:27.317Z
@RyanCarlyle Repeatability and precision are not more or less synonymous. Precision is how far are your measures from the target regarding to an scale. Repeatability is the spread of the measures according his own target. R&R studies can help to determine if tha part can meet your goal. However many electric parts can give  that required repeatability unless the mechanical part gets damages or dirty during usage, but most of them has a limit more than 100,000 clicks as life span and much more. I work as Quality Engineer (30 years)
Fernando Baltazar
CC BY-SA 4.0
2024-04-17T05:45:15.060Z
The video in YouTube https://youtu.be/QicY68BOml0 is taking your answer without giving you credit. You can submit request for removal.
FarO
CC BY-SA 3.0
2016-05-06T11:35:49.690Z
I don't see the "Precision / repeatability" answered for the different switch types. You name the effects that have influence though. I think the question is if a good mechanic switch is more precise as an Hall Effect switch. Or if ambient light makes an optic switch less precise than  bad mechanical switch. And what are the variations anyway. Are we talking millimeters in difference or µm? Some ball park values of the achievable precision would be needed to compare the three end stop types.
Lars Pötter
CC BY-SA 3.0
2016-05-09T15:14:36.890Z
It simply depends too much on the specific switch used to give a concrete answer. In particular, two different mechanical switches can have very different precision. A cheap limit switch with a very long lever arm might be +/-0.5mm with a speed-dependent trigger position, but that's unusually bad. My experience is that all the "typical" endstop switches (hall, optical, short-throw mechanical) are equal or greater precision than the positioning resolution of a typical stepper motor drivetrain (+/- a 1/16 microstep or thereabouts) and thus the exact trigger position repeatability is irrelevant.
Ryan Carlyle
CC BY-SA 3.0
2016-05-09T15:15:17.973Z
Let me add some detail to the answer to clarify this a bit.
Ryan Carlyle
CC BY-SA 3.0
2016-05-09T19:57:27.910Z
Nice answer, however, do you have any source for the precision of (common) switches being this high? The statement "use transistors to detect" is a bit superfluous since just about everything uses transistors and transistors aren't really key to their operation. RE large magnetic fields; have you considered that the stepper motors themselves emit quite a bit of magnetism. I found that once triggered, my hall endstops stayed triggered due to the magnetic field of the motors, and that to get them to "untrigger", I had to add a magnet of the opposing polarity close to them.
Tom van der Zanden
CC BY-SA 3.0
2016-11-25T03:16:52.357Z
Repeatability is far more important than precision.  The word "precision" indicates, roughly, how small a distance difference can be determined, and you'd think there's no point in exceeding the stepper motor limit -- **except** that the bed itself can be adjusted far more precisely w/ the four corner bolts. So if you can get super-tight repeatability, you can "home" the bed itself to that position.
Carl Witthoft
CC BY-SA 3.0
2016-11-26T04:41:16.633Z
Carl, within the realm of science, engineering, and switch specification, precision and repeatability are more or less synonymous. The precision refers to the spread in the measurement values from measurement to measurement. What you're thinking of is resolution.
Ryan Carlyle
CC BY-SA 3.0
2017-08-16T19:11:50.803Z
You've missed the *induction* sensors. No, those are not Hall Effect ones.
Kuba hasn't forgotten Monica
CC BY-SA 3.0
2016-05-05T20:52:02.177Z
2016-05-09T15:26:32.263Z
2016-05-09T15:26:32.263Z
Ryan Carlyle
<p><a href="https://twitter.com/toms3dp?lang=en" rel="noreferrer">Thomas Sanladerer</a> performed exactly the <a href="https://www.youtube.com/watch?v=il9bNWn66BY" rel="noreferrer">comparison you ask</a>. Check the whole video.</p>

<p>The result is that inductive sensors are the most accurate, but they are highly dependent on the bed material chosen.</p>

<p>Mechanical switches (bare, no metallic arm) are about as accurate and keep the same accuracy with every bed material (however you need a mechanism to retract them, which may or may not decrease the accuracy).</p>

<p>Other sensors are less accurate.</p>

<p>In any case, most of them are already far better than required, since anything below 50 microns is fine and basically all of them reach that accuracy.</p>

<p>Choose based on other factors such as weight, installation, price. Inductive, after a calibration based on your specific bed, may be the easiest since they need no retraction, but they are bulky. BLtouch is probably the second choice, mechanical microswitches the third one.</p>

CC BY-SA 4.0
2019-10-16T15:56:27.523Z
Good find of an old question and a good summary of Tom's tests. He did not test an optical breaker circuit though - where a light always hits a photodetector and the moving part pushes a wall inbetween. This setup is very precise.
Trish
CC BY-SA 4.0
2019-10-16T16:22:45.067Z
I'm not sure it can beat the other ones: as written in another answer, that kind of endstop is based on the light reaching the sensor dropping below a certain threshold. Since it's a measurement based on (infrared) light, the ambient light will impact it. It can be accurate in a specific environment but not immune to various changes to the environment.
FarO
CC BY-SA 4.0
2019-10-16T19:08:15.750Z
I am talking about light barrier type optical sensors. An LED sends full bright power into a sensor and a "wing" moves in. Such endstops were not tested by Tom but are used extensively in heavy machinery as they are rather foolproof and a broken light source or any item falling into the sensor trips an emergency halt.
Trish
CC BY-SA 4.0
2021-06-03T16:20:39.343Z
@Trish to explain better: in those sensors the light is converted to voltage, then when the voltage crosses a threshold, the output is triggered. However the threshold will depend slightly on the environment temperature, and since a small change in the threshold translates in a much larger change of trigger height, they may not be better/much better than the other systems. Oh, and you still need retracting them when not in use, which add an additional mechanical component which will decrease accuracy. For example, a 4 cm ABS holder will expand by 80 microns over a 30°C temperature difference.
FarO
CC BY-SA 4.0
2021-12-07T17:25:47.130Z
Thomas' video was about bed levelling rather than the OP's question about end stops. however it did show the accuracy of microswitch without lever vs relevant alternatives.
Nick
CC BY-SA 4.0
2024-05-31T02:28:44.973Z
Infrared breakbeam sensors nearly always use modulated infrared light. The light is modulated at a specific frequency or even multiple specific frequencies, and the detector has a bandpass filter applied so that it only responds to those frequencies. This makes them quite immune to ambient light, even ambient infrared light. In rare cases they can experience interference from noisy electrical components if not properly isolated.
BetterSense
CC BY-SA 4.0
2019-10-16T12:45:23.013Z
2019-10-16T12:45:23.013Z
FarO
<p>I don't think there is a simple answer.</p>

<p>In my opinion, for a home sensor accuracy doesn't matter.  Firmware usually allows setting an offset between the indicated position and the actual position.  What really matters is repeatability.  Every time the sensor indicates position, the position is the same.</p>

<p><strong>Mechanical Switches</strong></p>

<p>I have found through testing several mechanical switches that the "make" event is less repeatable than the "break" event.  For best results, I move toward the position that closes the switch, then move in the opposite direction until the switch opens.  If I remember correctly, I got "make" repeatability of about 0.02" (0.5&nbsp;mm), and "break" repeatability of about 0.005" (0.13&nbsp;mm).  </p>

<p><strong>Optical Switches</strong></p>

<p>For a delta 3D printer, I use optical sensors.  Optical sensors have a built-in illumination and sensor, usually on opposite sides of a forked structure.  The sensor side has a slot which masks the light being received, helping to shroud it from ambient light.  The slot is along an axis which is either aligned with the fork or normal to it.  The flag you use for the interrupter should completely cover the slot, and for good repeatability edge of the flag must be parallel with the slot.  In other words, some sensors expect the flag to enter from the side while other expect the flag to enter from the top.  Either will work, but you need to choose the right sensor for the configuration of your machine.</p>

<p><strong>Ambient Light with Optical Switches</strong></p>

<p>Perhaps ambient light could be a problem.  If so, it could be addressed by shading the sensor.  </p>

<p>Let's assume that the LEDs in the sensor are the same efficiency as the ambient LED lights.  For reference, here is a spec sheet for a typical optical interrupter used in optical sensors:  <a href="http://www.isocom.com/images/stories/isocom/isocom_new_pdfs/H21A.pdf" rel="nofollow noreferrer">http://www.isocom.com/images/stories/isocom/isocom_new_pdfs/H21A.pdf</a>  The package of the optical sensor is designed to reduce susceptibility to ambient light.</p>

<p>Light intensity falls off as distance^2, and the illuminators in the sensor are very close.  How much effect does room light have on the sensor?  </p>

<p>In my shop, I use 8-foot LED replacement bulbs for the fluorescent bulbs.  With this, I have 72 watts of LED lighting, which, let's say, illuminate evenly the semi-sphere below the ceiling.  A full sphere is 12.56 sr (steradians, or stereo-radians), so the half sphere is 6.28 steradians, for a power of 11.46&nbsp;W/sr.  At the sensor, this must be divided by the square of the distance, let's say 8 feet.   This gives us (11.46&nbsp;W/sr)/(96in^2) = 0.119&nbsp;W/area.</p>

<p>The illuminating LED has a power (typically) of 1.2&nbsp;V * 0.05&nbsp;A, or 0.06&nbsp;W.  The light cone from a typical LED is about 30 degrees, which is 1 sr, for a power of 0.06&nbsp;W/sr.  Scaled for an estimate of the distance between the emitter and sensor of 4&nbsp;mm or 0.157", is (0.06&nbsp;W/sr)/(0.157in^2) = 2.43&nbsp;W/area.</p>

<p>It seems unlikely that general ambient light will be a problem.  If it were, the sensor mounting could be designed to shield the sensor from direct exposure to ambient light.</p>

<p>It is important with optical sensors to be sure the interrupting flag is actually opaque to the illuminator light.  As I found, red PLA is not especially opaque to infrared light, so I needed to paint the flags with a black pigmented paint.</p>

<p><strong>Hall Effect Switches</strong></p>

<p>I have no experience with Hall effect magnetic limit switches.  Other answers here have praised them because they have an adjustment which can be used to set the precise detection point.  I don' t like adjustments because they drift.  Pots are subject to wear, oxidation, and both slow and fast variation in their resistance.  I would prefer to have something unadjustable and repeatable in hardware and use software to hold the calibration.</p>

<p><strong>Example of Hybrid Choice</strong></p>

<p>On a 6-axis delta architecture CNC machine I build, I use a hybrid approach to sensing home position.  Mechanical switches indicate a position that is close to home, and the index pulse of a rotary encoder defines the precise home position.  The homing firmware moves toward home until the mechanical switch closes, then away until it opens, then back toward home until it detects the index pulse.   As there are six axes, there are six sets of these switches and encoders.  Using a mechanical switch for the rough homing made sense for this machine because the index sensor is hit once per revolution, so it is not a unique indicator of home, and this machine creates a lot of dust and chips, which could block an optical sensor.</p>

<p>So, without an absolute answer, my preference is for optical switches for repeatability.</p>

CC BY-SA 4.0
2018-10-23T12:48:32.197Z
The precision values you got for mechanical switches appear to be extremely high. Granted, they are not perfect, but if mechanical switches only had a repeatability of around 0.5 or 0.13mm, then nearly *every* print on those well-known cheap Chinese 3D printer kits would fail, which is clearly not the case.
Fritz
CC BY-SA 4.0
2019-10-16T15:58:43.840Z
The link has unfortunately died... do you happen to know the title of the document, so that we could search/google for it?
Greenonline
CC BY-SA 4.0
2019-10-17T11:59:43.443Z
This link may serve: http://pdf.datasheetcatalog.com/datasheets/105/55275_DS.pdf
cmm
CC BY-SA 4.0
2024-04-17T05:45:28.417Z
The video in YouTube https://youtu.be/QicY68BOml0 is taking your answer without giving you credit. You can submit request for removal.
FarO
CC BY-SA 4.0
2017-08-14T15:01:45.183Z
2019-10-16T15:57:47.050Z
2019-10-16T15:57:47.050Z
cmm
<p>I think there are several factors involved in which sensors are best, but the general ordering for me would be Hall, Optical followed by mechanical. All of the types will be subject to some drift due to vibrations and changes in the printer over usage. Therefore it's the ease of adjustment as well as the accuracy of the stop which counts in the assessment. </p>

<p>In my experience the hall effect sensors are the most accurate and easiest. They don't rely on physical switching (as with the mechanical) meaning there is no "wear and tear" on the component and the point of switching will remain fixed. They have a potentiometer which can be adjusted to make the position of the stop change without any mechanical intervention allowing very fine tuning. They can be very accurate. </p>

<p>Optical are similarly accurate but usually have a fixed component that cuts the beam to switch on/off the sensor. The adjustment of the stop will usually be mechanical because the mount points will need to be adjusted - this reduces their accuracy. There are various adjustable mounts to alleviate this on thingyverse or the like.</p>

<p>Mechanical switches are similar to optical in terms of adjustment with the added inaccuracy of the actual switch mechanism which may degrade over time. </p>

CC BY-SA 4.0
2024-04-17T05:45:49.917Z
The video in YouTube https://youtu.be/QicY68BOml0 is taking your answer without giving you credit. You can submit request for removal.
FarO
CC BY-SA 4.0
2024-04-23T19:34:13.693Z
@FarO thanks for pointing it out, he did cite me in his description, and I'm not too worried about it being used.
Caribou
CC BY-SA 3.0
2016-05-05T14:26:02.003Z
2016-05-05T14:26:02.003Z
Caribou
<p>If you take a look at the <a href="http://reprap.org/wiki/Endstop" rel="nofollow">RepRap Wiki</a>, they briefly explain these three switches:</p>

<ul>
<li>Mechanical

<blockquote>
  <p><em>"<strong>Mechanical Endstops</strong> are the most basic form of endstops, made of an ordinary switch, two wires. Changing the switch state signals the electronics.</em></p>
</blockquote></li>
<li>Optical

<blockquote>
  <p><em>"These Optical Endstops observe the light level and reacts to sudden changes."</em></p>
</blockquote></li>
<li>Magnetic

<blockquote>
  <p><em>"These endstops; Hall effect sensors is a transducer that varies its output voltage in response to a magnetic field. Hall effect sensors are used for proximity switching, positioning, speed detection, and current sensing applications."</em></p>
</blockquote></li>
</ul>

<p>In regards to your question, it's dependent upon your circumstance. However, most of the time a good 'ol Mechanical Switch is repeatable and serves its purpose well.</p>

<p>I, personally, would place both optical and magnetic switches in the category of a multifunction component. Meaning, both of these types of switches <sup>(generally)</sup> provide a valuable range for object detection. This can potentially lead (depending on your machine) to a pushed command that tells your machine to slow down when it comes close to the soft stop.</p>

<p>Again, personally, I would be wary of using an optical endstop with potential white light noise from ambient room lighting or other sources. I could be wrong in my concern for some modules that address these kind of issues.</p>

<p>So, if we narrow down between mechanical and magnetic:
 - Magnetic would provide a gentler approach, reducing (potentially) the amount of wear
 - However, I'm assuming, magnetic switches require "dialing in" depending on the components used in the sensor. This could lead to an undesired range that the sensor is triggered.
 - Mechanical switches are simple. They're either touching or not touching (on or off)
 - A possible pro (or con) is the ability to manipulate the trigger manually, more easily. I've run into a situation a few times where I needed to manually trigger the endstop as part of a troubleshooting step. But, if you accidentally bump your endstop while the machine is running, no good.</p>

CC BY-SA 3.0
2016-05-05T14:37:55.497Z
Do you know if this "pushed command that tells your machine to slow down" is used on any machine?
Lars Pötter
CC BY-SA 3.0
2016-05-05T15:00:29.560Z
I don't know of a real world use for 3D printing, that's why I said it's a potential option. I have seen similar setups in traditional CNC machining with a third party sensor. The sensor does its thing and essentially pushes a G-Code command to the machine's controller. Typically the command is a subroutine that performs multiple functions like moving the machine to a safe distance, stopping, and notifying the operator. Look up Caron Engineering for an example with their TMAC setup.
tbm0115
CC BY-SA 3.0
2016-05-05T17:45:45.460Z
This doesn't answer the question, which asks "which endstops are the most precise?". There's nothing in here that addresses that - this answer mainly seems to be theorizing about a "gentler approach" which isn't even supported by any firmware.
Tom van der Zanden
CC BY-SA 3.0
2016-05-05T17:49:56.343Z
@TomvanderZanden I'm purposely staying away from answering that part of the question as it is primarily opinion based.
tbm0115
CC BY-SA 3.0
2016-05-05T17:54:34.200Z
You could answer that part pretty objectively if you looked in some datasheets for the repeatability characteristics of various endstops.
Tom van der Zanden
CC BY-SA 3.0
2016-05-05T14:26:10.567Z
2016-05-05T14:26:10.567Z
tbm0115
<p>A separate issue not addressed in other answers is that the end stops for X/Y axes have different requirements than those for the Z axis.</p>
<h3>X/Y Axes</h3>
<p>When the printer offers XYZ calibration (like Prusa i3 MK2), the properties of the X and Y switches play a role, since for the Z probing the probe should be centered above the fiducials (copper circles) in the bed. The XY part of the calibration measures the position of the fiducials relative to the end-stop trigger point. Then the Z calibration measures the height of each fiducial.</p>
<p>When the XYZ calibration is not offered, there's usually no need for very repeatable positioning relative to the X and Y travel ends, and on most printers you could simply move the motors until they start skipping steps and call that a day - it will be accurate to within a few steps.</p>
<h3>Z Axis</h3>
<p>The Z axis always has a high requirement on accuracy and repeatability, and there are two general approaches to determining its position:</p>
<ol>
<li><p>No end-stops on the Z-axis drive system, a probe is mounted on the print head and is used to detect when the head is a certain distance above the print bed. This can be used for 9-point calibration of the bed shape and thus removes the need for bed levelling.</p>
</li>
<li><p>End-stops used on the Z-axis drive system. No sensor on the print head. The bed needs to be separately leveled in reference to the nozzle - thus the bed leveling screws.</p>
</li>
</ol>
<h3>Delta Z</h3>
<p>For Delta, you essentially have three Z axis drivers, and similar to the Cartesian XYZ drive, you don't need any end-stops if you have a probe on the print head. You can also perform multi-point bed leveling with such a probe.</p>
<h3>Other Approaches</h3>
<p>X and Y endstops become unnecessary once you use closed-loop stepper control, such as <a href="http://tropical-labs.com/index.php/mechaduino" rel="nofollow noreferrer">Mechaduino</a> or linear digital position sensors (e.g. as used in CNC machines).</p>
<p>The Z probe is still useful if you don't want to perform bed leveling manually.</p>

CC BY-SA 3.0
2017-08-16T20:42:27.487Z
While these are interesting points about endstops, it doesn't address the actual question at all.
Tom van der Zanden
CC BY-SA 3.0
2017-08-17T11:18:43.290Z
Do you have any references to a delta running without endstops?  I'm fairly certain endstops are required to establish axis position otherwise the motion gets screwed up.
tjb1
CC BY-SA 3.0
2017-08-17T14:52:33.827Z
Kinematically they are not required. Similar to a double-Z-axis Prusa mount, you start with a "fairly" middle-of-the-bed position, then all three Z axes move down until the probe detects the first fiducial. It's a large circle (e.g. 1 inch dia) and establishes the Z and radial origin (think of the bed in polar coordinates). Second fiducial is a narrow sector and establishes the angular origin. Now you can find further small fiducials to perform full Z calibration (or full XYZ calibration after assembly). For XYZ cal you need a Prusa-like custom bed. For Z only a circular metal plate will do.
Kuba hasn't forgotten Monica
CC BY-SA 3.0
2018-04-03T15:11:34.077Z
@KubaOber Could you please explain how you would decide where "fairly middle-of-the-bed" is on a delta without any sensors? The initial position could be literally anywhere...
piit79
CC BY-SA 3.0
2018-04-04T13:57:15.297Z
You can't. You do it manually, or you use a mostly metal bed where the fiducials are negative, i.e. gaps. The inductive sensors are good at detecting those. This would also help detect the edge of the bed so you don't need any additional sensors at all other than the inductive one. I run a delta like that.
Kuba hasn't forgotten Monica
CC BY-SA 3.0
2017-08-16T19:33:27.740Z
2017-08-16T19:33:27.740Z
2020-06-18T08:29:41.667Z
Kuba hasn't forgotten Monica
<p>I have seen mechanical (micro switch), optical  and magnetic(magnet + hall sensor) end stops.</p>

<p>Are there any differences in how exact they switch at the right location? If so which are the most precise?</p>

<quality><endstop>
Which endstops are most precise?
Lars Pötter
# Which endstops are most precise?

(Asked by: username_0 on 2016-05-05)

I have seen mechanical (micro switch), optical and magnetic(magnet + hall sensor) end stops.

Are there any differences in how exact they switch at the right location? If so which are the most precise?

**Tags:** quality, endstop

---

## 6 answers

### Answer by username_1 on 2016-05-05. Score: 13

There are some different criteria that we should use to select a switch type:

* Precision / repeatability: does the switch trigger at the same place every time? How much spread is there in the trigger position? Do environmental changes or machine setting changes affect the trigger position?
* Contact distance: does the switch register with enough clearance to its hard-stop that the homing axis can stop before colliding with something?
* Noise-rejection: does the switch ONLY trigger when it is supposed to?

It's important to ask, how much switch precision do we actually need? A typical 3d printer drivetrain using a microstepping stepper motor can only accurately position the moving load within +/- one 1/16th microstep (even if using finer microstepping than that) due to error-inducing effects like friction torque and magnetic detent angle error. That's around +/-0.01mm for most printers. The homing switch only needs to be as precise as the motor's positioning! Nothing is gained by having, say, 0.001mm precision endstops.

This precision of +/-0.01mm is achievable for all types of endstop switches, with proper switch selection and configuration.

Then there are three "standard" switching types in use in consumer/hobbyist 3d printers:

* Mechanical switches, typically dual NO/NC limit switches, which either pull up or pull down a signal pin by connecting an electrical circuit when triggered
* Optical switches, which use transistors to detect when an obstacle ("flag") is blocking the window between the emitter and sensor
* Hall effect switches, which use transistors to detect when a magnetic field exceeds a particular field strength cutoff

**Mechanical Switches**

Precision/repeatability depends on the switch quality, length of lever arm attached (longer increases contact distance but is worse for precision), and impact speed of the carriage with the switch. It's possible to have a good mechanical switch or a bad mechanical switch. This is typically a reasonable default choice because it is simple and cheap.

A small mechanical switch with a short lever arm (or the lever arm removed) will generally achieve the required +/-0.01mm switching precision. Very cheap switches, high contact speeds, and long lever arms may provide inadequate resolution for Z homing or probing, but will still be adequate for low-precision X and Y homing purposes.

Where mechanical switches tend to cause issues is in noise rejection. Different controller boards use different ways of wiring the switch: some use two wires and only send a signal when triggered. When not triggered, the signal wire is left floating or weakly pulled up by the microcontroller, while attached to a long wire that acts as an antenna to pick up EM noise. It is VERY common for heater or stepper wiring to emit nasty EMR due to the PWM current control. Two-wire endstop cables should always be run away from stepper and heater wiring. Shielding and twisting the conductors is a good idea too.

A more robust approach is to use three-wire switches that actively pull the signal line high or low depending on the switch position. These will tend to reject noise better.

Very cheap mechanical switches may fail within the life of the printer. However, most limit switches are rated for millions of cycles, which is unlikely to occur over any normal printer's lifespan.

Mechanical switches are easy to align and easy to trigger by hand during troubleshooting.

**Optical Switches**

These rely on a flag blocking a window between a light emitter and a detector. This is non-contact and can be quite reliable, but introduces some challenges. The exact trigger position (and thus precision) may depend on ambient light levels in the room, because the sensor is monitoring for light to decrease below a specific intensity. So it may be very repeatable/precise in the short term but have some drift if the sensor moves in and out of the sun through the day.

Switching tends to be more consistent and reliable if the flag enters the window from the side, rather than the top.

Optical switches will actively pull the signal line high or low, and thus have good electrical noise rejection.

**Hall Effect Switches**

These measure the intensity of the nearby magnetic field and trigger when it exceeds a certain amount in a certain polarity. This is highly precise/repeatable (better than +/-0.01mm) and extremely resistant to noise and environmental conditions. (Unless your printer is next to something that emits large magnetic fields, anyway.)

The hall switches I've seen have an adjustable trim pot to tune the trigger distance. That's a nice feature when trying to manually calibrate a Delta or a Z-bed for first layer height.

The primary downside to hall switches is that they need a magnet to trigger the switch. This can be difficult to trigger by hand during troubleshooting, and requires attaching a magnet somewhere on the moving carriage. Glue works fine... but don't glue the magnet in place backwards!

> **Comments:**
> **username_0**: I don't see the "Precision / repeatability" answered for the different switch types. You name the effects that have influence though. I think the question is if a good mechanic switch is more precise as an Hall Effect switch. Or if ambient light makes an optic switch less precise than  bad mechanical switch. And what are the variations anyway. Are we talking millimeters in difference or µm? Some ball park values of the achievable precision would be needed to compare the three end stop types.  
> **username_1**: It simply depends too much on the specific switch used to give a concrete answer. In particular, two different mechanical switches can have very different precision. A cheap limit switch with a very long lever arm might be +/-0.5mm with a speed-dependent trigger position, but that's unusually bad. My experience is that all the "typical" endstop switches (hall, optical, short-throw mechanical) are equal or greater precision than the positioning resolution of a typical stepper motor drivetrain (+/- a 1/16 microstep or thereabouts) and thus the exact trigger position repeatability is irrelevant.  
> **username_1**: Let me add some detail to the answer to clarify this a bit.  
> **username_5**: Nice answer, however, do you have any source for the precision of (common) switches being this high? The statement "use transistors to detect" is a bit superfluous since just about everything uses transistors and transistors aren't really key to their operation. RE large magnetic fields; have you considered that the stepper motors themselves emit quite a bit of magnetism. I found that once triggered, my hall endstops stayed triggered due to the magnetic field of the motors, and that to get them to "untrigger", I had to add a magnet of the opposing polarity close to them.  
> **username_6**: Repeatability is far more important than precision.  The word "precision" indicates, roughly, how small a distance difference can be determined, and you'd think there's no point in exceeding the stepper motor limit -- **except** that the bed itself can be adjusted far more precisely w/ the four corner bolts. So if you can get super-tight repeatability, you can "home" the bed itself to that position.  
> **username_1**: Carl, within the realm of science, engineering, and switch specification, precision and repeatability are more or less synonymous. The precision refers to the spread in the measurement values from measurement to measurement. What you're thinking of is resolution.  
> **username_7**: You've missed the *induction* sensors. No, those are not Hall Effect ones.  
> **username_2**: One should also consider how many cycles before failure. In this regard, optical and hall-effect sensors outperform mechanical sensors greatly (in similar price ranges).  
> **username_3**: @RyanCarlyle Repeatability and precision are not more or less synonymous. Precision is how far are your measures from the target regarding to an scale. Repeatability is the spread of the measures according his own target. R&R studies can help to determine if tha part can meet your goal. However many electric parts can give  that required repeatability unless the mechanical part gets damages or dirty during usage, but most of them has a limit more than 100,000 clicks as life span and much more. I work as Quality Engineer (30 years)  
> **username_4**: The video in YouTube https://youtu.be/QicY68BOml0 is taking your answer without giving you credit. You can submit request for removal.  

---

### Answer by username_4 on 2019-10-16. Score: 5

[Thomas Sanladerer](https://twitter.com/toms3dp?lang=en) performed exactly the [comparison you ask](https://www.youtube.com/watch?v=il9bNWn66BY). Check the whole video.

The result is that inductive sensors are the most accurate, but they are highly dependent on the bed material chosen.

Mechanical switches (bare, no metallic arm) are about as accurate and keep the same accuracy with every bed material (however you need a mechanism to retract them, which may or may not decrease the accuracy).

Other sensors are less accurate.

In any case, most of them are already far better than required, since anything below 50 microns is fine and basically all of them reach that accuracy.

Choose based on other factors such as weight, installation, price. Inductive, after a calibration based on your specific bed, may be the easiest since they need no retraction, but they are bulky. BLtouch is probably the second choice, mechanical microswitches the third one.

> **Comments:**
> **username_8**: Good find of an old question and a good summary of Tom's tests. He did not test an optical breaker circuit though - where a light always hits a photodetector and the moving part pushes a wall inbetween. This setup is very precise.  
> **username_4**: I'm not sure it can beat the other ones: as written in another answer, that kind of endstop is based on the light reaching the sensor dropping below a certain threshold. Since it's a measurement based on (infrared) light, the ambient light will impact it. It can be accurate in a specific environment but not immune to various changes to the environment.  
> **username_8**: I am talking about light barrier type optical sensors. An LED sends full bright power into a sensor and a "wing" moves in. Such endstops were not tested by Tom but are used extensively in heavy machinery as they are rather foolproof and a broken light source or any item falling into the sensor trips an emergency halt.  
> **username_4**: @Trish to explain better: in those sensors the light is converted to voltage, then when the voltage crosses a threshold, the output is triggered. However the threshold will depend slightly on the environment temperature, and since a small change in the threshold translates in a much larger change of trigger height, they may not be better/much better than the other systems. Oh, and you still need retracting them when not in use, which add an additional mechanical component which will decrease accuracy. For example, a 4 cm ABS holder will expand by 80 microns over a 30°C temperature difference.  
> **username_9**: Thomas' video was about bed levelling rather than the OP's question about end stops. however it did show the accuracy of microswitch without lever vs relevant alternatives.  
> **username_10**: Infrared breakbeam sensors nearly always use modulated infrared light. The light is modulated at a specific frequency or even multiple specific frequencies, and the detector has a bandpass filter applied so that it only responds to those frequencies. This makes them quite immune to ambient light, even ambient infrared light. In rare cases they can experience interference from noisy electrical components if not properly isolated.  

---

### Answer by username_11 on 2017-08-14. Score: 4

I don't think there is a simple answer.

In my opinion, for a home sensor accuracy doesn't matter. Firmware usually allows setting an offset between the indicated position and the actual position. What really matters is repeatability. Every time the sensor indicates position, the position is the same.

**Mechanical Switches**

I have found through testing several mechanical switches that the "make" event is less repeatable than the "break" event. For best results, I move toward the position that closes the switch, then move in the opposite direction until the switch opens. If I remember correctly, I got "make" repeatability of about 0.02" (0.5 mm), and "break" repeatability of about 0.005" (0.13 mm).

**Optical Switches**

For a delta 3D printer, I use optical sensors. Optical sensors have a built-in illumination and sensor, usually on opposite sides of a forked structure. The sensor side has a slot which masks the light being received, helping to shroud it from ambient light. The slot is along an axis which is either aligned with the fork or normal to it. The flag you use for the interrupter should completely cover the slot, and for good repeatability edge of the flag must be parallel with the slot. In other words, some sensors expect the flag to enter from the side while other expect the flag to enter from the top. Either will work, but you need to choose the right sensor for the configuration of your machine.

**Ambient Light with Optical Switches**

Perhaps ambient light could be a problem. If so, it could be addressed by shading the sensor.

Let's assume that the LEDs in the sensor are the same efficiency as the ambient LED lights. For reference, here is a spec sheet for a typical optical interrupter used in optical sensors: <http://www.isocom.com/images/stories/isocom/isocom_new_pdfs/H21A.pdf> The package of the optical sensor is designed to reduce susceptibility to ambient light.

Light intensity falls off as distance^2, and the illuminators in the sensor are very close. How much effect does room light have on the sensor?

In my shop, I use 8-foot LED replacement bulbs for the fluorescent bulbs. With this, I have 72 watts of LED lighting, which, let's say, illuminate evenly the semi-sphere below the ceiling. A full sphere is 12.56 sr (steradians, or stereo-radians), so the half sphere is 6.28 steradians, for a power of 11.46 W/sr. At the sensor, this must be divided by the square of the distance, let's say 8 feet. This gives us (11.46 W/sr)/(96in^2) = 0.119 W/area.

The illuminating LED has a power (typically) of 1.2 V \* 0.05 A, or 0.06 W. The light cone from a typical LED is about 30 degrees, which is 1 sr, for a power of 0.06 W/sr. Scaled for an estimate of the distance between the emitter and sensor of 4 mm or 0.157", is (0.06 W/sr)/(0.157in^2) = 2.43 W/area.

It seems unlikely that general ambient light will be a problem. If it were, the sensor mounting could be designed to shield the sensor from direct exposure to ambient light.

It is important with optical sensors to be sure the interrupting flag is actually opaque to the illuminator light. As I found, red PLA is not especially opaque to infrared light, so I needed to paint the flags with a black pigmented paint.

**Hall Effect Switches**

I have no experience with Hall effect magnetic limit switches. Other answers here have praised them because they have an adjustment which can be used to set the precise detection point. I don' t like adjustments because they drift. Pots are subject to wear, oxidation, and both slow and fast variation in their resistance. I would prefer to have something unadjustable and repeatable in hardware and use software to hold the calibration.

**Example of Hybrid Choice**

On a 6-axis delta architecture CNC machine I build, I use a hybrid approach to sensing home position. Mechanical switches indicate a position that is close to home, and the index pulse of a rotary encoder defines the precise home position. The homing firmware moves toward home until the mechanical switch closes, then away until it opens, then back toward home until it detects the index pulse. As there are six axes, there are six sets of these switches and encoders. Using a mechanical switch for the rough homing made sense for this machine because the index sensor is hit once per revolution, so it is not a unique indicator of home, and this machine creates a lot of dust and chips, which could block an optical sensor.

So, without an absolute answer, my preference is for optical switches for repeatability.

> **Comments:**
> **username_12**: The precision values you got for mechanical switches appear to be extremely high. Granted, they are not perfect, but if mechanical switches only had a repeatability of around 0.5 or 0.13mm, then nearly *every* print on those well-known cheap Chinese 3D printer kits would fail, which is clearly not the case.  
> **username_13**: The link has unfortunately died... do you happen to know the title of the document, so that we could search/google for it?  
> **username_11**: This link may serve: http://pdf.datasheetcatalog.com/datasheets/105/55275_DS.pdf  
> **username_4**: The video in YouTube https://youtu.be/QicY68BOml0 is taking your answer without giving you credit. You can submit request for removal.  

---

### Answer by username_14 on 2016-05-05. Score: 2

I think there are several factors involved in which sensors are best, but the general ordering for me would be Hall, Optical followed by mechanical. All of the types will be subject to some drift due to vibrations and changes in the printer over usage. Therefore it's the ease of adjustment as well as the accuracy of the stop which counts in the assessment.

In my experience the hall effect sensors are the most accurate and easiest. They don't rely on physical switching (as with the mechanical) meaning there is no "wear and tear" on the component and the point of switching will remain fixed. They have a potentiometer which can be adjusted to make the position of the stop change without any mechanical intervention allowing very fine tuning. They can be very accurate.

Optical are similarly accurate but usually have a fixed component that cuts the beam to switch on/off the sensor. The adjustment of the stop will usually be mechanical because the mount points will need to be adjusted - this reduces their accuracy. There are various adjustable mounts to alleviate this on thingyverse or the like.

Mechanical switches are similar to optical in terms of adjustment with the added inaccuracy of the actual switch mechanism which may degrade over time.

> **Comments:**
> **username_4**: The video in YouTube https://youtu.be/QicY68BOml0 is taking your answer without giving you credit. You can submit request for removal.  
> **username_14**: @FarO thanks for pointing it out, he did cite me in his description, and I'm not too worried about it being used.  

---

### Answer by username_15 on 2016-05-05. Score: 1

If you take a look at the [RepRap Wiki](http://reprap.org/wiki/Endstop), they briefly explain these three switches:

* Mechanical
  > *"**Mechanical Endstops** are the most basic form of endstops, made of an ordinary switch, two wires. Changing the switch state signals the electronics.*
* Optical
  > *"These Optical Endstops observe the light level and reacts to sudden changes."*
* Magnetic
  > *"These endstops; Hall effect sensors is a transducer that varies its output voltage in response to a magnetic field. Hall effect sensors are used for proximity switching, positioning, speed detection, and current sensing applications."*

In regards to your question, it's dependent upon your circumstance. However, most of the time a good 'ol Mechanical Switch is repeatable and serves its purpose well.

I, personally, would place both optical and magnetic switches in the category of a multifunction component. Meaning, both of these types of switches (generally) provide a valuable range for object detection. This can potentially lead (depending on your machine) to a pushed command that tells your machine to slow down when it comes close to the soft stop.

Again, personally, I would be wary of using an optical endstop with potential white light noise from ambient room lighting or other sources. I could be wrong in my concern for some modules that address these kind of issues.

So, if we narrow down between mechanical and magnetic:
- Magnetic would provide a gentler approach, reducing (potentially) the amount of wear
- However, I'm assuming, magnetic switches require "dialing in" depending on the components used in the sensor. This could lead to an undesired range that the sensor is triggered.
- Mechanical switches are simple. They're either touching or not touching (on or off)
- A possible pro (or con) is the ability to manipulate the trigger manually, more easily. I've run into a situation a few times where I needed to manually trigger the endstop as part of a troubleshooting step. But, if you accidentally bump your endstop while the machine is running, no good.

> **Comments:**
> **username_0**: Do you know if this "pushed command that tells your machine to slow down" is used on any machine?  
> **username_15**: I don't know of a real world use for 3D printing, that's why I said it's a potential option. I have seen similar setups in traditional CNC machining with a third party sensor. The sensor does its thing and essentially pushes a G-Code command to the machine's controller. Typically the command is a subroutine that performs multiple functions like moving the machine to a safe distance, stopping, and notifying the operator. Look up Caron Engineering for an example with their TMAC setup.  
> **username_5**: This doesn't answer the question, which asks "which endstops are the most precise?". There's nothing in here that addresses that - this answer mainly seems to be theorizing about a "gentler approach" which isn't even supported by any firmware.  
> **username_15**: @TomvanderZanden I'm purposely staying away from answering that part of the question as it is primarily opinion based.  
> **username_5**: You could answer that part pretty objectively if you looked in some datasheets for the repeatability characteristics of various endstops.  

---

### Answer by username_7 on 2017-08-16. Score: 0

A separate issue not addressed in other answers is that the end stops for X/Y axes have different requirements than those for the Z axis.

### X/Y Axes

When the printer offers XYZ calibration (like Prusa i3 MK2), the properties of the X and Y switches play a role, since for the Z probing the probe should be centered above the fiducials (copper circles) in the bed. The XY part of the calibration measures the position of the fiducials relative to the end-stop trigger point. Then the Z calibration measures the height of each fiducial.

When the XYZ calibration is not offered, there's usually no need for very repeatable positioning relative to the X and Y travel ends, and on most printers you could simply move the motors until they start skipping steps and call that a day - it will be accurate to within a few steps.

### Z Axis

The Z axis always has a high requirement on accuracy and repeatability, and there are two general approaches to determining its position:

1. No end-stops on the Z-axis drive system, a probe is mounted on the print head and is used to detect when the head is a certain distance above the print bed. This can be used for 9-point calibration of the bed shape and thus removes the need for bed levelling.
2. End-stops used on the Z-axis drive system. No sensor on the print head. The bed needs to be separately leveled in reference to the nozzle - thus the bed leveling screws.

### Delta Z

For Delta, you essentially have three Z axis drivers, and similar to the Cartesian XYZ drive, you don't need any end-stops if you have a probe on the print head. You can also perform multi-point bed leveling with such a probe.

### Other Approaches

X and Y endstops become unnecessary once you use closed-loop stepper control, such as [Mechaduino](http://tropical-labs.com/index.php/mechaduino) or linear digital position sensors (e.g. as used in CNC machines).

The Z probe is still useful if you don't want to perform bed leveling manually.

> **Comments:**
> **username_5**: While these are interesting points about endstops, it doesn't address the actual question at all.  
> **username_16**: Do you have any references to a delta running without endstops?  I'm fairly certain endstops are required to establish axis position otherwise the motion gets screwed up.  
> **username_7**: Kinematically they are not required. Similar to a double-Z-axis Prusa mount, you start with a "fairly" middle-of-the-bed position, then all three Z axes move down until the probe detects the first fiducial. It's a large circle (e.g. 1 inch dia) and establishes the Z and radial origin (think of the bed in polar coordinates). Second fiducial is a narrow sector and establishes the angular origin. Now you can find further small fiducials to perform full Z calibration (or full XYZ calibration after assembly). For XYZ cal you need a Prusa-like custom bed. For Z only a circular metal plate will do.  
> **username_17**: @KubaOber Could you please explain how you would decide where "fairly middle-of-the-bed" is on a delta without any sensors? The initial position could be literally anywhere...  
> **username_7**: You can't. You do it manually, or you use a mostly metal bed where the fiducials are negative, i.e. gaps. The inductive sensors are good at detecting those. This would also help detect the edge of the bed so you don't need any additional sensors at all other than the inductive one. I run a delta like that.  

---

