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).
multistepper-device
@/multistepper-device
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).
DONEpulse
MDEV@/multistepper-device
To use the node 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.
C++ implementation
// Include C++ library:
{{#global}}
#include <MultiStepper.h>
#include <AccelStepper.h>
{{/global}}
struct State {
uint8_t mem[sizeof(MultiStepper)];
};
using Type = MultiStepper*;
{{ GENERATED_CODE }}
void evaluate(Context ctx) {
if (!isSettingUp())
return;
auto state = getState(ctx);
Type Mstepper = new (state->mem) MultiStepper();
emitValue<output_MDEV>(ctx, Mstepper);
emitValue<output_DONE>(ctx, 1);
}