M574
Back to the Gcode Dictionary
M574: Set endstop configuration
M574 - RepRapFirmware 2.x and earlier
Parameters
- Xnnn Position of X endstop: 0 = none, 1 = low end, 2 = high end.
- Ynnn Position of Y endstop: 0 = none, 1 = low end, 2 = high end.
- Znnn Position of Z endstop: 0 = none, 1 = low end, 2 = high end.
- E Select extruder endstops to define active high or low (RepRapFirmware 1.16 and earlier only)
- Snnn Endstop type: 0 = active low endstop input, 1 = active high endstop input, 2 = Z probe, 3 = motor load detection
Order dependency
If this command refers to any axes other than X, Y and Z then it must be later in config.g than the M584 command that creates those additional axes.
Example
- M574 X1 Y2 Z0 S1 ; X endstop at low end, Y endstop at high end, no Z endstop, all active high
Usage
This defines the type of endstop switch or opto sensor that the printer has for each axis: 0 = none, 1 = low end, 2 = high end. The optional S parameter defines whether the endstop input is active high (S1, the default) or low (S0). A normally-closed endstop switch wired in the usual way produces an active high output (S1).
The S2 and S3 options are supported in firmware 1.20 and later.
This is intended for use with boards that provide a single endstop input for each axis that may be used for either a high or a low end endstop, such as the Duet. On delta printers, the XYZ parameters refer to the towers and the endstops should normally all be high end (i.e. at the top of the towers).
Notes
If you have more than one homing switch for an axis because you want to home multiple motors driving that axis individually, you will need to split them into separate axes during homing, and home those axes together. See [invalid guide link]
In RepRapFirmware 1.16 and earlier, the M574 command with E parameter was used to specify whether a Z probe connected to the E0 endstop input produces an active high (S1) or active low (S0) output. In RepRapFirmware 1.17 and later, use the I parameter of the M558 command instead.
M574 - RepRapFirmware 3
Parameters
- Xnnn Position of X endstop: 0 = none, 1 = low end, 2 = high end.
- Ynnn Position of Y endstop: 0 = none, 1 = low end, 2 = high end.
- Znnn Position of Z endstop: 0 = none, 1 = low end, 2 = high end.
- P"pin_name" Defines the pin name(s) that the endstop(s) for the specified axis are connected to, see Pin Names. Needed when S=1. May need ! before pin name to invert signal, or ^ to enable the pullup resistor, for example on the Duex expansion board.
- Snnn 1 = switch-type (eg microswitch) endstop input, 2 = Z probe (when used to home an axis other than Z), 3 = single motor load detection, 4 = multiple motor load detection (see Notes).
Order dependency
This command must be later in config.g than the M584 command that creates additional axes, or axes that have multiple motors and endstops.
Usage
The M574 command has been updated to allow for more flexibility. This includes supporting axes defined with multiple motors and multiple endstops (one per motor), use of non-default endstop inputs, and re-assigning endstop inputs.
Notes
- Use a separate M574 command for each axis.
- Endstop type S0 (active low switch) is no longer supported in M574 commands. Instead, use type S1 and invert the input by prefixing the pin name with '!'. Ex: M574 X1 S1 P"!xstop". Invert the input when using an NPN output inductive or capacitive sensor, or using a NO switch (not recommended, use a NC switch instead).
- New parameter P gives the pin name(s) for the endstop(s) for the specified axis. If the number of pins matches the number of motors assigned to that axis, motors will be stopped individually when their endstop switches trigger.
- New endstop type S4 means use motor stall detection (like S3) but if there are multiple motors, stop each one individually as it stalls. S3 means use motor stall detection but as in RRF 2: stop all relevant motors when the first one stalls.
- The S2 option of M574 is intended for use only when axes other than Z are using the Z probe for homing. The only printers known that do this using Duet electronics are the RepRapPro Ormerod, Huxley Duo, and Mendel Tricolour machines. When using the Z probe to home Z, M574 Z has no bearing on the probe setup or usage. A Z probe and a Z endstop can both be configured at the same time. G30 calling the probe setup with M558, and G1 H1 Z moves calling the endstop configured with M574 Z.
Example
Old RRF2.x code:
M574 X1 Y1 Z1 U2 S1 ; active high endstop switches, XYZ at min, U at max
New RRF3 code:
M574 X1 S1 P"xstop" ; X min active high endstop switch M574 Y1 S1 P"ystop" ; Y min active high endstop switch M574 Z1 S1 P"zstop" ; Z min active high endstop switch M574 U2 S1 P"e0stop" ; U max active high endstop switch
To use two Z motors using independent homing switches, declare two Z motors in M584, then declare two pins for Z endstops in a single M574 command. Example
M584 X0 Y1 Z2:3 E4 M574 Z1 S1 P"io2.in+io3.in" ; Z axis with two motors, individual min endstops, active high
The order of endstop switch pin names in M574 must match the order of Z motor driver numbers in M584. When homing Z, RRF3 homes the motors of the axis at the same time, independently to their defined endstops.
0 Comments