Sensorless Homing appears to be broken on TMC2209's

Basic Information:

Printer Model: Adventurer 3 (Heavily Customised)
MCU / Printerboard: BTT SKR Mini E3 v3
klippy.log
klippy.log (1.9 MB)

Describe your issue:

I’ve been trying to get this working consistently for days - the first time I home it works, the next time I try it the X/Y axis go in the wrong direction and I get a print-head crash.

I’ve implemented the recommended macros + homing overrides and am still having no luck. :cry:

Here is the printer in action:

[homing_override]
set_position_z = 5
gcode = 
	G0 Z7
	G28 X0 Y0
	G0 X110 Y67
	G28 Z0

Your homing override doesn’t contain any macros.

Ah good point - I had been pointing to these:

    HOME_X
    HOME_Y
    HOME_Z

but have tried so many things I prolly lost myself.

A couple of things jump out at me:

  1. Your homing_speed (100 for x, 75 for y) is high. I normally run them at around 25 (mm/s)
  2. You driver_sgthrs values are pretty high (which means they can be overly sensitive), especially since you are running with 0.8A run_current. I’ve set up StallGuard on four printers now and I’ve never needed a value above 75 for driver_sgthrs.

How did you come up with your sensorless homing values?

I think your problem is that the threshold values (driver_sgthrs) are so sensitive that the subsequent homing operating gets a false sense and causes the toolhead to move to the right, causing the head crash and buzzing.

Could you:

  1. Reduce your run_current when homing to 0.5A.
  2. Reduce your homing_speed to 25.
  3. Set your driver_sgthrs to 64.

Once you’ve done that, test the sensorless homing for the X & Y axis separately and determine the best driver_sgthrs by running the axis homing twice until it works reliably both times. If it crashes when reaching 0, add 10 to the value, if it detects it properly, then reduce the value by 10. When you’re close, change the difference value to 5 until you’re satisfied.

Good luck!

1 Like

Thank you for the info - i’ll give your suggestions a try - I’m new to sensorless homing and there dont seem to be any good guides on it.

The official docs have an extensive guide on how to configure sensorless homing in Klipper.

https://www.klipper3d.org/TMC_Drivers.html#sensorless-homing

That’s what I followed - most klipper guides are great, this one imo is not as helpful.

I’m still haviong issues with the Homing going the wrong direction:

[homing_override]
set_position_z: 5
gcode:
    HOME_X
    HOME_Y
    G1 X110 Y67
    G28 Z0
[gcode_macro HOME_X]
gcode:
    {% set HOME_CUR = 0.500 %}
    {% set driver_config = printer.configfile.settings['tmc2209 stepper_x'] %}
    {% set RUN_CUR = driver_config.run_current %}
    # Set current for sensorless homing
    SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR}
    # Pause to ensure driver stall flag is clear
    G4 P2000
    # Home
    G28 X0
    # Move away
    G28
    G1 X5 F1200
    # Set current during print
    SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CUR}

[gcode_macro HOME_Y]
gcode:
    {% set HOME_CUR = 0.500 %}
    {% set driver_config = printer.configfile.settings['tmc2209 stepper_y'] %}
    {% set RUN_CUR = driver_config.run_current %}
    # Set current for sensorless homing
    SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR}
    # Pause to ensure driver stall flag is clear
    G4 P2000
    # Home
    G28 Y0
    # Move away
    G90
    G1 X5 F1200
    # Set current during print
    SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CUR}

and I have no idea why.

I’ve tried lower values in the past without luck. This at least works sometimes.

I just watched your video, and it’s not doing what you described. What’s happening the second time you home is the diag pin is triggering instantly for both X and Y, and the printer is then trying to move to the middle of the bed to home Z. It looks to me like you need to slow down both X and Y, and better tune the sgthrs values so they’re not overly sensitive.

2 Likes

OK, I think Im getting somewhere after lowering homing speeds to 25 and dropping driver_sgthrs to 64 - Im still finding the “Homing override” confusing, tho as it seems to ignore my Move X/Y command and tries to Home Z at X0/Y0.

[homing_override]
set_position_z: 5
gcode:
    HOME_X
    HOME_Y
    #Home Z
    G1 X110 Y67 F1500
    G28 Z

You would need to provide a new log file in order for me to offer any other help.

1 Like

Thanks for taking a look, here are my latest logs:

klippy.log (5.3 MB)

[gcode_macro HOME_X]
gcode = 
	{% set HOME_CUR = 0.500 %}
	{% set driver_config = printer.configfile.settings['tmc2209 stepper_x'] %}
	{% set RUN_CUR = driver_config.run_current %}
	
	SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR}
	
	G4 P2000
	
	G28 X0
	
	G28
	G1 X5 F1500

You’re homing X in this macro, then telling it to home everything. Remove the G28 from this macro.

[gcode_macro HOME_Y]
gcode = 
	{% set HOME_CUR = 0.500 %}
	{% set driver_config = printer.configfile.settings['tmc2209 stepper_y'] %}
	{% set RUN_CUR = driver_config.run_current %}
	
	SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR}
	
	G4 P2000
	
	G28 Y0
	
	G90
	G1 X5 F1500

You also need to fix this macro. It should move to Y5, not X5 at the end.

1 Like

Thanks, some dumb mistakes there - I really should not try to configure something new when Im tired. :man_facepalming:

Thank you both (@jakep_82 @mykepredko ) for your help - it’s now working consistently! :pray:

I also made a tweak to my homing override macro to raise the Z gantry before homing:

[homing_override]
set_position_z: 5
gcode:
    G1 Z+25 F1000
    HOME_X
    HOME_Y
    #Home Z
    G1 X110 Y67 F1500
    G28 Z
    G1 Z+25 F1000
1 Like

It lives! :sunglasses:

1 Like

Great job.

I look forward to see what you come up with.

1 Like

Cheers, My entire Klipper config and custom PCB’s are now in my GitHub Repo.

However, I haven’t gotten around to publishing my printed parts yet.

Edit: I’m out of replies for the day:

Cool. Keep us updated as to your progress.

1 Like

Will do. I think I have everything working now and it’s currently printing a new custom StealthBurner mount in ASA for my main printer.

Oh and the Califlower I printed turned out quite well considering I’ve done Zero tuning in SuperSlicer for this printer.

1 Like