Skip to main content

Site Navigation

Your Account

Choose Language


Revision to Connecting endstop switches


[title|Connecting endstop switches]
[summary]The Duet provides one endstop switch input for each axis, and one for each extruder.[/summary]
== Duet endstop inputs ==
Each endstop input has ground, +3.3V and sense pins in that order, labelled GND, 3V3 and STP respectively on the back of the board.
Each input has a pullup resistor and red LED between the STP pin and +3.3V. The LED will be illuminated when an endstop switch or other device connected to the input holds the voltage close to 0V (ground). '''Whether the LED is illuminated when the endstop switch is triggered or not triggered depends on whether your endstop switch produces and acive-high or active-low output:'''
* An endstop switch with an active-high output holds the input pin at about 0V when the switch is not triggered, and about +3.3V when it is triggered. A typical example is a normally-closed microswitch. The LED on the Duet will be illuminated when the switch is connected but not triggered.
* An endstop switch with an active-low output holds the input pin at about 3.3V when the switch is not triggered, and about 0V when it is triggered. One example is a normally-open microswitch (which is not recommended, because a normally-closed switch is safer). Another example is a Hall sensor with an open-drain output that is connected directly to the Duet endstop input. The LED on the Duet will be illuminated when the switch is connected and triggered.
The endstop switches each need to be able to sink 1.5mA current for the Duet WiFi and 2.1mA for the Duet. This is not usually a problem, except with some optical endstop switches that were not designed properly for 3.3V operation.
Each axis endstop input can be configured in firmware for a Max (high end of axis) or Min (low end of axis) endstop, and with an active high or active low signal level. Configuration is done in config.g using the M574 command.
You can check the state of the endstop inputs read by the Duet using either of the following methods:
* In Duet Web Control, go to the Settings page and then the machine properties tab. There is a column showing the endstop states.
* Send M119 from a USB host program, or from PanelDue, or from the web interface.
On most types of printers except delta, you do not need to have a Z endstop switch if you use a Z probe for Z homing.
=== Configuring endstop switches in firmware ===
The [[G-code#M574:_Set_endstop_configuration| M574]] gcode is used to configure endstops. For more detail on specific types of printers see:
* [[Configuring_RepRapFirmware_for_a_Cartesian_printer]]
* [[Configuring_RepRapFirmware_for_a_Delta_printer]]
* [[Configuring_RepRapFirmware_for_a_CoreXY_printer]]
== Connecting different types of endstop switch ==
=== Microswitch ===
This applies to a bare microswitch, not to a microswitch on a board with a LED. Connect the switch between GND and STP (the outer 2 pins of the 3-pin connector). '''Note''': this is '''not''' the same as on RAMPS.
We recommend you use the normally-closed contacts of the microswitches, which are generally the outside two connections on the microswitch, and set the signal polarity to active high (S1) in the M574 command. If for any reason you use normally-open microswitch contacts, you will need to set the signal polarity to active low (S0) in the M574 command.
=== Makerbot Mechanical Endstop v1.2 ===
Connect it to the Duet endstop connector as follows. '''Note''': the pins on the Duet endstop connector are not in the same order as on RAMPS!
|! Makerbot endstop pin number
|! Function
|! Duet endstop pin marking
| 1
| 3V3
| 2 or 3
| 4
| Output
Unfortunately the pin markings on the Makerbot endstop board are hidden underneath the connector. Pin 1 is next to the long edge of the board that does not have the microswitch on it, and pin 4 is nearest the edge with the microswitch.
These devices produce an active-low output, so use the S0 parameter in your M574 command.
=== 3.3V-compatible Hall sensor ===
Connect Gnd to Gnd, Vcc of the Hall sensor to 3V3, and the output of the Hall sensor to STP. Simple Hall sensors normally have active low outputs, so use S0 in the M574 command. If your Hall sensor is a circuit board with a sensitivity adjustment potentiometer on it, then it may provide an active high output instead of active low. If your hall switch is just the IC then you should also connect a 0.1uF capacitor between Vcc and Gnd close to the IC.
=== 5V Hall sensor with open-collector or open-drain output ===
Examples: Allegro A3141, A3142, A3143, A3144 (all of these are discontinued products, but still found on eBay)
Preferably, use 3.3V-compatible hall sensors instead. However, If your 5V Hall sensor has an open-collector or open-drain output (as the devices listed above do), you can wire it as for a 3.3V sensor except that Vcc must be connected to +5V (available at pin 1 of the expansion connector) instead of to the 3v3 endstop connector pin.
=== 3.3V-compatible optical endstop ===
Connect Gnd to Gnd, Vcc of the opto sensor to 3V3, and the output of the opto sensor to STP. Opto sensors usually have active high outputs, so use S1 in the M574 command.
Note: opto endstops made to the Generation 7 design are often claimed to be 3.3V-compatible, but in fact the design is marginal with a 5V supply and frequently doesn't work at all on 3.3V. To use this design with a 3.3V supply, you may need to replace the 180 ohm resistor by 100 ohms, and either replace the 1K resistor by 10K or remove it completely.