Problem with Z_TILT

Hello,

I recently introduced a fourth z axis to my printer (prior it had 3).
After adding the fourth z to my printer.cfg and z_tilt section the Z_TILT_ADJUST macro is acting up.
The z position just is not being corrected. It keeps staying at around the same value (0.4) and stops after the retry counter/slight increase.

I already checked the wiring multiple times and the motors seem to be connected in the correct order according to the z_positions in z_tilt.

For z I use a Voron style endstop and an euclid probe.

The original Z_TILT_ADJUST macro is reconfigured to deploy and stow the euclid probe.

In the previous setup with 3 z axes the Z_TILT_ADJUST macro worked fine.
Right now I am stuck.

My current setup:

#Pins
[board_pins octopus_pro_446_tmc2209]
aliases:
# steppers
  x_step_pin=PF13,   x_dir_pin=PF12,   x_enable_pin=PF14,   x_uart_pin=PC4,   x_diag_pin=PG6,   x_endstop_pin=PG6,
  y_step_pin=PG0,   y_dir_pin=PG1,   y_enable_pin=PF15,   y_uart_pin=PD11,   y_diag_pin=PG9,   y_endstop_pin=PG9,
  z0_step_pin=PC13,  z0_dir_pin=PF0,  z0_enable_pin=PF1,  z0_uart_pin=PE4,  z0_diag_pin=null,
  z1_step_pin=PE2,  z1_dir_pin=PE3,  z1_enable_pin=PD4,  z1_uart_pin=PE1,  z1_diag_pin=null,
  z2_step_pin=PE6,  z2_dir_pin=PA14,  z2_enable_pin=PE0,  z2_uart_pin=PD3,  z2_diag_pin=null,
  z3_step_pin=PF9,  z3_dir_pin=PF10,  z3_enable_pin=PG2,  z3_uart_pin=PF2,  z3_diag_pin=null,
  e_step_pin=PF11,   e_dir_pin=PG3,   e_enable_pin=PG5,   e_uart_pin=PC6,   e_diag_pin=null,   e_heater_pin=PA2,  e_sensor_pin=PF4,
  stepper_spi_mosi_pin=PA7,  stepper_spi_miso_pin=PA6,  stepper_spi_sclk_pin=PA5,

#Stepper
[stepper_z]
step_pin: z0_step_pin
enable_pin: !z0_enable_pin
microsteps: 64
position_min: -5
dir_pin: !z0_dir_pin
rotation_distance: 4
position_endstop: 0.0
endstop_pin: PG10
homing_speed: 10
position_max: 380

[stepper_z1]
step_pin: z1_step_pin
enable_pin: !z1_enable_pin
microsteps: 64
dir_pin: !z1_dir_pin 
rotation_distance: 4

[stepper_z2]
step_pin: z2_step_pin
enable_pin: !z2_enable_pin
microsteps: 64
dir_pin: !z2_dir_pin
rotation_distance: 4

[stepper_z3]
step_pin: z3_step_pin
enable_pin: !z3_enable_pin
microsteps: 64
dir_pin: !z3_dir_pin 
rotation_distance: 4

#Probe
[probe]
pin: PC5
z_offset: 5.396
x_offset: -1
y_offset: 68
speed: 8
lift_speed: 30
samples: 3
samples_result: average
sample_retract_dist: 5.0
samples_tolerance: 0.0075
samples_tolerance_retries: 5

#Z-tilt
[z_tilt]
z_positions:
  -57,-20   #Z0
  -57,418  #Z1
  437,-20  #Z2
  437,418 #Z3

points:
  62,0
  62,267
  331,267
  331,0
		
horizontal_move_z: 12
retries: 10
retry_tolerance: 0.01
speed: 500

euclid.cfg:

[gcode_macro M401]
gcode:
   G90
   {action_respond_info("Entering M401")}
   error_if_probe_deployed    ; check to make sure that the probe is not already attached
   _M401
[gcode_macro error_if_probe_deployed]
gcode:
   QUERY_PROBE                 ; check probe status
   do_error_if_probe_deployed  ; logic check to verify probe is not already deployed
[gcode_macro do_error_if_probe_deployed]
gcode:
   {% if not printer.probe.last_query %}
     {action_raise_error("Euclid Probe is already deployed - Remove and Return it to the dock")}
   {% endif %}
# Macro to Deploy Bed Probe
[gcode_macro _M401]
gcode:
   G90
   {% if printer.probe.last_query %} 
     G0 Z15 F3000         ;  set approach elevation of Z15 to clear probe over bed on fixed gantry machine
     #                       for moving gantry machine this may need to be adjusted
     #G0 X190 Y365           ;  move the carraige to safe position to move from. this is the pre-flight position
     G0 X336 Y426         ;  move to the side of the dock. this is the dock side position
     G4 P250              ;  wait 1/4 second 
     G0 X375 Y426         ;  move sideways over the dock to pick up probe. this is the dock position
     M400                 ;  wait for moves to finish
     G4 P250              ;  pause 1/4 sec for detection
     G0 X336 Y426 F500    ;  move out of the dock in a straight line to the dock exit poistion
     G0 Z15               ;  move up to clear the probe over the bed of moving gantry or provide clearance for fixed gantry
     #G0 X190 Y195         ;  move probe to center of bed in ready position 
   {% endif %}
   error_if_probe_not_deployed
   {action_respond_info("Exiting M401")}
[gcode_macro error_if_probe_not_deployed]
gcode:
   QUERY_PROBE
   do_error_if_probe_not_deployed
[gcode_macro do_error_if_probe_not_deployed]
gcode:
   {% if printer.probe.last_query %}
     {action_raise_error("Euclid Probe failed to deploy!")}
   {% endif %}
# Macro to retract Bed Probe
[gcode_macro M402]
gcode:
   G90
   {action_respond_info("Entering M402")}
   error_if_probe_not_deployed
   _M402
# Macro to Stow Bed Leveling Probe
[gcode_macro _M402]
gcode:
   G90
   {% if not printer.probe.last_query %} ; the logic on this needs function check
     G0 Z15 F2400                  ;  set approach elevation of Z15 for fixed gantry system to clear probe over bed
     #                             ;  for moving gantry system this may have to be altered to match your dock elevation
     #G0 X150 Y150 F3000            ;  start movements at center of the bed 
     G0 X336 Y350 F3000            ;  move to the re-entry staging position
     G0 X336 Y426 F3000            ;  move to a position in front of the dock so a simple linear movement into dock 
     G0 X375 Y426 F240             ;  slowly move into dock 
     M400                          ;  wait for moves to finish
     G4 P250                       ;  forced pause here so motion is definite 90 tavel to swipe
     G0 X375 Y365 F6000            ;  quick swipe off 
     #G0 X180 Y0                    ;  move to front center of bed 
     G0 Z20 F500                   ;  move up to elevation of Z20
   {% endif %}                     ;  exit the if-then loop. was missing in previous versions
   error_if_probe_deployed         ;  verify that the probe is detached. is corrected error  
   {action_respond_info("Exiting M402")}
   
# Macro to perform a bed mesh calibration by wrapping it between M401/M402 macros
[gcode_macro BED_MESH_CALIBRATE]
rename_existing:    BED_MESH_CALIBRATE_ORIGINAL
gcode:
  M401                           ; deploy Euclid Probe if needed
  BED_MESH_CALIBRATE_ORIGINAL    ; check bed level
  M402                           ; dock Euclid Probe


#  uncomment one of the following macros if necessary for your printer:
#  Z_TILT_ADJUST is for [z_tilt] config
#  QUAD_GANTRY_LEVEL is for [quad_gantry_level] config
# whitespace matters in the macros, klipper is python based
# watch your indents and spaces

[gcode_macro Z_TILT_ADJUST]
description: modified Z_TILT_ADJUST, wrapped with DEPLOY_PROBE/STOW_PROBE
rename_existing: Z_TILT_ADJUST_ORIGINAL
gcode:
#  DEPLOY_PROBE
  M401
  Z_TILT_ADJUST_ORIGINAL
  M402
#  STOW_PROBE


# Macro to perform a modified z_tilt/gantry level by wrapping it between M401/M402 macros
# [gcode_macro QUAD_GANTRY_LEVEL]
# rename_existing:    QUAD_GANTRY_LEVEL_ORIGINAL
# gcode:
#    M401                           ; deploy Euclid Probe if needed
#    QUAD_GANTRY_LEVEL_ORIGINAL         ; check bed level
#    M402                           ; dock Euclid Probe

# Macro to perform a Z_Tilt/gantry level and bed mesh calibration by wrapping both between M401/M402 macros
[gcode_macro HOME_LVL_MESH]
gcode: SET_KINEMATIC_POSITION Z=0
  G0 Z15 F500           ; raise bed to 15
  G28 X Y               ; home Y & Y
  M401                  ; deploy Euclid Probe
  G0 X150 Y150 F6000    ; move to center of be @ X150 Y150
  G28 Z                 ; home Z
# Uncomment the one needed for your printer      
#    QUAD_GANTRY_LEVEL_ORIGINAL
#    Z_TILT_ADJUST_ORIGINAL
#    G28 Z                 ; home Z
#    BED_MESH_CALIBRATE_ORIGINAL
#    G0 Z15 F500           ; raise bed to 15
#    M402                  ; retract Euclid Probe

Stepper position:

Connections:
Z0 - Driver 5
Z1 - Driver 6
Z2 - Driver 7
Z3 - Driver 4

My reproduction is:

  • Turn on printer
  • Home all axes
  • Z-tilt

Klippy.log:
klippy.log (157.4 KB)

What am I doing wrong/missing?

Thanks

I was not able to post more links/images :slight_smile:

BTT Octopus Pro Pinout:
image

Voron Z endstop I was talking about:

I think you use the wrong method. You should use quad gantry level method. I got a voron and this is working perfect with klicky probe…
https://www.klipper3d.org/Config_Reference.html#quad_gantry_level

1 Like

Thanks, one thing I should have mentioned is that I am using a moving bed, where apparently quad_gantry_level can lead to ‘undesirable results’.

The master config for z_tilt suggests that 4 z steppers should be possible:

Ok, nevermind I just tried quad_gantry_level and it seems to be working fine on a moving bed :slight_smile: .

Thank you!