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

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?

Hello @idubrov !

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

It does not make sense on every kinematics.

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.

Find a similar discussion here: Suggestion for improving PROBE_CALIBRATE usability