eldendiss / DendoStepper

Stepper motor API for esp-idf.
GNU General Public License v3.0
24 stars 5 forks source link

Move infinite should allow speed changes while moving, and stop gracefully #25

Open digiexchris opened 10 months ago

digiexchris commented 10 months ago

Is your feature request related to a problem? Please describe. I noticed that while a motor is moving using moveInf(direction) that speed changes are not applied. Additionally, there doesn't seem to be a mechanism that allows it to decelerate to a stop, only to stop instantly (emergency stop).

Describe the solution you'd like I'm not sure how, but ultimately, a way to adjust speed while doing an infinite move may solve both problems, but is really what I need for time based stepper movements, rather than distance. I could just adjust speed to zero to stop it gracefully perhaps. Or a stopInf()? or make stop() aware of if it's moving linearly, or moving infinite?

Additional context The use case in this case is a milling machine power feed, in which case the distance it moves is not important since it's manually engaged or disengaged by a user. It's only the speed that it moves that's important, and the typical UI allows the user to adjust speed as a cut progresses.

digiexchris commented 10 months ago

I just noticed you have an idf 5.x branch, I'll see if that behaves differently. I was off of master before.