Sensorless Homing on BTT Octopus Pro v1.1 H723 + Fly TMC5160 Pro v1.5

Basic Information:

Printer Model: Hybrid VzBot / RatRig
MCU / Printerboard: BTT Octopus Pro v1.1 H723
Host / SBC : Laptop with i7-1165G7 and 12GB ram
klippy.log (4.4 MB)

Describe your issue:

Hello there, I am trying to make the sensorless homing work on my custom printer and it is giving me a lot of headaches. I am using the Mellow Fly TMC5160 Pro v1.5 for my X/Y axes that, just to give you context, are the ones with the “external pcb” linked to the usual driver header through a couple of ribbon cables. Leaving the documentation link here

The problem is that this sensorless homing is nowhere near to work at all: I always get my printhead crashing on the frame, both on X and Y, even changing the sensitivity to -64 (which should be supposed to be the most sensitive). What I have tried until now:

  • Jumpered the diag pins to the sensor pins, as explained in the Octopus’ user guide
  • set the virtual endstop for both X and Y axes (X1 uses the same endstop pin as X and Y1 the same as Y, since it is an AWD machine)
  • double checked the diag line used by the drivers was the 0 and not the 1
  • set sensitivity to -64

The following is my steppers configuration:

[include Steppers_autotune.cfg]

########################
# Stepper X
########################

[stepper_x]
step_pin: PF13
dir_pin: !PF12
enable_pin: !PF14
rotation_distance: 40
microsteps: 64
full_steps_per_rotation: 200
endstop_pin: tmc5160_stepper_x:virtual_endstop
position_endstop: 0
position_min: 0
position_max: 530
homing_speed: 20
homing_retract_dist: 0

[tmc5160 stepper_x]
#spi_speed: 3500000
cs_pin: PC4
interpolate: false
run_current: 1.9
sense_resistor: 0.033
spi_software_mosi_pin: PA7
spi_software_miso_pin: PA6
spi_software_sclk_pin: PA5
diag0_pin: ^!PG6
driver_SGT: 1 
#driver_DISS2G: 1
#driver_DISS2VS: 1

########################
# Stepper X1
########################

[stepper_x1]
step_pin: PE6
dir_pin: !PA14
enable_pin: !PE0
rotation_distance: 40
microsteps: 64
full_steps_per_rotation: 200
endstop_pin: tmc5160_stepper_x:virtual_endstop

[tmc5160 stepper_x1]
#spi_speed: 3500000
cs_pin: PD3
interpolate: false
run_current: 1.9
sense_resistor: 0.033
spi_software_mosi_pin: PA7
spi_software_miso_pin: PA6
spi_software_sclk_pin: PA5
#driver_DISS2G: 1
#driver_DISS2VS: 1

########################
# Stepper Y
########################

[stepper_y]
step_pin: PC13
dir_pin: !PF0
enable_pin: !PF1
rotation_distance: 40
microsteps: 64
full_steps_per_rotation: 200
position_endstop: 0
position_min: 0
position_max: 530
homing_speed: 20
homing_retract_dist: 0
endstop_pin: tmc5160_stepper_y:virtual_endstop

[tmc5160 stepper_y]
#spi_speed: 3500000
cs_pin: PE4
interpolate: false
run_current: 1.9
sense_resistor: 0.033
spi_software_mosi_pin: PA7
spi_software_miso_pin: PA6
spi_software_sclk_pin: PA5
diag0_pin: ^!PG13
driver_SGT: 1 
#driver_DISS2G: 1
#driver_DISS2VS: 1

########################
# Stepper y1
########################

[stepper_y1]
step_pin: PG4
dir_pin: !PC1
enable_pin: !PA0
rotation_distance: 40
microsteps: 64
full_steps_per_rotation: 200
endstop_pin: tmc5160_stepper_y:virtual_endstop


[tmc5160 stepper_y1]
#spi_speed: 3500000
cs_pin: PC7
interpolate: false
run_current: 1.9
sense_resistor: 0.033
spi_software_mosi_pin: PA7
spi_software_miso_pin: PA6
spi_software_sclk_pin: PA5
#driver_DISS2G: 1
#driver_DISS2VS: 1

########################
# Stepper Z
########################

[stepper_z] #> RIGHT
endstop_pin: probe:z_virtual_endstop
#endstop_pin: PG10
step_pin: PF11
dir_pin: !PG3
enable_pin: !PG5
rotation_distance: 8 # 4 for TR8*4 lead screws.
microsteps: 64
position_min: -5 # Needed for z-offset calibration and tilt_adjust.
position_max: 605
homing_speed: 20 # Default: 10
homing_positive_dir: false

[tmc2209 stepper_z]
uart_pin: PC6
run_current: 1.2
hold_current: 0.5
#driver_TBL: 2
#driver_TOFF: 2
#driver_HEND: 0
#driver_HSTRT: 6
interpolate: True

########################
# Stepper Z1
########################

[stepper_z1] #> BACK
endstop_pin: probe:z_virtual_endstop
#endstop_pin: PG10
step_pin: PE2
dir_pin: !PE3
enable_pin: !PD4
rotation_distance: 8 # 4 for TR8*4 lead screws.
microsteps: 64

[tmc2209 stepper_z1]
uart_pin: PE1
run_current: 1.2
hold_current: 0.5
#driver_TBL: 2
#driver_TOFF: 2
#driver_HEND: 0
#driver_HSTRT: 6
interpolate: True

########################
# Stepper Z2
########################

[stepper_z2] #> LEFT
endstop_pin: probe:z_virtual_endstop
#endstop_pin: PG10
step_pin: PF9
dir_pin: !PF10
enable_pin: !PG2
rotation_distance: 8 # 4 for TR8*4 lead screws.
microsteps: 64

[tmc2209 stepper_z2]
uart_pin: PF2
run_current: 1.2
hold_current: 0.5
#driver_TBL: 2
#driver_TOFF: 2
#driver_HEND: 0
#driver_HSTRT: 6
interpolate: True

And the following is my printer.cfg, if needed:

[include mainsail.cfg]
[include timelapse.cfg]
[include Exclude_Object.cfg]
[include Start_Stop.cfg]
[include Macro.cfg]
[include Speed.cfg]
[include Steppers.cfg]
[include Toolboard.cfg]
[display_status]
[exclude_object]
[virtual_sdcard]
path: ~/printer_data/gcodes
[pause_resume]
recover_velocity: 350

# Enable arcs support for Orcaslicer
[gcode_arcs]
resolution: 0.1

########################
##### VzBoT + Octopus Pro v1.1 #####
########################

[printer]
kinematics: corexy
max_velocity: 2500
max_accel: 10000
max_z_velocity: 20
max_z_accel: 1500
square_corner_velocity: 10

########################
# MCU Configuration
########################

[mcu]
#serial: /dev/serial/by-id/usb-katapult_stm32h723xx_0C0016000C51313339373836-if00
canbus_uuid: e2c0e7336e91

[temperature_sensor octopus_mcu]
sensor_type: temperature_mcu
min_temp: 0
max_temp: 100

[mcu laptop]
serial: /tmp/klipper_host_mcu

[temperature_sensor Intel_Core_i7-1165G7]
sensor_type: temperature_host
min_temp: 0
max_temp: 100

########################
# Heater Bed
########################

[heater_bed]
heater_pin: PA1
sensor_type: Generic 3950
sensor_pin: PF3
control: pid
pid_Kp: 66.746
pid_Ki: 3.504
pid_Kd: 317.878
min_temp: -130
max_temp: 130

########################
# Fans
########################

[fan]
pin: PG9 # do not connect diag pin for motor 1 (the 2nd slot)
max_power: 0.9
cycle_time: 0.002
hardware_pwm: false
shutdown_speed: 0

[controller_fan octopus_fan]
# 4-pin computer PWM exhaust fan - FAN5
pin: !PD15
max_power: 1.0
shutdown_speed: 0.0
kick_start_time: 2.0
hardware_pwm: True
cycle_time: 0.00004  # 25 kHz

fan_speed: 1.0
idle_speed: 0.1
idle_timeout: 60

# Multiple trigger sources: the fan turns on if ANY of these is active
stepper: stepper_x, stepper_x1, stepper_y, stepper_y1, stepper_z
# RPM monitoring:
tachometer_pin: ^PB7 #connector in the corner, next to diag_pins
tachometer_ppr: 2

#[heater_fan hotend_fan]
#pin: PE5

#[heater_fan controller_fan]
#pin: PD12

########################
# Board Pins Reference
########################

[board_pins]
aliases:
    # EXP1 header
    EXP1_1=PE8, EXP1_2=PE7,
    EXP1_3=PE9, EXP1_4=PE10,
    EXP1_5=PE12, EXP1_6=PE13,
    EXP1_7=PE14, EXP1_8=PE15,
    EXP1_9=<GND>, EXP1_10=<5V>,

    # EXP2 header
    EXP2_1=PA6, EXP2_2=PA5,
    EXP2_3=PB1, EXP2_4=PA4,
    EXP2_5=PB2, EXP2_6=PA7,
    EXP2_7=PC15, EXP2_8=<RST>,
    EXP2_9=<GND>, EXP2_10=PC5

[gcode_arcs]
resolution: 1.0

[include shell_command.cfg]

[include moonraker_obico_macros.cfg]

#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [probe_eddy_current fly_eddy_probe]
#*# calibrate =
#*# 	0.050000:1424234.063,0.090000:1421936.299,0.130000:1419772.782,
#*# 	0.170000:1417540.884,0.210000:1415553.777,0.250000:1413458.689,
#*# 	0.290000:1411509.256,0.330000:1409474.496,0.370000:1407663.368,
#*# 	0.410000:1405740.362,0.450000:1403949.659,0.490000:1402166.335,
#*# 	0.530000:1400490.183,0.570000:1398863.577,0.610000:1397195.014,
#*# 	0.650000:1395676.249,0.690000:1394084.648,0.730000:1392580.419,
#*# 	0.770000:1391098.419,0.810000:1389589.155,0.850000:1388263.907,
#*# 	0.890000:1386771.945,0.930000:1385369.602,0.970000:1384070.914,
#*# 	1.010000:1382751.310,1.050000:1381433.365,1.090000:1380155.511,
#*# 	1.130000:1378922.004,1.170000:1377731.391,1.210000:1376547.886,
#*# 	1.250000:1375424.949,1.290000:1374261.659,1.330000:1373180.255,
#*# 	1.370000:1372171.320,1.410000:1371029.043,1.450000:1369934.485,
#*# 	1.490000:1369024.673,1.530000:1368034.587,1.570000:1366967.670,
#*# 	1.610000:1365958.410,1.650000:1365111.701,1.690000:1364173.281,
#*# 	1.730000:1363228.329,1.770000:1362294.842,1.810000:1361509.802,
#*# 	1.850000:1360600.939,1.890000:1359739.451,1.930000:1358842.866,
#*# 	1.970000:1358072.248,2.010000:1357265.090,2.050000:1356497.312,
#*# 	2.090000:1355712.320,2.130000:1354926.701,2.170000:1354187.290,
#*# 	2.210000:1353458.603,2.250000:1352789.015,2.290000:1352103.943,
#*# 	2.330000:1351369.035,2.370000:1350673.066,2.410000:1350018.607,
#*# 	2.450000:1349404.889,2.490000:1348804.521,2.530000:1348128.762,
#*# 	2.570000:1347475.757,2.610000:1346844.433,2.650000:1346205.912,
#*# 	2.690000:1345637.466,2.730000:1345018.068,2.770000:1344395.535,
#*# 	2.810000:1343757.083,2.850000:1343134.012,2.890000:1342545.501,
#*# 	2.930000:1341952.262,2.970000:1341349.581,3.010000:1340751.988,
#*# 	3.050000:1340150.955,3.090000:1339575.221,3.130000:1339001.613,
#*# 	3.170000:1338433.746,3.210000:1337868.413,3.250000:1337311.703,
#*# 	3.290000:1336746.828,3.330000:1336184.050,3.370000:1335621.452,
#*# 	3.410000:1335082.215,3.450000:1334544.949,3.490000:1334011.284,
#*# 	3.530000:1333489.552,3.570000:1332989.783,3.610000:1332463.598,
#*# 	3.650000:1331948.272,3.690000:1331449.932,3.730000:1330964.341,
#*# 	3.770000:1330483.754,3.810000:1330007.293,3.850000:1329540.385,
#*# 	3.890000:1329080.944,3.930000:1328619.690,3.970000:1328160.851,
#*# 	4.010000:1327704.873,4.050000:1327260.573

I am going crazy, since it is a couple of days I am not able to make them work. Can you please help me?

1 Like

Since I couldn’t add more than 1 attachment on the previous post, I will leave here another picture to show connections on the board

1 Like

first of all - I’m not a printer guru, so take my post with a grain of brain.

Afaik you’re homing wayyy too slow. I got it working with 80mm/s and good with 100, but not lower. driver_sgt=1 is the only value that works for me with 5160s (no pro, afaik). I’ve asked regarding the sgt value here or somewhere else and got some answer that those steppers are a bit wonky regarding sensorless, so you should tune them by homing-speed.

Works for me mostly (not always). But think for yourself before crashing your gear :wink:

Unfortunately, this is not the case… I already tried to set an higher homing speed, but it didn’t work…

1 Like

do you have “home_current: x.0” set anywhere? I don’t see it. Like in the klipper docs iirc it is said to be set to .5 or something (check it). If you run the wall with 1.9A no wonder it goes brrr :wink:

1 Like

My pure guess, you need diag1_pin instead, at least on normal small pololu drivers it is diag1.

Otherwise, normally, SGT -64 should ensure immediate stop.

@stahlsau I bet it is a bot, a bad one.

-Timofey

lol for real? that’d be my first time. Or - probably not, since I didin’t notice. Fuck it the internet is done…

Okay, I’ve found your previous topic.

Than:

home_current: x.0

There is no such config, and it is bad advice.

If you run the wall with 1.9A

Motor current does not affect the energy of the collision; only the velocity does. Simply because homing is a movement with constant speed until the trigger, and an abrupt stop upon the trigger.

Documentation mention that one can use a macro to do that, but it is intended to work around the sensitivity.

Where, if one talks about sensitivity:

  • An appropriate sense resistor can be important, 0.033 is for 5A+ motors.
  • Speed > 20mm/s for a low inductance motor.
  • Appropriate current.

Regardless of that, it seems to me that the above problem is either a misconfiguration in the config or jumpers in the wrong place. That is it, and has nothing to do with “brrr”.

-Timofey

oh you’re right, home_current is a kalico thing. I always mix those up. Seemed to work for me though, although all these stepper values are a bit wonky when tuning and a bit like black magic.

Sorry for the late reply, I was not home.
@stahlsau you have already been answered, so I will just skip answering ahahah

@nefelim4ag unfortunately I am pretty sure diag0_pin has to be used, since it is mentioned on Mellow’s documentation. I have also tried to use it, with no positive result.
I tried the following just a few minutes ago:

  • Disconnected the diag jumper relative to the x motor

  • Plugged in the according connector an optical endstop

  • Tried the x homing keeping the same identical configuration

And it worked! It correctly homed! I cannot understand why the sensorless homing is not working at this point

I wonder what it could be.

I feel incredibly dumb
Basically, I replaced the original ribbon cables (which were incredibly long) with shorter ones, but I didn’t see the diag ones were reversed, instead of straight. So I basically had inverted pinout on the diag and they were directly grounded, never actually setting the pin to high/low.
Re-inserting the original ribbon cable made them work! Now I will get a proper reverse ribbon cable set to short the travel path avoiding cable mess, but I figured it out

1 Like