TMC2209_Raspberry_Pi
TMC2209_Raspberry_Pi copied to clipboard
Adding a function for continous turning
Hi,
For a project I'm working on I needed to make a stepper turn continuously for up to an hour. I've used your library with VACTUAL to make it work by adding a function set to true the deinitalize flag at the end so the driver doesn't deinitalize itself at the end of the code.
#-----------------------------------------------------------------------
# set deinitialize to true
#-----------------------------------------------------------------------
def setDeinitializeTrue(self):
self._deinit_finished = True
Though this might be useful to someone else in an other project someday. Could you add it to the TMC_2209_StepperDriver.py ?
Hey,
how do you stop the motor then after that one hour?
Cant you use something like this to move the motor for an hour:
tmc.setVActual(1000)
time.sleep(3600)
tmc.setVActual(0)
Hi,
The stepper driver is controlled through a function call to set a speed and after it has completed others tasks, the function is called again to set the speed to zero.
This has the advantage of just setting the speed once and letting the Raspberry Pi do something else while the motor is turning continuously.
i am currently trying to change the code according to the python styleguides. So i named the function set_deinitialize_true