-
Notifications
You must be signed in to change notification settings - Fork 1
stepper module
doomke edited this page Aug 24, 2023
·
8 revisions
Manages, drives and tracks the position of a 4 phase stepper motor. Essentially a wrapper for AccelStepper, but so far only supporting 4 phase motors.
| name | type | default | range | description |
|---|---|---|---|---|
| accell | integer | 500 | > 0 | acceleration of the motor in steps/s2 |
| speed | integer | 500 | > 0 | maximum speed of the motor in steps/s |
| position | integer | 0 | – | current position of the motor in steps |
| minimum | integer | -10000 | – | lower end of the step range, the motor will not go lower than this[1] |
| maximum | integer | 10000 | – | upper end of the step range, the motor will not go higher than this[1] |
| initial | integer | 0 | – | number of steps driven on initialization. Does not respect step range limits. Sets position to minimum if < 0 and to maximum if > 0. No effect if = 0. |
| infoLED | String | "" | – | controlId of a led module. Module will instruct led to indicate if a user made changes[2] |
| pin[4] | integer | 19 22 21 23 |
> 0 | output pins used to control the stepper motor [3] |
- ↑The only exemption to this is the initialization of the motor, where the limits are ignored. This can be used to drive the motor against a physical barrier for a quick and dirty "calibration"
- ↑Defaults to an empty String, in which case no attempts to operate the LED will be made.
- ↑For a 28BYJ-48 stepper one of the following two pin configurations are recommended:
| pin# | stepper1 | stepper2 |
|---|---|---|
| 1 | 19 | 4 |
| 2 | 22 | 17 |
| 3 | 21 | 16 |
| 4 | 23 | 18 |
| key | type | range | description |
|---|---|---|---|
| move | integer | – | drive the specified amount of steps relative from the current position |
| moveTo | integer | – | drive to the specified position on the step range (absolute position) |
| binaryCtrl | boolean | – | move minimum of step range if false and to maximum if true |
| hold | boolean | – | keep motor coils powered after movement if true |
| identify | integer | > 0 | highlight the hardware by its LED[4] for the specified time (in ms) |
-
↑
infoLEDmust be assigned, otherwise no LED will light up
"controlId":"top",
"status":
{
"busy":"true",
"absolute":0,
"relative":50
}-
busy– boolean, true if the motor is currently moving to a new position -
absolute– integer, current position of the motor in steps -
relative– float, current position of the motor as percentage of the total range
-
busy– emitted when the module is starting to move a motor -
ready– emitted when the target position has been reached