Sensorless homing is frustrating... (SKR1.3/2209)

Ok, so I have the SKR 1.3 with TMC2209 drivers and TFT35 in touchscreen mode. I went this route with the intentions of using sensorless homing. It seems fairly straight-forward but for some reason, I just can’t get it to work. I have scoured the net trying to find the solution but I’m still a newb at this and some of the information is confusing. And outdated. Some places I’m reading about bending/removing pins or using jumpers. Is that what I’m missing? I thought the SKR1.3/2209s were supposed to be able to do sensorless homing without those physical modifications.

Any help is welcome and appreciated. And I’ll be happy to provide whatever other info you need. I really don’t want to use switches if I don’t have to.

All axes are operating correctly manually with the touchscreen (and in Marlin mode). I’ve even done some successful carving by setting my own X0 Y0 Z0 positions. But when I send G28 X , the X axis moves in the + direction about 10mm and stops, then another ~2mm. G28 Y starts one side of the Y moving in the - direction but the other side doesn’t move and the side that is moving gets hung up and makes that gawd-awful grinding noise until I kill power. Stall sensitivity is set to 100 (tried 128 but same results.) I’m guessing there’s something in marlin that tells the steppers how to move specifically for homing and I’m just missing it.

Planning to use some brackets I printed to level Z and then use a probe to set 0. But right now, I’m more concerned about the XY issue. Although, if you have any info on this Z idea, I’d love to hear it!

This is a LowRider2 using Marlin 2.0.7.2. If you want me to copy/paste some (or all) of my config, let me know.

Thanks for reading and thanks in advance for your help,
Matt-

Anttix was working on this for this board. These were the firmware changes:

1 Like

Thanks Jeff. But I feel like I’m wasting your time. Apparently, I am waaay more newb than I thought. I guess I’m just not informed enough to get that deep into the coding side yet. I need to learn more about github and all the terminology associated with it. Can you suggest any resources to help? I have dabbled in Marlin and VSCode enough to be able to make basic adjustments and build but when it comes to navigating the code or github any deeper than that, I get lost quickly. How do I apply the changes you linked? Or is that too much of a process to cover here?

Anttix (or anyone else): Do you have a complete working code (for my configuration above) hanging out there somewhere that I could grab?

Thanks again,
Matt-

Don’t beat yourself up. That is pretty obscure from Marlin land.

But let me try to explain.

We have some scripts that:

  • check out a fresh Marlin copy
  • enable stuff
  • disable stuff
  • build it (to make sure it works and sometimes to make a firmware file we can flash later).

This is a list of changes that anttix gave us that he wants us to put into our scripts so the stuff that gets enabled or disabled will include sensorless homing.

I was not expecting you to use github, or even copy and run the scripts. I was hoping you could look at what that script was doing, and do the same thing.

I thought I linked to the “files changed” tab too. That might have helped. It says this:

opt_set SENSORLESS_HOMING

# Move away from hard stops after homing to reduce the chance of prolonged stress on the machine
opt_set HOMING_BACKOFF_POST_MM "{ 2, 2, 2 }"

# Setting bump to zero is claimed to improve stallguard homing accuracy.
# However in preliminary testing this was shown to be true only for Z-axis
opt_set HOMING_BUMP_MM "{ 5, 5, 0 }"

opt_enable IMPROVE_HOMING_RELIABILITY \
	Z_STALL_SENSITIVITY \
	Z2_STALL_SENSITIVITY

# Disable incompatible defaults.
# - TMC diag pin is often hardwired to Z- thus a probe can not be connected there
# - Sensorless homing uses diag pins which are already defined in pins.h thus no need to customize
opt_disable Z_MIN_PROBE_PIN \
	Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN \
	X2_USE_ENDSTOP \
	Y2_USE_ENDSTOP \
	Z2_USE_ENDSTOP

opt_set Z_MIN_ENDSTOP_INVERTING "false"

And

# Stall sensitivity values are driver specific.
# These will only be used when sensorless homing is also enabled
# TMC2209 sensitivity setting is 255..0, 0 being the most insentive
opt_set X_STALL_SENSITIVITY "50"
opt_set Y_STALL_SENSITIVITY "50"
opt_set Z_STALL_SENSITIVITY "40"

opt_set changes an option (so if it used to say #define X_STALL_SENSITIVITY 100, now it would change the 100 to 50).

opt_enable enables it (uncomments)

opt_disable disables it (comments it out)

Maybe this is helpful, if not, sorry. It isn’t your fault, I promise. It is just not a very clear way to explain things.

It is very helpful. I was able to see a lot of that stuff and I figured that’s what the scripts were for. I just don’t know how to run them. If you don’t mind, I’d like to continue to pick your brain a little more about the code. If it gets to be too many questions, just tell me, I’ll stop. :smiley:

So when you say “check out a fresh Marlin copy”, do you mean just the basic vanilla marlin firmware like what I could d/l directly from their site? And if that’s the case, I can pull up the src folder in VSCode and look at the changes listed in the items (i.e. src/configs/common/v1-base-config) that fit my machine/build then incorporate those changes in the fresh copy of Marlin, correct? I assume it’s easier to make all of the changes by running the scripts. Is that something that I can do fairly easily or is that a more advanced skill? Is VSCode the recommended program for doing all of this?

Thanks so much for your help and understanding!

I thought you probably have a version of Marlin you are happy with. So you can just do the same thing as the scripts in your copy and try that out.

But if you do want to automate it with the MarlinBuilder scripts, we have that roughly documented:

The build scripts try to check out the development branch and when we release, we check out a specific tag (currently 2.0.7.2).

1 Like

following on this. having the same issues. looking forward to how I can help.

Matt, please let me know if you are able to get this to work. I still can’t get the homing to trip when I stop the motor shaft.
Edit:
I got it working. I have turned the sensitivity way up so I could test the motors without crashing. Below is a firmware file.
LowRider_skr1p3_TMC2209_SensorlessHoming.zip (114.7 KB)

1 Like

Thanks Landon! I will definitely give it a shot! Been tinkering around in Marlin and now I’m having issues getting my steps right for some reason. I set them right in the firmware but they are not transferring over to the board. Maybe a fresh firmware will do the trick! Thank you for sharing!!

Quick question: I’ve heard conflicting stories about bending/cutting pins to make this work. Did you have to bend/cut any pins on the 2209s?

It is not working for me. Manually jogging the axes works fine but homing still doesn’t work. I’m guessing I’m doing something wrong. All the endstops read “Triggered” so does that mean I need to bend pins on the drivers? If I try to change endstop inverting to true, marlin won’t compile.
As I said in my original post: Frustrating!

Landon, If you have this working properly, any chance you could share your config.h and config_adv.h with me please? I can’t seem to figure out where I’m having trouble. Now when I run G28 Y, the Z axis slowly drops and when I run G28 X, the X moves about 2mm and stops. I want to adjust some marlin settings but I don’t know what the config files look like. Thanks!

Downloaded the latest available version (V1CNC_Skr1p3_DualLR_2209-2.0.7.2-src.zip) from V1 Github. That seems to work properly for regular use. Made some changes based on scripts (as suggested above by @jeffeb3) to incorporate sensorless homing but still having issues. I run G28 X and X moves about 2mm and stops. G92 reads X0 after each attempt. I run G28 Y and Z moves down to my physical stops then Y moves about 2mm and stops.
M119 shows all endstops as “TRIGGERED”. Could that be part of the problem? If I try to change any of the ENDSTOP_INVERTING lines to the opposite, Marlin won’t build. It says “SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to X_MIN.” (for the X, obviously.)
I read somewhere that dropping the stepper current before homing sometimes helps. I tried dropping it to 200 (M906 showed 200) but that didn’t seem to help.
I’ve also read that Stealthchop must be on for 2209s to do sensorless homing. It is turned on in my build but does it turn off automatically under certain circumstances?
There’s so much information out there but it all seems outdated (pre-Oct2020).

I am running out of hair. I think I might just install some physical switches and be done with it. I’m really just looking for a good way to level the Z axis. I have some 50mm 3d printed physical stops on the Z tubes but when I raise the Z axis, the far side seems to react faster than the near side. (if anything, I would think it would be the opposite due to the longer wire running through a steel tube.) This causes the Z to be just a smidge off-kilter and takes a while to get it perfectly even at both ends (god forbid I should turn power off and the gantry drops!!)

I bet it’s something simple and I’m just missing it but hey, I’m learning more and more as I go!

1 Like

So good and bad news for you my friend. Good news is I sort of have the homing working, the problem is the repeatability is not there. The best resolution I am getting from one homing to the next is 0.2 mm. While that is pretty good, the limit switch setup is good to 0.05 mm repeatability. Since it is a $20 upgrade to improve my z resolution bay almost a factor of 10, I will be going with that approach.

I totally get it, Landon. I am at almost the same point. I have already installed some switches and just need to finish attaching the rest and wire them all up. I’ll revisit the sensorless thing down the road, most likely on a different machine. I am developing plans to beef up this machine to the point it won’t really be a LowRider2 anymore (linear rails and rigid gantry to start.)
Thanks for your help and happy building! :slight_smile: