# \[FR\] Apply Z adjustments to both endstop AND max position?

**URL:** <https://klipper.discourse.group/t/fr-apply-z-adjustments-to-both-endstop-and-max-position/14146>\
**Category:** Features\
**Created:** [February 15, 2024, 9:57pm UTC](https://klipper.discourse.group/t/fr-apply-z-adjustments-to-both-endstop-and-max-position/14146 "2024-02-15T21:57:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![idubrov](https://avatars.discourse-cdn.com/v4/letter/i/a9adbd/32.png) [@idubrov](https://klipper.discourse.group/u/idubrov)\
**Post date:** [February 15, 2024, 9:57pm UTC](https://klipper.discourse.group/t/fr-apply-z-adjustments-to-both-endstop-and-max-position/14146/1 "2024-02-15T21:57:42Z")

</div>

Feature request regarding the `Z_OFFSET_APPLY_ENDSTOP` / `Z_ENDSTOP_CALIBRATE` (unless I’m missing something).

Both of these commands apply changes to the `position_endstop`. However, in some printers (like Voron V0.2), the endstop is located exactly at the extreme of the Z travel, the position where `position_max` is supposed to be. So, in such printers, `position_max` should always be exactly where `position_endstop` happens to be – as you cannot go past the endstop.

However, Klipper does not update the `position_max` during that calibration, which causes one the two issues:

1. `position_endstop` could become more than the `position_max`, causing `SAVE_CONFIG` to fail with an error that endstop is \> max.

2. `position_endstop` could stay/become strictly less than the `position_max`, allowing potential Z crash since table is now allowed to go past the endstop.

I’ve read Klipper documentation but I fail to see how this could be remedied. Hence the feature request:

Would it make sense to add a new setting, let’s call it maybe `[manual_probe] max_position_endstop_offset = <offset>` that, if present, would make both G-Code commands to _also_ update `position_max`, the same way they update `position_endstop`? If setting is not present, it will behave the same way as it currently does – only updating the `position_endstop`. If present, the new `position_max` will be new `position_endstop` + `max_position_endstop_offset`.

Does it sound reasonable?

---

<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:** [February 16, 2024, 8:11am UTC](https://klipper.discourse.group/t/fr-apply-z-adjustments-to-both-endstop-and-max-position/14146/2 "2024-02-16T08:11:28Z")

</div>

Hello @idubrov !

You may explain on what kind of printer you like to see this.

It does not make sense on every kinematics.

---

<div class="post-metadata">

**Author:** ![idubrov](https://avatars.discourse-cdn.com/v4/letter/i/a9adbd/32.png) [@idubrov](https://klipper.discourse.group/u/idubrov)\
**Post date:** [February 16, 2024, 3:03pm UTC](https://klipper.discourse.group/t/fr-apply-z-adjustments-to-both-endstop-and-max-position/14146/3 "2024-02-16T15:03:35Z")

</div>

Right. Cartesian and Core XY are the two I can think of, but I am not really well-versed in different designs.

The thing is that I don’t really like my proposal. It adds an extra setting that might be confusing and it doesn’t work for every design.

However, I firmly believe that the current manual Z offset adjustments are just not working well for a very specific, but a very common design (Voron V0).

I wonder if there is a better way, though. Maybe, provide a way to override the part that updates the configuration? I tried overriding `Z_OFFSET_APPLY_ENDSTOP` macro, but I didn’t find a way to apply configuration changes from a custom g-code.

---

<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:** [February 16, 2024, 4:39pm UTC](https://klipper.discourse.group/t/fr-apply-z-adjustments-to-both-endstop-and-max-position/14146/4 "2024-02-16T16:39:46Z")

</div>

Find a similar discussion here: [Suggestion for improving PROBE\_CALIBRATE usability](https://klipper.discourse.group/t/suggestion-for-improving-probe-calibrate-usability/13007)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/klipper/original/1X/64419bf2aac6639e6ef5cef200dcd456b0a01ac3.png) [@system](https://klipper.discourse.group/u/system)\
**Post date:** [April 16, 2024, 4:40pm UTC](https://klipper.discourse.group/t/fr-apply-z-adjustments-to-both-endstop-and-max-position/14146/5 "2024-04-16T16:40:25Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
