• G-Codes
  • Configuration
  • Develop
  • About us
  • Privacy Policy

Repetier-Firmware - Configuration - End Stops

Introduction

End stops are used to automatically measure the limits. Each motor needs to be able to reach at least one end stop. The opposite limit position can be guessed by adding the length of possible movements. So far so good, but you will see that we have by default 8 different end stop modules available. This is required to cover several special cases and printer types.

End stops get used at two places:

  1. For the motor definition. Each stepper driver takes a minimum and maximum end stop as parameter.
  2. Each axis can has a minimum and maximum endstop with the name endstopXMin and endstopXMax where X is the axis and can be one of X, Y, Z, E, A, B and C.

The most frequent used end stop is ENDSTOP_NONE, which is just a placeholder and does exactly nothing. Most printers only have an end stop at one side, so the opposite direction gets this end stop type. More over for many printers an axis and a motor end stop are identical. But there is a delicate difference between the two. A motor end stop will just make the axis motor not move any more, while the axis end stop will stop the move. This is significant in the case of homing. Homing moves towards the endstop with a long move. If themove gets aborted (axis end stop) homing is directly finished. If the steps just do not get executed, this means you have to wait for the end of the move and that can be quite some seconds.

Currently end stops get tested in the steppe rinterrupt and hence have big influence on the maximum stepper frequency. It helps if these tests can be omitted. You will always have axis end stops, but if they all get triggered by a hardware end stop, there is no need to test them again in the stepper interrupt. To indicate this condition add:

// If all axis end stops are hardware based we can skip the time consuming tests each step
#define NO_SOFTWARE_AXIS_ENDSTOPS

In many printer types no motor end stops are required. So if you have none you can indicate this with:

// Normally only a delta has motor end stops required. Normally you trigger using axis endstops.
#define NO_MOTOR_ENDSTOPS

Scenarios

Cartesian Printer

Here you only define the per axis end stops. The motors only get a dummy end stop. Axis and motor are identical, so you get no special problems here.

Core XYZ Printer

Here 2 axis together build a core xy/xz/yz system. None the less do we home per axis, so we still define end stops only per axis, just like with the caresian printer.

Delta Printer

Deltas are always a bit special, so it is no wonder, we need special considerations here as well. The z axis is driven by three motors. During homing we need to stop all motors when all 3 end stops are triggered and then we want the move to stop. In this context you now also see why a motor end stop does not stop a move.

The solution is that each motor gets a max end stop. That way, if we home to z max all moves stop at the max. end stop. To stop the remaining move when all have reached the top, we use a special end stop for the z axis - ENDSTOP_MERGE3. This gets the 3 motor end stops as input and only triggers, when all end stops are triggered. In other words, if used for the axis it will terminate the z move only when all 3 end stops are triggering.

Special problems

End stops with short impulse

Some end stops only produce a short high impulse. One example is when you use a stepper driver to detect a stall. If used as axis end stop, this is no problem, especially if the signal uses a hardware interrupt to signal the change. Where it is not usable is, if you need to merge the signal to combine 2 or more signals to build an axis signal. Here you have a high chance that the signal of the first end stop is already reset, when the second or third trigger. For these cases you should use conventional end stops.

End Stop Definitions

Also you can select the names freely, the names for the axis endstop are fixed and have the following names:

Name Position
endstopXMin X axis at minimum position
endstopXMax X axis at maximum position
endstopYMin Y axis at minimum position
endstopYMax Y axis at maximum position
endstopZMin Z axis at minimum position
endstopZMax Z axis at maximum position
endstopAMin A axis at minimum position
endstopAMax A axis at maximum position
endstopBMin B axis at minimum position
endstopBMax B axis at maximum position
endstopCMin C axis at minimum position
endstopCMax C axis at maximum position

Do not forget to define all axis end stops! Even those having no end stop, which you can set to ENDSTOP_NONE.

Fake End Stop
Description

This end stop is always used, if no end stop is connect. It just fakes the interface and always returns the end stop as not hit.

Syntax
ENDSTOP_NONE(name)
Parameter
Parameter Function
name The variable name used to reference this end stop later.
Postprocess

Use the end stop name as end stop for a stepper drivers.

Polling Signal
Description

Polls a pin level to set a state. If you need the inverted signal, use a pin definition with inverted signal.

Syntax
ENDSTOP_SWITCH(name, pin)
Parameter
Parameter Function
name The variable name used to reference this end stop later.
pinNumber Pin variable defined before. See here
Postprocess

Use the end stop name as end stop for a stepper drivers.

Pushing Signal
Description

Pushes a pin level to set a state by adding a listener to the hardware interrupt for pin changes. Works only with pins that have hardware interrupt support. For due based boards this works on all pins. If you need the inverted signal, use a pin definition with inverted signal.

Syntax
ENDSTOP_SWITCH_HW(name, pin, axis, dir)
Parameter
Parameter Function
name The variable name used to reference this end stop later.
pin Pin variable defined before. See here
axis Assigned axis to notify (X_AXIS, Y_AXIS, Z_AXIS, E_AXIS, A_AXIS, B_AXIS, C_AXIS) or -1 if not used as axis end stop.
dir Direction of the axis. false = min end stop, true = max end stop.
Postprocess

Use the end stop name as end stop for a stepper drivers.

Polling Signal Debounced
Description

Polls a pin level to set a state. If you need the inverted signal, use a pin definition with inverted signal. It need level measurements in a row that return high, before the high signal is reported. Great if you have a bit cross talk or the signal bounces when triggering.

Syntax
ENDSTOP_SWITCH_DEBOUNCE(name, pin, level)
Parameter
Parameter Function
name The variable name used to reference this end stop later.
pinNumber Pin variable defined before. See here
level Number of measurements the signal must be reported as high before it is marked as high.
Postprocess

Use the end stop name as end stop for a stepper drivers.

Merge 2 End Stops
Description

Combines the signal of 2 previously defined end stops. Only when both are triggered, this end stop returns a triggered state.

Syntax
ENDSTOP_MERGE2(name, e1, e2, axis, dir)
Parameter
Parameter Function
name The variable name used to reference this end stop later.
e1 Variable name of first end stop to merge
e2 Variable name of second end stop to merge
axis Assigned axis to notify (X_AXIS, Y_AXIS, Z_AXIS, E_AXIS, A_AXIS, B_AXIS, C_AXIS) or -1 if not used as axis end stop.
dir Direction of the axis. false = min end stop, true = max end stop.
Postprocess

Use the end stop name as end stop for a stepper drivers.

Merge 3 End Stops
Description

Combines the signal of 3 previously defined end stops. Only when all end stops are triggered, this end stop returns a triggered state.

Syntax
ENDSTOP_MERGE3(name, e1, e2, e3, axis, dir)
Parameter
Parameter Function
name The variable name used to reference this end stop later.
e1 Variable name of first end stop to merge
e2 Variable name of second end stop to merge
e3 Variable name of third end stop to merge
axis Assigned axis to notify (X_AXIS, Y_AXIS, Z_AXIS, E_AXIS, A_AXIS, B_AXIS, C_AXIS) or -1 if not used as axis end stop.
dir Direction of the axis. false = min end stop, true = max end stop.
Postprocess

Use the end stop name as end stop for a stepper drivers.

Merge 4 End Stops
Description

Combines the signal of 4 previously defined end stops. Only when all end stops are triggered, this end stop returns a triggered state.

Syntax
ENDSTOP_MERGE4(name, e1, e2, e3, e4, axis, dir)
Parameter
Parameter Function
name The variable name used to reference this end stop later.
e1 Variable name of first end stop to merge
e2 Variable name of second end stop to merge
e3 Variable name of third end stop to merge
e4 Variable name of forth end stop to merge
axis Assigned axis to notify (X_AXIS, Y_AXIS, Z_AXIS, E_AXIS, A_AXIS, B_AXIS, C_AXIS) or -1 if not used as axis end stop.
dir Direction of the axis. false = min end stop, true = max end stop.
Postprocess

Use the end stop name as end stop for a stepper drivers.