Yeah, it does "ramp-up" -- that's part of what I'm investigating. The stuttering happens when it isn't given enough time to accelerate to rotational speed before the fastest intervals between step changes. That's what the check in .move() for the first 10 steps is all about. I'm working on that algorithm to get it to be rock-solid and not stutter. Oh, and the stuttering from setting a new "request" while currently working on a current move -- definite bug, but easy to fix!
As far as being generic, yeah, it almost is. I already decided to make the small changes necessary to make it totally general, then populate it with defaults for the 28BYJ48 so it's ready to go "out of the box" for that stepper, since they're so common. The only specific parameter really is the steps/rotation.
@Gordon good ideas for some additional functionality too! The stop() definitely... Some of the other more complex functionality (like with feedback from sensors like a limit switch) I had in mind for application coding, hence the inclusion of the step() method in the prototype rather than as a private function in the module... the step() method keeps track of position, so functionality can be easily extended with step() and zero() (and stop() which I'll add).
© Espruino, powered by microcosm.
Report a problem