I turned off the fault pin to see what my 1/4 bit 1/4 depth test was doing and sure enough it skipped steps like crazy. Instead of numbers in the 200-300’s it was down in the 50’s. The odd thing is it didn’t matter if I set SG_Setting to 1 or to 100, it still stopped dead in it’s tracks and faulted. You would think one of those would be pretty much turning stallguard off
How far down the rabbit hole do you want to go?
Based on the datasheet (section 11 starting on page 58), it looks like the range of that Stallguard setting for a TMC2209 is 0 to 255. Looking at the FluidNC code, it also allows this range. The SG_RESULT range is 0 to 510. The stallguard value we are setting refers to the SGTHRS parameter. When the SG_RESULT falls below the double of SGTHRS, it should trigger the DIAG pin. That is, when SG_RESULT < SGTHRS * 2
I would be curious to try changing the feed_mm_per_min value in the config file under axes/x/homing to reflect the feedrate you are using as this is what the TCOOLTHRS value is calculated based on. Just don’t home X since doing that at 3500 mm/min would not go well.
I’m not certain but you might be able to set that in gcode with something like this:
$/axes/x/homing/feed_mm_per_min=3500
You would probably also need to call $MI
to re-initialize the motors. I think that should recalculate the stallguard TCOOLTHRS value using the updated homing feedrate. I would imagine operating at a feedrate far above the homing feedrate used for the calculation would lead to illogical results.
There are a bunch of other details in the datasheet that I haven’t wrapped my head around.
Reading only what Jason’s provided between your comment and mine, it makes sense to me that it triggered for settings of both 1 and 100. That is, if it’s “stalled dead” and not just “about to stall”, then I could see SG_RESULT approaching 0.0… with the driver being confident that its missed a (single) step, not just about to or struggling to not.
Then again, I’ve only read what’s in this thread on the topic.