Git Product home page Git Product logo

plugins_motor's Introduction

Trinamic stepper driver plugins

These plugins adds settings, M-Code extensions and reports for TMC2130, TMC2209 and TMC5160 stepper drivers.

They support Marlin-style M-codes such as M122, M911, M912, M913 and M914 - some with extensions and some with sligthly different syntax.

M-codes

M122 - output debug info or reset driver.

M122 axes <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!

M906 - set stepper current

M906 axes

Note: Stepper current is not permanently stored.

Example:
M122 X700 Y950

M911 - Report prewarn flags

M911

M912 - Clear prewarn flags

M912

M913 - Set hybrid threshold

M913 axes

Note: Hybrid threshold is not permanently stored.

Example:
M913 X31

M914 - Set homing sensitivity.

M914 axes

Note: Homing sensitivity is not permanently stored.

Example:
M914 X31

Settings

Settings are provided for axis enable, homing, stepper current, microsteps and sensorless homing. More to follow.

$14x - Stepper current. x = 0 for X-axis, 1 for Y axis etc.

$15x - Motor microsteps. x = 0 for X-axis, 1 for Y axis etc.

Valid values are 1, 2, 4, , 8, 16, 32, 64, 128 and 256.

$20x - StallGuard sensitivity, fast (locate) threshold. x = 0 for X-axis, 1 for Y axis etc.

Range is -64 to 63 for Stallguard2 (TMC2130, TMC5160), 0 - 255 for StallGuard4 (TMC2209).

$21x - Hold current as percentage of stepper current. x = 0 for X-axis, 1 for Y axis etc.

$22x - StallGuard sensitivity, slow (seek) threshold. x = 0 for X-axis, 1 for Y axis etc.

Range is -64 to 63 for Stallguard2 (TMC2130, TMC5160), 0 - 255 for StallGuard4 (TMC2209).

$338 - Driver enable

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.

$339 - Sensorless homing enable

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
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.


The driver and driver configuration has to be extended to support these plugins.

Dependencies:

Trinamic library

Trinamic TMC2130 I2C<>SPI Bridge (optional)


2023-01-11

plugins_motor's People

Contributors

andrewmarles avatar fitch22 avatar mekecnc avatar siencilabs avatar terjeio avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.