Send the full TMC stepper motor driver initialization sequence every
time the driver is enabled.
Don't raise an error on startup if unable to contact a tmc2208/tmc2209
driver. If the driver is still unavailable when it is enabled then a
shutdown will be issued. This allows users to troubleshoot (and
possibly bring up communication to the driver) prior to enabling the
driver.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Refactor the tmc driver implementations so that there is a single
implementation of the SET_TMC_CURRENT command.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add support for automatically calculating the internal step_distance
from new config parameters - rotation_distance, microsteps,
full_steps_per_rotation, and gear_ratio.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It's not valid to set the TPWMTHRS in a "klippy:connect" event handler
because the TMCVirtualPinHelper and TMCCommandHelper classes were
expecting that field to be set during the config reading phase.
Revert "tmc: Fix typo preventing stealthchop threshold from being set"
This reverts commit 7d76067ff9.
Revert "tmc: Query the stepper step_distance from the stepper object"
This reverts commit 67b2852249.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Collapse the "homing:move_begin", "homing:move_end", home_prepare(),
and home_finalize() into two new events: "homing:homing_move_begin"
and "homing:homing_move_end". This simplifies the homing code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Don't obtain the step_distance from the config, instead obtain
step_distance from the instantiated stepper object.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Automatically detect if the stepper has a dedicated enable line. If
it does not, then automatically enable virtual enable support.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add support for enabling the stepper via the communication channel.
This improves support for boards with a shared enable line.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
A print_time of zero may translate to a negative clock on a secondary
micro-controller, which would cause an internal error. Change the
code to pass a real print_time or None if it is not needed.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Only the tmc2208 driver needs special read register translation logic.
Rework the code so a default implementation is available for all the
other drivers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>