klipper/klippy
microlay cdb798aee5 Add Z_CALIBRATE command for automatic Z-axis calibration
Features:
- New Z_CALIBRATE command that performs full Z-axis calibration:
  1. Executes G28 Z (home to Zmin endstop)
  2. Probes upward to find Zmax using Y endstop (SKR3 hardware workaround)
  3. Reports actual travel distance vs configured position_max
  4. Auto-updates both NanoDLP ZLength and Klipper position_max if diff > 0.5mm
  5. Automatically restarts Klipper to load new configuration

Technical changes:
- Fixed YEndstopWrapper to return Z steppers instead of Y steppers
  This allows probing_move() to correctly track Z-axis movement
  while using Y endstop for trigger detection
- Temporarily expands Z limits during calibration to allow full travel
- Updates NanoDLP machine.json CustomValues.ZLength directly (JSON modification)
- Updates Klipper printer.cfg position_max via regex replacement

Usage:
  Z_CALIBRATE                    # Use default speed
  Z_CALIBRATE SPEED=5            # Custom probe speed (mm/s)
  Z_CALIBRATE MAX_TRAVEL=200     # Custom max travel distance

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 17:47:25 +01:00
..
chelper input_shaper: Track kinematics updates by dual_carriage 2025-06-04 13:40:58 -04:00
extras Add Z_CALIBRATE command for automatic Z-axis calibration 2025-11-28 17:47:25 +01:00
kinematics input_shaper: Track kinematics updates by dual_carriage 2025-06-04 13:40:58 -04:00
clocksync.py clocksync: Simplify 32bit clock upconversion code 2023-12-10 14:59:13 -05:00
configfile.py configfile: Fix comments on same line as [include xxx.cfg] directive 2024-11-12 21:07:44 -05:00
console.py console: No need to import pins module 2023-01-07 12:00:16 -05:00
gcode.py gcode: Improve checksum detection in get_raw_command_parameters() 2024-12-01 14:16:13 -05:00
klippy.py klippy: Fix missing default parameter of invoke_async_shutdown() 2024-12-02 12:51:51 -05:00
mathutil.py kinematics: Generic Cartesian kinematics implementation (#6815) 2025-05-06 18:06:36 -04:00
mcu.py mcu: Decrease mcu.max_nominal_duration() to 3 seconds from 5 2025-04-28 19:28:52 -04:00
msgproto.py msgproto: Fix return type for create_command() 2024-11-13 14:24:03 -05:00
parsedump.py parsedump: Support running on both python2 and python3 2022-12-07 14:31:03 -05:00
pins.py pins: Improve pin description checks 2022-05-09 16:33:46 -04:00
queuelogger.py klippy: Add Python2 module wrappers and use Python3 module naming 2021-10-04 14:36:08 -04:00
reactor.py reactor: Fix typo 2023-03-14 22:08:13 -04:00
serialhdl.py serialhdl: Catch IOError in connect_canbus() 2024-07-05 20:16:21 -04:00
stepper.py stepper: Fix broken manual_stepper rail naming (#6929) 2025-05-10 20:10:54 -04:00
toolhead.py toolhead: Initial support for adding extra axes to toolhead moves 2025-05-12 20:15:03 -04:00
util.py util: report git version info as a dict 2023-05-04 14:07:14 -04:00
webhooks.py webhooks: support msgspec json serialization 2025-05-02 12:19:13 -04:00