SKR Pro + TMC 2209 UART

Still struggling with my setup for the Hypercube…
As mentionned in the SKR Pro manual, I have shorten the stallguard pin on the steppers, now I am struggling with the printer.cfg… The only things working are the fans, the heaters and the webcam…No way to move the steppers in any direction…

Help appreciated!

#This is the printer.cfg file for my Hypercube Evolution
#Bed Size 300x300x350
#TMC 2209 steppers in UART mode
#Stallguard pin removed
#SKR Pro V 1.1

Klipper/Moonraker/Mainsail installed with KIAUH script on Raspberry Pi 4

#Yann Vautrin 2022

[stepper_x]
step_pin: PE9
dir_pin: PF1
enable_pin: !PF2
microsteps: 16
rotation_distance: 40
endstop_pin: PB10
position_endstop: 0
position_max: 200
homing_speed: 50

[tmc2209 stepper_x]
uart_pin: PC13
run_current: 0.8
hold_current: 0.5
stealthchop_threshold: 80
diag_pin: PB10

[stepper_y]
step_pin: PE11
dir_pin: PE8
enable_pin: !PD7
microsteps: 16
rotation_distance: 40
endstop_pin: PE12
position_endstop: 0
position_max: 200
homing_speed: 50

[tmc2209 stepper_y]
uart_pin: PE3
interpolate: True
run_current: 0.8
hold_current: 0.5
stealthchop_threshold: 80
diag_pin: PE12

[stepper_z]
step_pin: PE13
dir_pin: PC2
enable_pin: !PC0
microsteps: 16
rotation_distance: 8
endstop_pin: PG8
position_endstop: 0.5
position_max: 200

[tmc2209 stepper_z]
uart_pin: PE1
run_current: 0.8
hold_current: 0.5
stealthchop_threshold: 30
diag_pin: PG8

[extruder]
step_pin: PE14
dir_pin: PA0
enable_pin: !PC3
microsteps: 16
rotation_distance: 33.500
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PB1
sensor_pin: PF4
sensor_type: EPCOS 100K B57560G104F
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 170

[tmc2209 extruder]
uart_pin: PD1
run_current: 0.8
stealthchop_threshold: 5
diag_pin: PE15

[heater_bed]
heater_pin: PD12
sensor_pin: PF3 # T0
sensor_type: ATC Semitec 104GT-2
control: watermark
min_temp: 0
max_temp: 130

[fan]
pin: PC8

[heater_fan fan1]
pin: PE5

#[heater_fan fan2]
#pin: PE6

[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_2E00290003504D4E48333620-if00

[printer]
kinematics: corexy
max_velocity: 300
max_accel: 3000
max_z_velocity: 25
max_z_accel: 30

[virtual_sdcard]
path: ~/gcode_files

[display_status]

[pause_resume]

[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
gcode:
PAUSE_BASE
_TOOLHEAD_PARK_PAUSE_CANCEL

[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
gcode:

read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro

{% set extrude = printer[‘gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL’].extrude %}

get VELOCITY parameter if specified

{% if ‘VELOCITY’ in params|upper %}
{% set get_params = (‘VELOCITY=’ + params.VELOCITY) %}
{%else %}
{% set get_params = “” %}
{% endif %}

end of definitions

{% if printer.extruder.can_extrude|lower == ‘true’ %}
M83
G1 E{extrude} F2100
{% if printer.gcode_move.absolute_extrude |lower == ‘true’ %} M82 {% endif %}
{% else %}
{action_respond_info(“Extruder not hot enough”)}
{% endif %}
RESUME_BASE {get_params}

[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
variable_park: True
gcode:

Move head and retract only if not already in the pause state and park set to true

{% if printer.pause_resume.is_paused|lower == ‘false’ and park|lower == ‘true’%}
_TOOLHEAD_PARK_PAUSE_CANCEL
{% endif %}
TURN_OFF_HEATERS
CANCEL_PRINT_BASE

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description: Helper: park toolhead used in PAUSE and CANCEL_PRINT
variable_extrude: 1.0
gcode:

set park positon for x and y

default is your max posion from your printer.cfg

{% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
{% set z_park_delta = 2.0 %}

calculate save lift position

{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - z_park_delta) %}
{% set z_safe = z_park_delta %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}

end of definitions

{% if printer.extruder.can_extrude|lower == ‘true’ %}
M83
G1 E-{extrude} F2100
{% if printer.gcode_move.absolute_extrude |lower == ‘true’ %} M82 {% endif %}
{% else %}
{action_respond_info(“Extruder not hot enough”)}
{% endif %}
{% if “xyz” in printer.toolhead.homed_axes %}
G91
G1 Z{z_safe} F900
G90
G1 X{x_park} Y{y_park} F6000
{% if printer.gcode_move.absolute_coordinates|lower == ‘false’ %} G91 {% endif %}
{% else %}
{action_respond_info(“Printer not homed”)}
{% endif %}

This section misses this line:

You also may set the pullup resistor for the diag_pin, a driver_SGTHRS value and the other parameters as described here

https://www.klipper3d.org/TMC_Drivers.html

1 Like

Thanks for that! I did some changes in the printer.cfg, and now I have X and Y working smoothly!
But when I try to move or Home Z… I got this error message:

Unable to read tmc uart ‘stepper_z’ register IFCNT
Once the underlying issue is corrected, use the
“FIRMWARE_RESTART” command to reset the firmware, reload the
config, and restart the host software.
Printer is shutdown

Here is the new printer.cfg:

#This is the printer.cfg file for my Hypercube Evolution
#Bed Size 300x300x350
#TMC 2209 steppers in UART mode
#SKR Pro V 1.1
#Klipper/Moonraker/Mainsail installed with KIAUH script on Raspberry Pi 4
#Yann Vautrin 2022

[stepper_x]
step_pin: PE9
dir_pin: PF1
enable_pin: !PF2
microsteps: 16
rotation_distance: 40
endstop_pin: tmc2209_stepper_x:virtual_endstop
homing_retract_dist: 0
position_endstop: 0
position_max: 200
homing_speed: 50

[tmc2209 stepper_x]
uart_pin: PC13
interpolate: True
run_current: 0.8
hold_current: 0.5
stealthchop_threshold: 80
diag_pin: ^PB10 # Set to MCU pin connected to TMC DIAG pin
driver_SGTHRS: 255 # 255 is most sensitive value, 0 is least sensitive

[stepper_y]
step_pin: PE11
dir_pin: PE8
enable_pin: !PD7
microsteps: 16
rotation_distance: 40
endstop_pin: tmc2209_stepper_y:virtual_endstop
homing_retract_dist: 0
position_endstop: 0
position_max: 200
homing_speed: 50

[tmc2209 stepper_y]
uart_pin: PE3
interpolate: True
run_current: 0.8
hold_current: 0.5
stealthchop_threshold: 80
diag_pin: ^PE12 # Set to MCU pin connected to TMC DIAG pin
driver_SGTHRS: 255 # 255 is most sensitive value, 0 is least sensitive

[stepper_z]
step_pin: PE13
dir_pin: PC2
enable_pin: !PC0
microsteps: 16
rotation_distance: 8
endstop_pin: PG8
position_endstop: 0.5
position_max: 200

[tmc2209 stepper_z]
uart_pin: PE1
interpolate: True
run_current: 0.8
hold_current: 0.5
stealthchop_threshold: 30
diag_pin: ^PG8 # Set to MCU pin connected to TMC DIAG pin
driver_SGTHRS: 255 # 255 is most sensitive value, 0 is least sensitive

[extruder]
step_pin: PE14
dir_pin: PA0
enable_pin: !PC3
microsteps: 16
rotation_distance: 33.500
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PB1
sensor_pin: PF4
sensor_type: EPCOS 100K B57560G104F
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 170

[tmc2209 extruder]
uart_pin: PD1
run_current: 0.8
stealthchop_threshold: 5
diag_pin: ^E15 # Set to MCU pin connected to TMC DIAG pin
driver_SGTHRS: 255 # 255 is most sensitive value, 0 is least sensitive

[heater_bed]
heater_pin: PD12
sensor_pin: PF3 # T0
sensor_type: ATC Semitec 104GT-2
control: watermark
min_temp: 0
max_temp: 130

[fan]
pin: PC8

[heater_fan fan1]
pin: PE5

#[heater_fan fan2]
#pin: PE6

[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_2E00290003504D4E48333620-if00

[printer]
kinematics: corexy
max_velocity: 300
max_accel: 3000
max_z_velocity: 25
max_z_accel: 30

[virtual_sdcard]
path: ~/gcode_files

[display_status]

[pause_resume]

[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
gcode:
PAUSE_BASE
_TOOLHEAD_PARK_PAUSE_CANCEL

[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
gcode:

read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro

{% set extrude = printer[‘gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL’].extrude %}

get VELOCITY parameter if specified

{% if ‘VELOCITY’ in params|upper %}
{% set get_params = (‘VELOCITY=’ + params.VELOCITY) %}
{%else %}
{% set get_params = “” %}
{% endif %}

end of definitions

{% if printer.extruder.can_extrude|lower == ‘true’ %}
M83
G1 E{extrude} F2100
{% if printer.gcode_move.absolute_extrude |lower == ‘true’ %} M82 {% endif %}
{% else %}
{action_respond_info(“Extruder not hot enough”)}
{% endif %}
RESUME_BASE {get_params}

[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
variable_park: True
gcode:

Move head and retract only if not already in the pause state and park set to true

{% if printer.pause_resume.is_paused|lower == ‘false’ and park|lower == ‘true’%}
_TOOLHEAD_PARK_PAUSE_CANCEL
{% endif %}
TURN_OFF_HEATERS
CANCEL_PRINT_BASE

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description: Helper: park toolhead used in PAUSE and CANCEL_PRINT
variable_extrude: 1.0
gcode:

set park positon for x and y

default is your max posion from your printer.cfg

{% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
{% set z_park_delta = 2.0 %}

calculate save lift position

{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - z_park_delta) %}
{% set z_safe = z_park_delta %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}

end of definitions

{% if printer.extruder.can_extrude|lower == ‘true’ %}
M83
G1 E-{extrude} F2100
{% if printer.gcode_move.absolute_extrude |lower == ‘true’ %} M82 {% endif %}
{% else %}
{action_respond_info(“Extruder not hot enough”)}
{% endif %}
{% if “xyz” in printer.toolhead.homed_axes %}
G91
G1 Z{z_safe} F900
G90
G1 X{x_park} Y{y_park} F6000
{% if printer.gcode_move.absolute_coordinates|lower == ‘false’ %} G91 {% endif %}
{% else %}
{action_respond_info(“Printer not homed”)}
{% endif %}

If you have a regular endstop (at PG8) for the Z-axes, you don’t need the sensorless homing stuff for that axes. (diag_pin and driver_SGTHRS)

The same is for the extruder, as there is no endstop at all.

You have to undo the stallguard short as well.

1 Like

stallguard short was already removed, I did the following modification to Z and extr.

I just removed all the physical/optical endstops

But Z still doesn’t move… when trying to home, I got a warning sign in the coordinates box, and it reads “Z 300.000”…

PS: I am on a double Z if it changes something…

You can type M119 into the command line and you will get the status of the endstops.
This will show if the endstops are open or closed.
You may have to invert the endstop input pin of the Z-axes by putting a ! in front of the pin name e.g.: !PG8

1 Like

New part for the Z stepper:

[stepper_z]
step_pin: PE13
dir_pin: PC2
enable_pin: !PC0
microsteps: 16
rotation_distance: 8
endstop_pin: !PG8
position_endstop: 0
position_max: 200
homing_speed: 10

[tmc2209 stepper_z]
uart_pin: PE1
interpolate: True
run_current: 0.8
hold_current: 0.5
stealthchop_threshold: 30
diag_pin: ^PG8      # Set to MCU pin connected to TMC DIAG pin
driver_SGTHRS: 100  # 255 is most sensitive value, 0 is least sensitive

M119 :

17:27:20
x:open y:open z:open

Now, when Homing Z…Shutdown…
Error message:

Unable to read tmc uart ‘stepper_z’ register IFCNT

and the hotend fan starts and run full power… :woozy_face:

You have this:

and this:

You may delete the last two lines in [tmc2209 stepper_z]

The full power hotend fan is a safety feature that kicks in when in emergency mode, like an error.

1 Like

printer.cfg modified as this:

[stepper_z]
step_pin: PE13
dir_pin: PC2
enable_pin: !PC0
microsteps: 16
rotation_distance: 8
endstop_pin: !PG8
position_endstop: 0
position_max: 200
homing_speed: 10

[tmc2209 stepper_z]
uart_pin: PE1
interpolate: True
run_current: 0.8
hold_current: 0.5
stealthchop_threshold: 30

Still not movement on Z…and same error message…

PS: Thanks a lot for you time and help! :raised_hands:

Are these steppers on small boards?
If yes, you may swap that one for Z with the extruder stepper.
Also check the cables.

Be sure you turned of the printer before. And maybe also the USB because of backpowering from the Pi.

I swapped the X and Y steppers with the Z’s, now Z is working but no X nor Y…

they are the TMC2209 V1.2 from BTT, on small boards, I can see a smell potentiometer on the top right of each of them… any adjustments are required… or are they just dead? (They are straight out of the box!)…

If X/Y work on the Z axes and the former Z stepper do not work on the X/Y axes, then you can assume that the steppers are broken. - Sorry -

The potentiometers are for setting the motor current when in stand alone mode

:woozy_face:
Thanks a lot, will get some new steppers then…