# How is the definition position\_endstop applied?

**URL:** <https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773>\
**Category:** General Discussion\
**Created:** [January 16, 2022, 4:20am UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773 "2022-01-16T04:20:11Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seckitnogo](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@Seckitnogo](https://klipper.discourse.group/u/Seckitnogo)\
**Post date:** [January 16, 2022, 4:20am UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773/1 "2022-01-16T04:20:11Z")

</div>

This parameter is described in the Klipper docs thus : Location of the endstop (in mm).

If I write -5 or 0 or +10 what does it mean? Is it in fact a measured value or a calculated number If its a physical measurement where do I put the ruler ? What are the effects of changing the number ? Thank you.

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [January 16, 2022, 10:15am UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773/2 "2022-01-16T10:15:36Z")

</div>

See [Home offset for small PEI - #4 by Sineos](https://klipper.discourse.group/t/home-offset-for-small-pei/195/4)

---

<div class="post-metadata">

**Author:** ![nowahuta](https://avatars.discourse-cdn.com/v4/letter/n/da6949/32.png) [@nowahuta](https://klipper.discourse.group/u/nowahuta)\
**Post date:** [January 16, 2022, 3:09pm UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773/3 "2022-01-16T15:09:34Z")

</div>

I’d just gone over that in setting up TMC driver with sensorless homing. A negative value, you don’t want (I may even error out and not accept it). This setting is a “backoff” amount that the stepper will move when it hits an endstop. It will back off and then re-try the endstop. This is desireable for mechanical endstop switches. For sensorless homing, you want this to be zero as there is no accuracy benifit.

---

<div class="post-metadata">

**Author:** ![Seckitnogo](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@Seckitnogo](https://klipper.discourse.group/u/Seckitnogo)\
**Post date:** [January 16, 2022, 4:23pm UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773/4 "2022-01-16T16:23:32Z")

</div>

Ahh .Thank you both for these explanations . I was under the wrong impression that it referred to the physical position of the endstop switch ( mechanical /optical / point of impact for sensorless ) on the printer .  
Am I correct in saying then : its a value that determines what the toolhead does once the enstop is trigerred ?

---

<div class="post-metadata">

**Author:** ![nowahuta](https://avatars.discourse-cdn.com/v4/letter/n/da6949/32.png) [@nowahuta](https://klipper.discourse.group/u/nowahuta)\
**Post date:** [January 16, 2022, 5:04pm UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773/5 "2022-01-16T17:04:17Z")

</div>

Ohh! You are talking about Z-endstop. That is a little different. Sorry. It isn’t recommended to use TMC sensorless homing for Z-endstop, also to that, it isn’t recommended to set this value to zero.

You want your sensor to trigger with the tool head NOT hitting the bed. This value would be the difference between endstop triggering and tool head hitting. From various configuration examples in Klipper repo, you’ll see that this value is positive in Z-axis cases.

[docs link](https://www.klipper3d.org/FAQ.html?h=position_endstop#why-is-the-z-position_endstop-set-to-05-in-the-default-configs)

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [January 16, 2022, 5:51pm UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773/6 "2022-01-16T17:51:22Z")

</div>

Let’s try not to mix things:

Endstops, as a general and most basic thing, are reference points for your axes. The printer and printer firmware does not know where the mechanical axis are, until you hit an endstop. This is commonly known as homing.

Typically the origin of a printer bed (x=0, y=0) is defined in its front left corner

The values `position_endstop` and `position_max` belong together and tell the printer where to find its origin after hitting the endstop.

Example for x-Axis:

```auto
position_endstop: 264
position_max: 264

```

This tells the printer that after hitting the endstop, it needs to travel -264mm in X direction to reach the bed’s front edge (x=0)

**But my bed is only 230mm?!?**  
This is the task of the slicer: Also the slicer starts his coordination system in the front-left corner. In the slicer settings you specify that your bed size is 230mm in the x direction.  
Now both slicer and physical printer are “on the same page” and you can print.

**Sensorless Homing:**  
The logic is the same. Just you replace a mechanical endstop with measuring the motor current when hitting the end of axis.

---

<div class="post-metadata">

**Author:** ![Seckitnogo](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@Seckitnogo](https://klipper.discourse.group/u/Seckitnogo)\
**Post date:** [January 16, 2022, 8:46pm UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773/7 "2022-01-16T20:46:13Z")

</div>

Nowahuta , I should have made it clearer , I’m trying to understand the application to the X and Y axes .

Sineos , thank you for taking the time to write up the explanation . I understand it much better now . If a negative value is specified for position\_endstop : how is this interpreted by Klipper ?

I have seen in example printer.cfg files small negative values specified say \< 15mm .

Until you pointed it out, It wasn’t clear to me that position\_max has to be taken into account . I’ll go back to Klipper docs and read them once more .

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [January 16, 2022, 9:33pm UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773/8 "2022-01-16T21:33:29Z")

</div>

With `position_endstop` and `position_max` you are talking about the physical limits of your printer. Where it finds it endstops and how far from it an axis can safely travel.

The general logic thus depends on the mechanical setup of your printer. Bed-slingers (e.g. Ender 3) often have their X, Y endstops at 0 and you tune the endstop position with a screw so that your nozzle is exactly at the bed’s origin. With `position_max` you tell the axis how far it then can mechanically safely travel, e.g.

```auto
position_endstop: 0
position_max: 235

```

This can go even outside of your bed. This is useful, especially when you use a bltouch / probe. Due to its offset from the nozzle, the nozzle may already be beyond the bed but the probe still is on it (remember: valid printing area is set in slicer).

Negative values again depend on the physical position of the endstop and are also needed to maximize a probing area or account for “strange” endstop positions. It means the head can move even past the endstop for the given distance, e.g.

```auto
position_min: -5
position_endstop: 0
position_max: 235

```

Klipper verifies that any move are between `position_min` (Default 0) and `position_max` (the physical limit of your axes)

Edit for more clarity

---

<div class="post-metadata">

**Author:** ![nowahuta](https://avatars.discourse-cdn.com/v4/letter/n/da6949/32.png) [@nowahuta](https://klipper.discourse.group/u/nowahuta)\
**Post date:** [January 16, 2022, 11:41pm UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773/9 "2022-01-16T23:41:41Z")

</div>

Yeah. you can have a positive endstop value if your printhead can move further than where the trigger fires in XY or Z. This is possible with mechanical endstops (a bit) and most z probes.

If you have a negative value for endstop, you are limiting area avilable to print at (no bed there, don’t print there). But, limiting print area is what min prameter is for. So, wouldn’t typically have a negtive endstop value.

---

<div class="post-metadata">

**Author:** ![Seckitnogo](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@Seckitnogo](https://klipper.discourse.group/u/Seckitnogo)\
**Post date:** [January 17, 2022, 5:22pm UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773/10 "2022-01-17T17:22:38Z")

</div>

Sineos , its very generous of you to have written this detailed explanation thank you .

Thank you too to nowahuta .

I think I’ve got a handle on it now because of your descriptions. A small detail: once the printer.cfg is finalised it will run a Corexy Seckit-Go2 printer . All the best.

---

<div class="post-metadata">

**Author:** ![bkw](https://avatars.discourse-cdn.com/v4/letter/b/e495f1/32.png) [@bkw](https://klipper.discourse.group/u/bkw)\
**Post date:** [March 14, 2022, 4:38am UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773/11 "2022-03-14T04:38:04Z")

</div>

Negative value doesn’t seem to work. I want the printer to consider 0 to be 2mm from the endstop. IE, hit the stop, then go +2mm, and call that 0. For both X and Y.

The actual physical behavior and limits of the machine are for example on Y: if you treat the endstop as 0, then it’s physically possible to move -2mm and +123mm from 0.  
So I have:  
position\_endstop: 0  
position\_min: -2  
position\_max: 123

So far so good, but the bed has chamfers cut off the corners for the levelling screws, (whambam magnetic bed on a monoprice select mini) and if you draw a 120x120 square, the 0,0 corner goes off the corner of the bed. There is pysically room within the motion to treat 2,2 as home, and still have a full 120x120 printable area, and still be at least 1mm away from the physical limit at +120 from there, and still over 5mm from the edge of the bed.

As far as I can tell from reading the docs, the way to describe the hardware would be to say:  
position\_min: -4  
position\_endstop: -2  
position\_max: 121

IE, you can physically move -4mm from 0, the endstop is -2mm from 0, and you can physically move +121 from 0. (and in the slicer the printable area is defined as 120x120)

However when I try to do that, home and gcode to go to x0 y0 still homes to the same spot as if position\_endstop were set to 0. I have a gcode macro for drawing bed-levelling lines at the limits from 0,0 to 0,120, to 120,120 etc, so there is no slicer involved.

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [March 14, 2022, 7:23am UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773/12 "2022-03-14T07:23:53Z")

</div>

> [@bkw](#):
>
> Negative value doesn’t seem to work. I want the printer to consider 0 to be 2mm from the endstop. IE, hit the stop, then go +2mm, and call that 0. For both X and Y.

You can achieve this either in the slicer (here SuperSlicer):

 ![grafik](https://global.discourse-cdn.com/free1/uploads/klipper/original/2X/c/cec737e5733a540261c27c61644cbb8b01f00085.png)

or via [SET\_GCODE\_OFFSET](https://www.klipper3d.org/G-Codes.html#set_gcode_offset), i.e. home to 0,0 and then set the offset in your starting Gcode or macro

---

<div class="post-metadata">

**Author:** ![cofhal](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@cofhal](https://klipper.discourse.group/u/cofhal)\
**Post date:** [October 15, 2023, 5:38pm UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773/15 "2023-10-15T17:38:14Z")

</div>

The printing area of my printer is long before the endstops, that is, the 0.0 point is in the case of the Y axis 23mm before the endstop and for the Y axis it is 5 mm before the endstop. In Marlin the parameter position\_min: is X\_MIN\_POS and is the position of the endstop. According to that in Klipper it is not possible to have the endstop beyond the zero of the printing area, because the endstop value must be within the position\_min and position\_max values and it would only work if the endstops are installed in the maximum travel positions of the X and Y axes.

---

<div class="post-metadata">

**Author:** ![EddyMI3D](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/eddymi3d/32/1981_2.png) [@EddyMI3D](https://klipper.discourse.group/u/EddyMI3D)\
**Post date:** [October 15, 2023, 7:42pm UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773/16 "2023-10-15T19:42:15Z")

</div>

> [@cofhal](#):
>
> According to that in Klipper it is not possible to have the endstop beyond the zero of the printing area,

You can set the endstop position to a negative value (the distance between endstop and the start of the print area)

---

<div class="post-metadata">

**Author:** ![cofhal](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@cofhal](https://klipper.discourse.group/u/cofhal)\
**Post date:** [October 15, 2023, 8:12pm UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773/17 "2023-10-15T20:12:23Z")

</div>

Not work, endstop Endstop must be between position mi and position max.

---

<div class="post-metadata">

**Author:** ![EddyMI3D](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/eddymi3d/32/1981_2.png) [@EddyMI3D](https://klipper.discourse.group/u/EddyMI3D)\
**Post date:** [October 15, 2023, 8:43pm UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773/18 "2023-10-15T20:43:32Z")

</div>

Then you align the value for position min accordingly.

This is on my T-Rex 3:

```auto
[stepper_x]
step_pin: PF0
dir_pin: !PF1
enable_pin: !PD7
microsteps: 16
rotation_distance: 39.84
endstop_pin: ^PE5
position_min: -45
position_endstop: -45
position_max: 400
homing_speed: 50.0
second_homing_speed: 10.0

```

Some BG info:

[https://www.klipper3d.org/Config\_Reference.html#stepper](https://www.klipper3d.org/Config_Reference.html#stepper)

Quite valuable.

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [October 16, 2023, 7:29am UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773/19 "2023-10-16T07:29:59Z")

</div>

You might also refer to [Understanding X and Y Axes Limits and Homing](https://klipper.discourse.group/t/understanding-x-and-y-axes-limits-and-homing/10779) for some explanation.

---

<div class="post-metadata">

**Author:** ![Peter2023](https://avatars.discourse-cdn.com/v4/letter/p/f19dbf/32.png) [@Peter2023](https://klipper.discourse.group/u/Peter2023)\
**Post date:** [November 30, 2023, 12:53am UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773/20 "2023-11-30T00:53:02Z")

</div>

Hi, im jumping into this older conversation because I cannot find a solution for my Issue, search around for days now.  
Hope you could clarify to me.  
Since I couldnt get my BLTouch triggering Im switching to traditional Z Endstop.  
I have no Issues with X and Y Endstop, but for my Ender5 I want to use the Voron Style Z Endstop with the pin next to the bed + a Klicky probe for Leveling.  
Now I cannot find where I can set the X and Y Position the Printhead should go before lowering the nozzle onto the Z Endstop pin besides the bed.  
Or must this be where X and Y Endstops are located? Since the Voron one is in the Center, but I couldnt find anything helpful in their config file.  
Maybe you could point me to the right direction or similar post if already existing.  
As I said im searching for days how set this up, next step would be to go for the Z-Offset Auto Calibration using the Klicky together with the Z Endstop. I will have to define the switch as Z Endstop and Klicky as Probe, correct?  
THX all for you help…I still have a lot of thins to learn in Klipper (coming from Marlin)

---

<div class="post-metadata">

**Author:** ![EddyMI3D](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/eddymi3d/32/1981_2.png) [@EddyMI3D](https://klipper.discourse.group/u/EddyMI3D)\
**Post date:** [January 25, 2024, 9:39pm UTC](https://klipper.discourse.group/t/how-is-the-definition-position-endstop-applied/1773/21 "2024-01-25T21:39:08Z")

</div>


