-
Notifications
You must be signed in to change notification settings - Fork 1
stepper module
doomke edited this page Jul 11, 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 | range | description |
|---|---|---|---|
| accell | integer | > 0 | accelleration of the motor in steps/s2 |
| speed | integer | > 0 | maximum speed of the motor in steps/s |
| position | integer | current position of the motor in steps | |
| minimum | integer | lower end of the step range, the motor will not go lower than this[1] | |
| maximum | integer | upper end of the step range, the motor will not go higher than this[1] | |
| initial | integer | 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 | > 0 | output pins used to control the stepper motor [3] |
- ↑The only excemption 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# | 1st | 2nd |
|---|---|---|
| 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$-$ emmitted when the target position has been reached