This plugin adds settings, M-Code extensions and reports for TMC2130, TMC2209, TMC2660 and TMC5160 stepper drivers.
Some Marlin-style M-codes are supported: M122, M569, M911, M912, M913, M914 and M919 - some with extensions and some with a sligthly different syntax.
M122 axisletters <H-> <S-> <Q-> <I>
H
- 0 = SFILT off, 1 = SFILT on (TMC2130) only.I
- reinitialize driver.S
- 0 = disable StallGuard and live output of sg-value, 1 = enable StallGuard and live output.Q
- not yet enabled.
Examples:
M122
- output debug info for all enabled drivers. This is a plain text report, do not issue from a sender!
M122 Y
- output debug info for Y axis only. This is a plain text report, do not issue from a sender!
M122 I
- reset drivers.
M122 X S1
- enable live output of StallGuard value for tuning. Do not enable when running g-code jobs!
M569 axisletters <S->
Toggle between, or switch to, StealthChop™ and/or SpreadCycle™ mode. Available for TMC2130, TMC2209 and TMC5160 drivers.
S
- 0 = disable StealthChop, 1 = enable StealthChop.
Examples:
M569 X S1
- Set X-axis mode to StealthChop.
M569 X
- Toggle X-axis mode.
M569 XY S1
- Set X- and Y-axis mode to StealthChop.
M569
- output the current configuration.
M906 axiswords
Example:
M122 X700 Y950
- set stepper current for X-motors to 700mA RMS and Y-motors to 950mA.
Note
Stepper current is not permanently stored.
M911
M912
M913 axiswords
Example:
M913 X31
Note
Hybrid threshold is not permanently stored.
M914 axiswords
Example:
M914 X31
Note
Homing sensitivity is not permanently stored.
M919 axisletters <O-> <P-> <S->
O
- Time-off (toff: 1..15) value, if omitted reset to default value.P
- Hysteresis end (hend: -3..12) value, if omitted reset to default value.S
- Hysteresis start (hstart: 1..8) value, if omitted reset to default value.
Examples:
M919 X O4
- Set X-axis time-off to 4.
M919
- output the current configuration.
Note
hstart + hend must be ≤ 15.
Note
Currently default values are common for all axes and changing the configuration via $-settings will overwrite any values set by M919.
Note
Chopper timings are not permanently stored.
Settings are provided for axis enable, homing, stepper current, microsteps and sensorless homing. More to follow.
Valid values are 1, 2, 4, , 8, 16, 32, 64, 128 and 256.
Range is -64 to 63 for Stallguard2 (TMC2130, TMC5160), 0 - 255 for StallGuard4 (TMC2209).
Range is -64 to 63 for Stallguard2 (TMC2130, TMC5160), 0 - 255 for StallGuard4 (TMC2209).
Parameter is a axismask where value is sum of X=1, Y=2, Z=4 etc.
Note
Some boards does not allow mixed drivers, for these this setting is not available.
Parameter is a axismask where value is sum of X=1, Y=2, Z=4 etc.
Sensorless homing requires tuning of parameters, the datasheet has information about how to:
TMC2130
TMC2209
TMC2660
TMC5160
Some parameters are hard coded and require recompilation/reflashing to change.
Note that tuning is not trivial, for one-off machines it is likely that endstop switches will be the best/easiest option to implement.
It is possible to enable settings for some chopper mode and CoolStep parameters by adding/uncommenting this line in my_machine.h and recompiling:
#define TRINAMIC_EXTENDED_SETTINGS 1
Range is 1 to 15.
Range is 0 to 3.
0 - Spreadcycle, 1 - Constant toff.
Range is 1 to 8.
Range is -3 to 12.
Range is 0 to 3.
0 - fixed, 1 - random.
0 - CoolStep off, 1 - 15 threshold range.
Range is 0 to 3.
Range is 0 to 15.
Range is 0 to 3.
0 - ½, 1 - ¼.
Note
These settings will be applied to all drivers, use M919 if you want to change some chopper parameters per driver.
If this option is enabled or disabled all plugin settings will be reset to default values.
Note
For a detailed description of what these settings applies to please refer to the relevant driver datasheet linked above.
The driver and driver configuration has to be extended to support these plugins.
Dependencies:
Trinamic TMC2130 I2C<>SPI Bridge (optional)
2024-11-18