License: AGLP

A wraper library for Accelstepper. Copyright (C) 2012 Mike McCauley
Constructor. You can have multiple simultaneous steppers, all moving at different speeds and accelerations, provided you call their run() functions at frequent enough intervals. Current Position is set to 0, target position is set to 0. MaxSpeed and Acceleration default to 1.0.
The currently motor position.
directionNo description
The distance from the current position to the target position.
example-constantspeedNo description
example-multistepperNo description
Make a single stepper follow the analog value read from a pot or whatever The stepper will move at a constant speed to each newly set posiiton, depending on the value of the pot.
Checks to see if the motor is currently running to a target
mainNo description
returns the maximum speed configured for this stepper that was previously set by setMaxSpeed();
Set the target position relative to the current position
Set the target position. The run() function will try to move the motor (at most one step per call) from the current position to the target position set by the most recent call to this function. Caution: moveTo() also recalculates the speed for the next step. If you are trying to use constant speed movements, you should call setSpeed() after calling moveTo().
Set the target positions of all managed steppers according to a coordinate array. New speeds will be computed for each stepper so they will all arrive at their respective targets at very close to the same time.
Position array to be used by multistepper
Add positions to position array. Must match number of stepper in multistepper-addstepper
multiposition-resetNo description
Calls runSpeed() on all the managed steppers that have not acheived their target position.
Runs all managed steppers until they acheived their target position. Blocks until all that position is acheived. If you dont want blocking consider using multirun instead.
Add a stepper to the set of managed steppers There is an upper limit of MULTISTEPPER_MAX_STEPPERS = 10 to the number of steppers that can be managed
This class can manage multiple AccelSteppers (up to MULTISTEPPER_MAX_STEPPERS = 10), and cause them all to move to selected positions at such a (constant) speed that they all arrive at their target position at the same time. This can be used to support devices with multiple steppers on say multiple axes to cause linear diagonal motion. Suitable for use with X-Y plotters, flatbeds, 3D printers etc to get linear straight line movement between arbitrary 2d (or 3d or ...) positions. Caution: only constant speed stepper motion is supported: acceleration and deceleration is not supported All the steppers managed by MultiStepper will step at a constant speed to their target (albeit perhaps different speeds for each stepper).
Poll the motor and step it if a step is due, implementing accelerations and decelerations to acheive the target position. You must call this as frequently as possible, but at least once per minimum step time interval, preferably in your main loop. Note that each call to run() will make at most one step, and then only when a step is due, based on the current speed and the time since the last step.
Poll the motor and step it if a step is due, implementing a constant speed as set by the most recent call to setSpeed(). You must call this as frequently as possible, but at least once per step interval,
Runs at the currently selected speed until the target position is reached Does not implement accelerations.
Moves the motor (with acceleration/deceleration) to the new target position and blocks until it is at position. Dont use this in event loops, since it blocks.
Moves the motor (with acceleration/deceleration) to the target position and blocks until it is at position. Dont use this in event loops, since it blocks.
Sets the acceleration/deceleration rate.
Resets the current position of the motor, so that wherever the motor happens to be right now is considered to be the new 0 position. Useful for setting a zero position on a stepper after an initial hardware positioning move. Has the side effect of setting the current motor speed to 0.
Sets the maximum permitted speed. The run() function will accelerate up to the speed set by this function. Caution: the maximum speed achievable depends on your processor and clock speed. The default maxSpeed is 1.0 steps per second.
Sets the desired constant speed for use with runSpeed().
The most recently set speed
Sets a new target position that causes the stepper to stop as quickly as possible, using the current speed and acceleration parameters.
The most recently set target position.
To use the nodes in your project you should have the ivanmason/accelstepper library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.