Multi-Z Reference Configuration
This page compiles Klipper reference configurations for dual-Z, triple-Z, and quad-Z machines. The pins, travel, and directions in the examples need to be modified according to the actual mainboard and machine structure.
- Before debugging the Z axis for the first time, please confirm that the lead screws, couplers, and platform will not jam.
- Multiple Z motors must use the same
rotation_distance,microsteps, and mechanical transmission specifications. - When using a Probe or BL-Touch as the Z endstop, do not keep
position_endstopat the same time. - VORON official (including Trident and 2.4) does not provide a unified
dir_pinpolarity table. Any statement in mainboard vendor samples about "which Z axes have!" is the result of actual machine testing and must not be copied directly.
Dual Z with Single Endstop
When dual Z motors share one endstop, you only need to configure endstop_pin in [stepper_z]. The second Z motor [stepper_z1] does not require an endstop_pin.
[stepper_z]
step_pin: <z_step_pin>
dir_pin: <z_dir_pin>
enable_pin: !<z_enable_pin>
rotation_distance: 4
full_steps_per_rotation: 200
microsteps: 16
endstop_pin: ^!<z_endstop_pin>
position_endstop: 0
position_max: 300
homing_speed: 50
homing_retract_dist: 5
[stepper_z1]
step_pin: <z1_step_pin>
dir_pin: <z1_dir_pin>
enable_pin: !<z1_enable_pin>
rotation_distance: 4
full_steps_per_rotation: 200
microsteps: 16
Dual Z with Dual Endstops
When dual Z motors use independent endstops, the second Z motor needs an endstop_pin. This method is suitable for machines that require detecting the endpoints of both Z axes separately.
[stepper_z]
step_pin: <z_step_pin>
dir_pin: <z_dir_pin>
enable_pin: !<z_enable_pin>
rotation_distance: 4
full_steps_per_rotation: 200
microsteps: 16
endstop_pin: ^!<z_endstop_pin>
position_endstop: 0
position_max: 300
homing_speed: 50
homing_retract_dist: 5
[stepper_z1]
step_pin: <z1_step_pin>
dir_pin: <z1_dir_pin>
enable_pin: !<z1_enable_pin>
rotation_distance: 4
full_steps_per_rotation: 200
microsteps: 16
endstop_pin: ^!<z1_endstop_pin>
Dual Z Using Probe or BL-Touch
When using a Probe or BL-Touch as the Z endstop, change the endstop_pin in the first Z configuration to probe:z_virtual_endstop, and add the corresponding [probe] or [bltouch] configuration.
[stepper_z]
step_pin: <z_step_pin>
dir_pin: <z_dir_pin>
enable_pin: !<z_enable_pin>
rotation_distance: 4
full_steps_per_rotation: 200
microsteps: 16
endstop_pin: probe:z_virtual_endstop
# position_endstop: 0
position_max: 300
homing_speed: 50
homing_retract_dist: 5
step_pulse_duration: 0.000004
[stepper_z1]
step_pin: <z1_step_pin>
dir_pin: <z1_dir_pin>
enable_pin: !<z1_enable_pin>
rotation_distance: 4
full_steps_per_rotation: 200
microsteps: 16
[probe]
pin: ^<probe_pin>
x_offset: 0
y_offset: 0
# z_offset: 0
speed: 3.0
lift_speed: 5
samples: 3
samples_result: median
sample_retract_dist: 3.0
samples_tolerance: 0.075
samples_tolerance_retries: 3
Check Sequence
- Use
STEPPER_BUZZ STEPPER=stepper_zto check the direction of the first Z motor. - Use
STEPPER_BUZZ STEPPER=stepper_z1to check the direction of the second Z motor (and so on for three-Z/four-Z configurations). - Confirm that each Z motor "rises first, then lowers," driving the gantry or platform at its corner to move in the same direction.
- After confirming that the rising and lowering directions are consistent, execute
G28 Z. - Only after homing succeeds on multi-Z machines may
Z_TILT_ADJUSTorQUAD_GANTRY_LEVELbe executed.
Why Do Up-and-Down Movement Conflicts Occur
Three Z/four Z machines mechanically share the same transverse axis, but in Klipper each Z motor is an independent [stepper_zN] section. The same G1 Z+1 or G28 Z is broadcast to all motors with is_active_axis('z'). As long as one of them has a reversed dir_pin polarity, that one will move in the opposite direction, manifesting as:
| Phenomenon | Direct consequence |
|---|---|
A "clunk" and jamming during homing, followed by Homemoved too far or Lost communication | One Z moves down while the others move up, jamming directly within the travel range. |
Z_TILT_ADJUST / QUAD_GANTRY_LEVEL becomes more and more skewed with each adjustment | The correction direction acts on the wrong motor, and the fit does not converge. |
Too many retries reported when QGL completes | The same phenomenon; the gantry cannot be leveled when the directions are inconsistent. |
Z coordinates do not match the actual height after G28 Z | After one is reversed, position_endstop will home to the wrong mechanical zero point. |
Diagnosis and Fix
Diagnosis method (VORON official installation guide):
- First manually push the gantry/platform to the middle of its travel to avoid directly hitting the endstops during homing.
- Send
STEPPER_BUZZ STEPPER=stepper_z{,1,2,3}one at a time, allowing only one motor to reciprocate, and observe the rise and fall of the corresponding corner. - If the direction is reversed, go back to your configured
[stepper_zN]section and add or remove!beforedir_pin; then runFIRMWARE_RESTARTagain and verify. - Once all are moving in the same direction, execute
G28 Zand confirm thatposition_endstopmatches the mechanical zero point.
Powering on for the first time and directly running G28 Z may bend the gantry, lead screws, or belts within seconds. After any new build, new wiring, or driver replacement, always run STEPPER_BUZZ on each motor first.
Relationship with Leveling Methods
| Number of Z | Common Models | Corresponding Leveling |
|---|---|---|
| 2 Z | CoreXY dual Z, some i3 | [z_tilt] or [bed_screws] |
| 3 Z | VORON Trident | [z_tilt] |
| 4 Z | VORON 2.4 | [quad_gantry_level] |
Different leveling methods do not cause "up-down conflicts"; conflicts only arise from motor direction. After confirming the same direction, choose between [z_tilt] and [quad_gantry_level].
Three Z / Four Z Reference Configuration
Three Z and Four Z simply add one more [stepper_zN] section compared to Dual Z, and the configuration is exactly the same as Dual Z: the main [stepper_z] carries the endstop_pin, and the additional motors do not repeat the endstop. When using [z_tilt]/[quad_gantry_level], the steppers option is required and must list all Z motor names (see the next section).
[stepper_z]
step_pin: <z_step_pin>
dir_pin: <z_dir_pin> # Verify each one after installation; add/remove ! if reversed
enable_pin: !<z_enable_pin>
rotation_distance: 4
full_steps_per_rotation: 200
microsteps: 16
endstop_pin: probe:z_virtual_endstop
position_max: 300
homing_speed: 10
[stepper_z1]
step_pin: <z1_step_pin>
dir_pin: <z1_dir_pin> # Moves up/down in the same direction as stepper_z; verify on the machine
enable_pin: !<z1_enable_pin>
rotation_distance: 4
full_steps_per_rotation: 200
microsteps: 16
[stepper_z2]
step_pin: <z2_step_pin>
dir_pin: <z2_dir_pin>
enable_pin: !<z2_enable_pin>
rotation_distance: 4
full_steps_per_rotation: 200
microsteps: 16
[stepper_z3]
step_pin: <z3_step_pin>
dir_pin: <z3_dir_pin>
enable_pin: !<z3_enable_pin>
rotation_distance: 4
full_steps_per_rotation: 200
microsteps: 16
[quad_gantry_level]
steppers: stepper_z, stepper_z1, stepper_z2, stepper_z3
gantry_corners: 40, 40; 220, 220
points:
40, 40
40, 220
220, 220
220, 40
speed: 50
horizontal_move_z: 10
retries: 5
retry_tolerance: 0.0075
Delete [stepper_z3] from the Four Z section above and replace [quad_gantry_level] with [z_tilt]: steppers: stepper_z, stepper_z1, stepper_z2; list 3 points in z_positions and points according to the machine dimensions.