Closed ninamercedez closed 2 years ago
The current ramp generator does not support this. Eventually there will be a new one, which can support this feature, but there is no plan to start on implementation in the coming weeks.
From application side, you can try this approach:
void loop() {
if (!stepper->isRunning()) {
stepper->setSpeed(500);
stepper->setAcceleration(3000);
stepper->moveTo(10000 - stepper->getCurrentPosition());
}
if ((stepper->rampState() & RAMP_STATE_MASK) == RAMP_STATE_COAST) {
stepper->setAcceleration(10000);
stepper->applySpeedAcceleration();
}
}
Hope this compiles. The stepper will run back and forth between position 0 and 10000. If in your app, the ramp does not reach the max. speed, then the proposed code will not be able to set the deceleration value.
Is there a possibility to have a different acceleration and deceleration in one movement. e.g. moving 100 mm with an acceleration of 3000 mm/s² and decelerate with 10000 mm/s² ?