The application is setup with
stepper.setMaxSpeed (800); // stepper.setAcceleration(200); //higher faster
Simple enough . . .
I have a routine to find a limit switch. When the switch is triggered I issue .stop & set the position as 0 (my new home position).
but it is not a hard stop, it decelerates thus traveling past the limit switch which of course makes sense because of the .setAcceleration command.
I want to disable .setAccceleration when hunting for the limit switch. Once my endpoints are set, I can re-enable the .setAcceleration back to normal.
I don't know how to do this.
I have tried stepper.setSpeed in setup and stepper.runSpeed() in loop which works. I get a hard stop.
After that I want to do position movements with .setAcceleration, .moveTo and .run (notrunSpeed!)
I think I am going about this wrong or don't know of the correct function. Cranking up the value for .setAcceleration won't work because it is still not a hard stop.
The thought would be just run your limit hunting with .setSpeed &.runSpeed initially, the use .setAcceleration and .run.
But I want to jump back and forth for re-calibration at anytime.
What's the generally accepted way to find limit position with a hard stop, then jump into positional movements with .setAcceleration?
Does someone have a link to a code example?