I’m in a bit of a pickle here. I was trying to setup sensorless homing and I tried several variations, but nothing seems to work. My gantry is already at the very top and I can’t seem to land on the right combo.
The LDO kit’s template already had a pin setup: diag0_pin: ^!*PG1, when that didn’t work I tried other variations:
I was expecting: ”*SET_TMC_FIELD STEPPER=stepper_x FIELD=sgt VALUE=-64” + “G28 X0” to not even move because it was set to the maximum sensitivity… but every time it moved and I had to cancel out of that.
I also tried visualizing it through a .html file I found on this forum, but that didn’t work either:
PS: I was following Klipper docs for sensorless homing, checked my Leviathan v1.2 pinout, and watched some videos.
Edit No2: waiiit… waiiit… I think I got it… Well, I don’t have it working yet, but I think I know what the issue is. It’s TMC auto tune. It has settings I need to tweak around, right?
[tmc5160 stepper_x]
cs_pin: PE15
spi_bus: spi4
diag0_pin: ^!PG1
interpolate: true
run_current: 0.8
sense_resistor: 0.075
stealthchop_threshold: 0
#driver_SGT: -64 # -64 is most sensitive value, 63 is least sensitive
[autotune_tmc stepper_x]
motor: ldo-42sth48-2004mah
tuning_goal: auto
extra_hysteresis: 0
tbl: 2
toff: 1
sgt: -64 # -64 is most sensitive value, 63 is least sensitive
sg4_thrs: 10 # CoolStep current regulation threshold
voltage: 2.9
overvoltage_vth: 0.0
Guess something like this? Idk. Gotta read this “Coolstep current” thing.
I wouldn’t use TMC autotune while you’re tuning sensorless homing. Also, I found on my LDO Voron 2.4 that the stock microswitch homing was much more reliable than sensorless.
Sorry. Tunnel vision. I didn’t include that code snippet, but It was configured earlier on.
This is my full config as of now:
##################################################################################
B/A Stepper Settings
##################################################################################
| Stepper | Signal | EN | STEP | DIR | DIAG | UART | CS | SCK | MOSI | MISO | SPI |
|-----------|-------------|-----|------|------|------|------|------|------|------|------|------|
| X | HV_Stepper0 | PG0 | PB10 | PB11 | PG1 | | PE15 | PE12 | PE14 | PE13 | spi4 |
| Y | HV_Stepper1 | PE9 | PF15 | PF14 | PE10 | | PE11 | PE12 | PE14 | PE13 | spi4 |
##---------------------------------------------------------------------------------------
B Stepper - Left
Connected to HV STEPPER 0
Endstop connected to X-ENDSTOP
B/A MOTORS = LDO-42STH48-2004MAH(VRN) - NEMA 17, 0.9° Step Angle, 400 steps, 2 Amp
these motors are connected to the Leviathan v1.2 through 2x TMC5160 stepper drivers
##--------------------------------------------------------------------------------
## Stepper motor
[stepper_x]
step_pin: PB10
dir_pin: !PB11
enable_pin: !PG0
rotation_distance: 40
microsteps: 32
full_steps_per_rotation:400 #set to 200 for 1.8 degree stepper
endstop_pin: tmc5160_stepper_x:virtual_endstop
position_min: 0
position_endstop: 300
position_max: 300
homing_speed: 20 #Max 100
homing_retract_dist: 0 # was 5
homing_positive_dir: true
## Stepper driver
[tmc5160 stepper_x]
cs_pin: PE15
spi_bus: spi4
diag0_pin: ^!PG1
interpolate: true
run_current: 0.8
sense_resistor: 0.075
stealthchop_threshold: 0
#driver_SGT: -64 # -64 is most sensitive value, 63 is least sensitive
## TMC Auto tune
[autotune_tmc stepper_x]
motor: ldo-42sth48-2004mah
tuning_goal: auto
extra_hysteresis: 0
tbl: 2
toff: 1
sgt: -64 # -64 is most sensitive value, 63 is least sensitive
sg4_thrs: 10 # CoolStep current regulation threshold
voltage: 2.9
overvoltage_vth: 0.0
Also figured out I had to use: AUTOTUNE_TMC STEPPER=stepper_x sgt=-64 and confirmed it was working through DUMP_TMC STEPPER=stepper_x.
Just now I was testing with diag0_pin: PG1 and I’m now reverting to what LDO stock config has diag0_pin: ^!PG1.
Sorry my head / thoughts are a bit scrambled with this. It’s a 160+ page manual with a lot of new words and concepts and to complicate things even further I had TMC auto tuned installed which changed the default command to what I mentioned earlier on.
I’ll stop testing now and allow y’all to help me with the latest info in hand.
The result of this G28 X0 at -64 sensitivity was the toolhead moved (bad) and didn’t stop with my finger (even worst). I stopped the printer (m112) and avoided damage.
Also… note the command is being applied: 09:18:01 // COOLCONF: 0040c462 semin=2 seup=3 semax=4 sedn=2 seimin=1 sgt=-64
This little hook looking thing is were the drag chain attaches. Well, I’ve discovered that it’s the reason for several issues:
Friction. Pushes drag chain outwards until the drag chain is touching the acrylic panel.
Friction. This piece rubs against the drag chain and you can literally see white dust.
Racking. While in use I can feel a hint of racking, it’s like the dragchain + hook thing exerts enough stress to the X axis that one of the two front idlers will be slightly racked (One or the other will have a slight play and some times not crash at all).
Sorry, It’s kind of hard to explain for me.
Seeing all the issues it was causing I figured I should just forgo the endstop switch and go sensorless homing.
What I find weird is that it’s not “unreliable” it’s not working at all.
Should I uninstall TMC auto tune? You think there is some issue there nobody is able to identify in my settings / klippy.log?
I know, I know, this is just a bandaid fix. I will still need to dig into the auto tune settings when I get to re-enable it… but for now, this will allow me to work with the printer find the value and then make the switch.
UPDATE: Looks like the value is somewhere between 4 and 5. That’s a bit odd. Maybe there’s a setting somewhere in there that will allow for some granularity or maybe I need to add more parameters to the configuration file? Idk. Kinda lost. Help still needed.
Uploading my latest XY stepper config: stepper_ba.cfg (3.3 KB)
EDIT: I remember a youtuber saying something about slow speed. IIRCC it was something like a speed + stallguard balance. So I need to check for 3 sweet spots? Speed / StallGuard / Amps? Idk, testing this now.
from run_current: 0.8 <===> run_current: 2.0
from homing_speed: 20 <===>homing_speed: 100
Test No. 1 run_current: 1.4 homing_speed: 20
driver_SGT: -10 = no movement. driver_SGT: 1 = slight movement, then stalls. driver_SGT: 2 = unstoppable movement, had to halt the printer.
Test No. 2 run_current: 0.8 homing_speed: 20
driver_SGT: -10 = slight movement, then stalls.. driver_SGT: 0 = slight movement, then stalls.. driver_SGT: 1 = movement stops when it collides with my finger. driver_SGT: 2 = unstoppable movement, had to halt the printer.
Think we have a winner for the X (B) axis? Now for the Y axis…
Test No. 2 run_current: 0.8 homing_speed: 20
driver_SGT: -64 = slight movement, then stalls.. driver_SGT: -34 = slight movement, then stalls.. driver_SGT: -10 = slight movement, then stalls.. driver_SGT: 1 = movement stops when it collides with my finger. driver_SGT: 2 = unstoppable movement, had to halt the printer.
Okay. I think I found it? Not sure. Then If I need to increase the speed / current, I’ll have to tinker some more. If this is it let me know. I’ll keep testing until the BA motors are running with the spec sheet recommended of 2.0 Amps and I tune it to a higher speed.
It looks like you’re going about getting the threshold values for sensorless homing the correct way.
Dropping the current to 1/2 or less than the run current will allow you to select threshold values the way you are doing it there. You might want to try 0.6A to see if you get a larger range of driver_SGT values. Again, I haven’t worked with TMC5160s but with other Trinamic drivers I try to get a range of threshold values in which StallGuard works and then pick the middle one for reliability.
Personally, I keep the homing speed and current fairly low as I don’t want the carriage/toolhead ramming into the printer’s frame at full speed/force.
Thank you for replying. The low threshold was killing my confidence. I was feeling uneasy like I did something wrong. With your feedback I know I just have to keep pushing and tune it further. As it stands now, it homes.
… and just having 2 cables (Stealthburner Nitehawk-SB usb cable + BA motor cable) really helps a lot when it comes to tuning the machine. You know… one less thing muddying up the waters.
A too low homing speed and/or motor current can prevent the motor to create a proper back EMF that the TMC driver can sense.
That means you won’t have a good stall signal and trouble setting up sensorless homing.
I’m homing with normal motor current and higher speeds without issues.
During my first attempts I changed the motor current to 50% and used “normal” homing speeds but that was not working properly.
So not to have you home with 300 mm/s now but just to highlight it, that less is not always better!
Hysteresis. The physics of 2 motors, 2 belts, 3 linear rails, 10 or 12 belt pulleys. Stalling the motors always puts 0,0 on one corner of the hysteresis range. When printing the nozzle will be nearer (typically very near) the center of the range.
If your printer is well tuned you’ll be okay with senseless.