I'm building a camera slider using a wagon driven by a nema17 stepper and 'big stepper' driver.

What I want to achieve is/sounds pretty easy, but unfortunately I'm struggling with it for some time now and just can't figure it out.

parameters:

- acceleration distance to get to max speed

- max speed

- constant speed distance

- decelartion distance to go back to zero speed

So: accelerate to a given speed in nnn steps (=distance), continue xxx steps at constant speed and next decelerate to zero speed in zzz steps.

As far as I could find all algorithms I found on the inet are based on David Austin's algorithms describes in his article

David AustinThis includes the Accelstepper library.

In this algorithm you don't have any control of the amount of steps to accelerate to a given speed.

here the parameters are

- the position to move to (or trajectory distance)

- max speed

- acceleration constant (/deceleration)

the max speed and acceleration are used to calculate the initial delay between the steps at the start and then proceed by changing the delay during each step until the desired speed is reached.

_cn = _cn - ((2.0 * _cn) / ((4.0 * _n) + 1)); // Equation 13

for deceleration this formula is used to calc the amount of steps needed to get back to zero.

stepsToStop = (long)((_speed * _speed) / (2.0 * _acceleration));

For me the amount of steps and max speed are known parameters so I'm able to calculated the acceleration. But this doesn't seem to be much of help though. => when deceleration starts the speed is the one of the constant speed so from that point the deceleration should determ what needs to happen to let the speed = 0 after zzz steps.

Anyone who can help me in the correct direction to solve the problem..

Much appreciated!