-
Notifications
You must be signed in to change notification settings - Fork 73
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
Update Stepper to wrap AccelStepper #33
Comments
what features do we all want to wrap? Also I think this is the most recent revision here: |
Looking over the header class it seems we should aim for
Maybe
We can't do
|
One way to start would be to define the ideal stepper interface regardless of what is wrapped. You had some proposals for the protocol a while back so that could be a place to start and solicit feedback. |
We could start by breaking out the proposed commands from here into a list. Maybe do that here: firmata/protocol#42. No need to work out all the details of the protocol yet, just get a list started and then see if others have any feedback. I can bring it to the attention of some people in the nodebots community as there may be some opinions there. |
Finally found some time to work on this and am making good progress. I'm finding however that I'm limited in the number of steps I can make per second. Is the frequency of calls to loop() just dependent on what the hardware will allow or is there a predetermined interval? I'm maxing out around 450 steps/sec right now. |
It depends on the clock speed and the amount of work being done in the loop. There is no way I know of to make it faster other than running on a faster microcontroller and making sure you don't include unneeded Firmata features. |
WIP for Configurable Firmata and firmata.js. All the AccelStepper stuff from my Stepper 2 Proposal is in there and working with the possible exception of enable (the motor controller I've been testing against has the enable pins hard wired). So far I've only tested 4-wire full step and 4-wire half step and those both work great. Need to order more steppers and controllers to test the other configurations but accelStepper is handling most of that so should be in pretty good shape. Still need to add support for multiStepper and test, test, test. |
This looks good so far. I only have a couple of steppers and a single EasyDriver and a breadboard with a simple h-bridge driver so I can help with some basic testing. |
I'll also starting thinking of a strategy for rolling this out. I don't want to call it StepperFirmata2, I'd rather deprecate the old version entirely. The Firmata protocol will get a minor version update when this feature is released so a client application can check the version to determine which interface to use. However this makes the client side implementation a bit more complicated and probably necessitates keeping the old version around for a while or throwing an error upon seeing the old config ID, informing the user to download the latest version of ConfigurableFirmata. |
Here's the script I've been using for testing... https://gist.github.com/dtex/6a601c138f9b9184b214c29b718bcb10 |
There are two commands that I documented in the Stepper 2 proposal that are not handled by the multiStepper class in the accelStepper library. Specifically, "stop" and "report positions". To make this work I will need to create a sub class in configurable Firmata that exposes the individual members of the group (they are private in multiStepper). That way I can call stop() and currentPosition() on each member. The drawback of course is that this adds some heft and complexity Stepper 2. This functionality can be handled higher up the chain by making multiple calls to stop. It seems to me that minimalism in configurableFirmata should win out and this functionality can be handled in firmata.js or Johnny-Five (or whatever the client happens to be). Do you agree? |
How important is having My concern with handling that from a client is latency, but I guess you could probably send a reference to all steppers to stop or report positions for in a single command. Another option, to handle things on the board side is to add a |
Hi! I'm having some problems with library. Right now I can init, start, stop motors, with smooth acceleration (with Python on Raspberry Pi). Unfortunately, there are things which don't work for me.
Thanks in advance for any help.
|
I'm open to completely rethinking the interface. To avoid breaking existing client support we should use a different command byte (I'm proposing 0x62) and deprecate the old version (0x72). Since this will be a wrapper library (wrapping AccelStepper) it should be created in a separate repo in the same format as FirmataEncoder. I will need to rename FirmataStepper in the utility folder to allow the wrapper library to be named
FirmataStepper
. StepperFirmata will then be deprecated.Start with the updated protocol: firmata/protocol#42
The text was updated successfully, but these errors were encountered: