-
Notifications
You must be signed in to change notification settings - Fork 94
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
Stop the stepper motor immediately #17
Comments
A temporary solution: Derive a subclass from AccelStepper, |
create new fucntion estop() |
@lightzero - I like your approach - it is much cleaner than my work-around. The estop() function will need one minor addition - also set _stepInterval=0. This will cause runspeed() to return false immediately, (properly indicating no motion) instead of doing another step (if the step interval has elapsed). Resulting function: |
if set |
Hello everyone. I would like to stop the stepper motor immediately after the limit switch has been triggered. If I call the
stop()
function, the stepper motor starts to decrease its speed depending on the given acceleration.I need to stop the stepper motor now, so I use the code:
if (stepper.isRunning()) { stepper.moveTo(stepper.currentPosition()); }
It works. But there is a problem. After I set another position to move again, the stepper motor starts moving at maximum speed without using acceleration. This may cause the stepper motor in my device to jam. Are there any other solutions to this problem?
To set the movement speed, I use the
setMaxSpeed()
functions, and for the stepper motor movement:run()
.The text was updated successfully, but these errors were encountered: