Skip to content
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

Support setting microsteps via GCODE on TMC stepper drivers #21

Open
repvik opened this issue Feb 19, 2019 · 1 comment
Open

Support setting microsteps via GCODE on TMC stepper drivers #21

repvik opened this issue Feb 19, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@repvik
Copy link

repvik commented Feb 19, 2019

Description

Marlin supports setting microsteps using M350 GCODE. This code depends on there being two GPIO pins to control the microstepping. The TMC driver supports microstepping, but does not change stepping when M350 is issued.

This will allow one to replace steppers and change microstepping without recompiling firmware.

@matthew-humphrey matthew-humphrey added the enhancement New feature or request label Feb 19, 2019
@matthew-humphrey
Copy link
Collaborator

I researched this a bit, and here is what I found:

The current implementation of the M350 command only works with stepper drivers whose microstep ratio is controlled via GPIO. For TMC2130, the microstep ratio is controlled via SPI. It is initialized by a call to reset_stepper_drivers() which in turn calls tmc2130_init_to_defaults, which in turn calls tmc2130_init (via a macro, _TMC2130_INIT). The macro passes a #define for the appropriate axis, for example X_MICROSTEPS. These are defined in Configuration_adv.h.

reset_stepper_drivers() is called in M502 (reset configuration). So in theory it could be added by using EEPROM to store setting, and then using this value instead of hard-coded value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants