-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
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
[BUG] TMCMarlin::set_pwm_thrs()
sets 0
if driver is not powered by VMOT
#20397
Comments
I've been discussing this on Discord with @rubienr and agree that this is a bug, This was something that slipped through the cracks when I looked at #19364 - the hybrid threshold is stored in a shadow register in TMCStepper, but the micro steps are not and those are used to initialize the shadow register hence the bug. |
TMCMarlin::set_pwm_thrs()
sets 0
if driver is not powered by VMOTTMCMarlin::set_pwm_thrs()
sets 0
if driver is not powered by VMOT
The micro step setting is indirectly shadowed on the TMCStepper side as part of |
Tested with bugfix-2.0.x as of 9b82a5c and observed the same behaviour as described above. Configuration Files |
I'm pretty sure this is not specific to the 2130 drivers and will occur with all TMC drivers. |
Not sure if this is part of the same thing or maybe expected behavior for some reason but I was also getting '0' set by "M913 E5" for my TMC2209 on my extruder which had microstepping disabled / = 0. Seems to set '0' if microsteps is set to 0 for the driver. I don't quite understand the firmware enough to know if this is the same behavior mentioned regarding microsteps on the driver. |
This issue has had no activity in the last 30 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 7 days. |
If needed I can offer my printer for remote debugging/flashing. |
This issue has had no activity in the last 30 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 7 days. |
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. |
Bug Description
When TMC2130 stepper driver is not powered by VMOT (i.e. PSU_CONTROL feature is enabled and PSU is off),
TMCMarlin::set_pwm_thrs(const uint32_t)
will callTMC::TPWMTHRS(0)
becausethis->microsteps()
returns the readout of the unpowered driver's internal processor, not a shadowed register (see tmc_util.h:116 and all subsequent implementations ofTMCMarlin::set_pwm_thrs(const uint32_t thrs)
).The rough call tree:
TMC::TPWMTHRS(uint32_t)
will cache and send the threshold to driver. The next read withTMCStepper::TPWMTHRS()
will return the cached value (0 in the unpowered case).Configuration Files
Enable
#define PSU_CONTROL
, enable at least one TMC driver by#define *_DRIVER_TYPE TMC2130
and#define HYBRID_THRESHOLD
.configuration-issue-20397-2.0.7.2.tar.gz
Marlin Version: 2.0.x branch as of eb254ef (7th Dec. 2020)
Steps to Reproduce
0
hybrid threshold value is stored in flash)TMCMarlin::set_pwm_thrs(const uint32_t)
for example byM913 X100
M80
M122 I S0
M913
will report0
Expected behaviour:
1.-3.
4. enable PSU
M80
5.
M913
will report the hybrid threshold as stored in flashor
1.-3.
4. enable PSU
M80
5. re-initialize stepper drivers with current settings
M122 I S0
6.
M913
will report the hybrid threshold as stored in flashActual behaviour:
1.-5.
6.
M913
will report0
Probably Related
#19364 (PR: Use stored values for TMC StealthChop)
#19313 (Issue: [BUG] M502/M500 when TMC drivers do not have VMOT results in incorrect values being stored in EEPROM)
A Detailed Example
The text was updated successfully, but these errors were encountered: