-
-
Notifications
You must be signed in to change notification settings - Fork 19.5k
Tmc2240 fixes #27880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tmc2240 fixes #27880
Conversation
enabling HYBRID_THRESHOLD seems to break new tmc2240 code
|
I think you picked the last commit from master instead of marlin.bugfix |
To fix the missing TMC2240Stepper::sgt() there is a PR waiting to be added to marlin TMCStepper lib MarlinFirmware/TMCStepper#6 I have no way to test this beyond building the code. |
Now might be a good time to add a reference 2240s in the various config headings/sections: Marlin/Marlin/Configuration_adv.h Line 3000 in db137df
Marlin/Marlin/Configuration_adv.h Line 3261 in db137df
Marlin/Marlin/Configuration_adv.h Line 3288 in db137df
Marlin/Marlin/Configuration_adv.h Line 3473 in db137df
Marlin/Marlin/Configuration_adv.h Line 3501 in db137df
...and of course, catch up the configs repo
I plan to do some testing today. Thanks again for looking into this! |
f334914
to
52cb8f6
Compare
44305a6
to
55ded9e
Compare
Testing was done on a BIQU BX with 2240s installed on X, Y, Z1, Z2, and E0 with sensorless homing. SummaryI can move each axis around, but sensorless homing does not work. There are also still compile issues when enabling DetailsI tried a standard I tried enabling I had to disable the following in Click me for the diff!
diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp
index fb17e56..e7f0414 100644
--- a/Marlin/src/feature/tmc_util.cpp
+++ b/Marlin/src/feature/tmc_util.cpp
@@ -715,13 +715,13 @@
#endif
template <typename TMC>
- void print_tstep(TMC &st) {
- const uint32_t tstep_value = st.TSTEP();
- if (tstep_value != 0xFFFFF)
- SERIAL_ECHO(tstep_value);
- else
- SERIAL_ECHOPGM("max");
- }
+ // void print_tstep(TMC &st) {
+ // const uint32_t tstep_value = st.TSTEP();
+ // if (tstep_value != 0xFFFFF)
+ // SERIAL_ECHO(tstep_value);
+ // else
+ // SERIAL_ECHOPGM("max");
+ // }
void print_tstep(TMC2660Stepper &st) { }
template <typename TMC>
@@ -749,7 +749,7 @@
case TMC_CS_ACTUAL: print_cs_actual(st); break;
case TMC_VSENSE: print_vsense(st); break;
case TMC_MICROSTEPS: SERIAL_ECHO(st.microsteps()); break;
- case TMC_TSTEP: print_tstep(st); break;
+ //case TMC_TSTEP: print_tstep(st); break;
#if ENABLED(HYBRID_THRESHOLD)
case TMC_TPWMTHRS: SERIAL_ECHO(uint32_t(st.TPWMTHRS())); break;
case TMC_TPWMTHRS_MMS: {
@@ -1006,7 +1006,7 @@
PRINT_TMC_REGISTER(GSTAT);
PRINT_TMC_REGISTER(IOIN);
PRINT_TMC_REGISTER(TPOWERDOWN);
- PRINT_TMC_REGISTER(TSTEP);
+ //PRINT_TMC_REGISTER(TSTEP);
PRINT_TMC_REGISTER(TPWMTHRS);
PRINT_TMC_REGISTER(CHOPCONF);
PRINT_TMC_REGISTER(PWMCONF); With Before homing:
After homing:
@dbuezas found that according to the datasheet, this is a driver shutdown due to overheating. That is not really the case since drivers are cool to the touch and they are triggering instantly while homing, even at the least sensitive StallGuard value. Further TestingBased on reports in the #trinamic channel on our Discord, you can use 5130 as a substitute for 2240, but I didn't have 100% success with that either. Drivers no longer shutdown, but they do not trigger while homing, even at the most sensitive StallGuard setting (opposite of above since hit state has to be flipped per the sanity checks). There's also a report of a printer rebooting with this PR, but I have not experienced that issue. Another interesting find is that 2240s are a lot quieter when configured as 5130s vs. 2240s. |
That's most likely because the current setting is different and so they will be running at much lower current than configured when set as another chip |
Ahh. Noise level is on par with 2209s/2226s when configured as 5130s. |
Note I didn't double check, I may have read the bits backwards |
Can we push this through, and add any additional fixes later in a separate PR. Currently bugfix users, who already have TMCStepper cached, cannot build latest bugfix. (if they have any drivers that use TMCStepper library) |
Description
_HIT_STATE in Marlin/src/inc/SanityCheck.h doesn't work due to missing brackets. Updated
TMCStepper points to MarlinFirmware/TMCStepper/archive/marlin-2.1.3.x.zip but if someone adds more commits
platformio doesn't notice and continues to use its cached older copy. Updated to point to a particular commit
Add missing Function Declarations to Marlin/src/feature/tmc_util.h
bool tmc_enable_stallguard(TMC2240Stepper &st);
void tmc_disable_stallguard(TMC2240Stepper &st, const bool restore_stealth);
There are other issues with tmc2240 and sensorless. See Comments.
undefined reference to `TMC2240Stepper::sgt()'
Requirements
TMC2240
Benefits
_HIT_STATE test works.
Correct version of TMCStepper library is used.
tmc_enable_stallguard and tmc_disable_stallguard are declared.
Needs
MarlinFirmware/TMCStepper#6 merged and the TMCStepper library updated to point to the updated merged library to fix sgt() issue