Connecting endstop switches
The Duet provides one endstop switch input for each axis, and one for each extruder.
- Duet endstop inputs
- Connecting different types of endstop switch
- Test endstop switches
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.
On all Duets except the Duet 2 Maestro, 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 active-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 2 WiFi and Duet 2 Ethernet, 0.3mA for the Duet 2 Maestro, and 2.1mA for the Duet 06 or 085. This is not usually a problem, except with some optical endstop switches that were not designed properly for 3.3V operation.
Note: some types of endstop (e.g. opto endstops designed for 5V operation) my pull the endstop input low enough to light the LED, but not low enough for the Duet to recognise that the input is in the LOW state.
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.
The 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
- Configuring RepRapFirmware for an IDEX printer
- Configuring RepRapFirmware for a SCARA printer
- Configuring RepRapFirmware for a CNC machine
- Configuring RepRapFirmware for a Polar printer
- Configuring RepRapFirmware for a Hangprinter printer
Duet 2 series has endstop labels with axis names. The following table shows a conversion between axis names and numbers of all 12 available endstop inputs
|5||E2 (E2_STOP)||Expansion Header/DueX2/DueX5|
|6||E3 (E3_STOP)||Expansion Header/DueX2/DueX5|
|7||E4 (E4_STOP)||Expansion Header/DueX5|
|8||E5 (E5_STOP)||Expansion Header/DueX5|
|9||E6 (E6_STOP)||Expansion Header/DueX5|
|10||Stop 10 (ENC_B)||CONN_LCD Header|
|11||Stop 11 (ENC_A)||CONN_LCD Header|
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.
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|
|2 or 3||GND||GND|
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.
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.
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.
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 opto switch series resistor resistor by 100 ohms. Tip: if your opto endswitch uses surface mount resistors, instead of removing the 180 ohm resistor it is easier to solder a 200 or 220 ohm resistor on top of it, so that the two resistors are connected in parallel.
If you are using either the Duet 2 Maestro or hardware version 1.04 of the Duet 2 WiFi/Ethernet, these boards can tolerate 5V on the endstop inputs. So if your optical endstops do not work with a 3.3V supply, then instead of modifying them you can provide them with a 5V supply instead (leaving the centre pin of the endstop connector not connected) and connect the outputs of your endstops directly to the STP pins of the endstop connectors.
- Apply power to the printer. You need only 5V power for this test, so we suggest you leave the main power turned off and just connect the printer to a PC via the USB cable. Note: if you have a PanelDue with 7" screen then USB power may not be sufficient.
- Connect to your printer from a web browser
- Select Settings from the menu on the left hand side
- Select the Machine Properties tab
- You will see several rows of data. In the Endstop Hit column you can see the state of the selected endstop type. The first three rows in that column correspond to the X, Y and Z endstops in that order.
- If you are using conventional microswitches or sensors connected to the endstop inputs of the Duet, test that the Endstop Hit value displayed is No when the corresponding axis is not pushed against the endstop, and Yes when it is
What might go wrong:
- If the Duet fails to boot up with the endstops switches connectors, or if it disconnects from the browser as soon as you trigger an endstop switch, this usually means that you are using microswitch endstops and you have connected to the wrong pins of the endstop connector. 2-wire microswitches must be connected to the outer two pins of the connector, which is not the same as many other 3D printer control boards.
- If the endstop switches read in reverse, then the remedy depends on the type of endstop sensor:
- If the sensor is a 2-wire microswitch, we recommend that you use the normally-closed contacts, which are the two outermost tags on the switch (leave the centre tag not connected).
- If you are already using those contacts, or you are using a different type of endstop sensor, in the M574 command in config.g change S0 to S1 or vice versa.
- If the Endstop hit value doesn't change when you trigger the endstop:
- Check the wiring
- If they are optical endstops, first make sure that you have S1 in the M574 command. Then, if the endstops show as triggered all the time, your endstops are probably ot 3.3V compatible and you need to modify them - see Connecting endstop switches. If they never show as triggered, check that the flag on the end of the axis blocks the slot completely, and that there is a pullup resistor between the sensor output and +3.3V (10K is usually suitable).
If you don't have access to your Duet from a browser, you can send M119 commands from USB or PanelDue to read the endstop state while doing the tests listed above.