MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.3k stars 19.25k forks source link

[BUG] (sensorless homing with TMC2209 not working) #19321

Closed Mike8-I closed 4 years ago

Mike8-I commented 4 years ago

Description:

On my Prusa I3 clone which I changed from 8bit to 32bit with bigtreetech SKR1.4 with Bigtreetech TMC2209 v1.2 on Marlin 2.0.c from 06.09.2011 senssorless homing is not working . Changing stall sensitivity just by one digit (eg. From 106 to 105) makes the difference from immediate stop oft he motor where ever the position is (106) to bumping into the frame and rattling (105). Investigating the datasheet oft he TMC2209 shows that the stallguard4 of the TMC2209 is optimised for use with stealth chop (!) (All older TMCx are optimized for use with spread cycle). In advance.h it is stated that sensorless homing for TMCx is always done in spread cycle mode. My assumption is, that this ist he culprit with the TMC2209 sensorless homing not working.

from datasheet 11.1StallGuard4vs.StallGuard2 StallGuard4 is optimized for operation with StealthChop, its predecessor StallGuard2 works with SpreadCycle. The functionis similar: Both deliver a load value, going from a high value at lowload, to a low value at highload.While StallGuard2 becomes tuned to show a “0”-reading for stall detection, StallGuard4 uses a comparison-value to trigger stall detection, rather than shifting SG_RESULTitself

source

Mike8-I commented 4 years ago

I meant Marlin 2.0.x bugfix

GMagician commented 4 years ago

Not sure but TMC2209 code act differently. There has been a PR to fix it a long time ago

GMagician commented 4 years ago
 bool tmc_enable_stallguard(TMC2209Stepper &st) {
    const bool stealthchop_was_enabled = !st.en_spreadCycle();

    st.TCOOLTHRS(0xFFFFF);
    st.en_spreadCycle(false);
    return stealthchop_was_enabled;
  }

that's the involved code

Mike8-I commented 4 years ago

Then this comment:

github-actions[bot] commented 4 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.