Closed alxkos closed 11 months ago
Getting another problem: Stallguard fires right away. only if i'm o very low speed and low acceleration. like 10,15 Here is my code:
` tmc.setDirection_reg(False) tmc.setVSense(True)
tmc.setIScaleAnalog(True) tmc.setInterpolation(True) tmc.setSpreadCycle(False) tmc.setMicrosteppingResolution(1) tmc.setInternalRSense(False)
tmc.setCurrent(200) tmc.setAcceleration(100) tmc.setMaxSpeed(100)
tmc.setMotorEnabled(True)
def my_callback(channel): print("StallGuard!") tmc.stop()
tmc.getStallguard_Result() tmc.setStallguard_Callback(21, 1000, my_callback)
finishedsuccessfully = tmc.runToPositionSteps(2000, MovementAbsRel.relative) tmc.getStallguard_Result() if(finishedsuccessfully == True): print("Movement finished successfully") else: print("Movement was not completed")
tmc.setMotorEnabled(False)
`
Simple setup, stepper 17hs13 with 0.4A PSU is 9v Any suggestions? Badly wat to use Stallguard instead of using microswitches.
Thanks
found the problem
Getting another problem: Stallguard fires right away. only if i'm o very low speed and low acceleration. like 10,15 Here is my code:
` tmc.setDirection_reg(False) tmc.setVSense(True)
tmc.setIScaleAnalog(True) tmc.setInterpolation(True) tmc.setSpreadCycle(False) tmc.setMicrosteppingResolution(1) tmc.setInternalRSense(False)
tmc.setCurrent(200) tmc.setAcceleration(100) tmc.setMaxSpeed(100)
tmc.setMotorEnabled(True)
def my_callback(channel):
print("StallGuard!") tmc.stop()
tmc.getStallguard_Result() tmc.setStallguard_Callback(21, 1000, my_callback)
finishedsuccessfully = tmc.runToPositionSteps(2000, MovementAbsRel.relative) tmc.getStallguard_Result() if(finishedsuccessfully == True): print("Movement finished successfully") else: print("Movement was not completed")
tmc.setMotorEnabled(False)
`
Simple setup, stepper 17hs13 with 0.4A PSU is 9v Any suggestions? Badly wat to use Stallguard instead of using microswitches.
Thanks