Closed Paulvandenbogaard closed 6 months ago
The doc says: “ setLinearAcceleration
expects as parameter the number of steps, where the acceleration is increased linearly from standstill up to the configured acceleration value”
The acceleration is configured by setAcceleration()
. So the behavior is as expected.
The rotation force being applied to the stepper axes is proportional to the acceleration. So a normal ramp applies constant acceleration till maximum speed. This means, from standstill a constant force is applied, which the driven system may not like so much (e.g. a glass full of water being moved linearly). setLinearAcceleration allows for a smoother start, where the force is ramping up, too.
Working with a Mega2560. Stepper NUMA24, driver DM542T. PlatformIO, FastAccelStepper 0.30.10.
Trying to figure out what LinearAcceleration can do for me. Reading the comments/docs I understand using setLinearAcceleration(steps) will use this amount of steps to reach the speed already set.
With the following "setup()" function:
The resulting output is:
Both moveTo's report -3 (MOVE_ERR_ACCELERATION_IS_UNDEFINED)
I now uncomment the line:
and rerun:
Now only the first moveTo reports an error, while the second used after a call of setAcceleration is done, is fine.
I changed the value of the parameter for setAcceleration and it makes the speed of the stepper go different (as expected).
Why is there a need to use the setAcceleration() when trying to do this with setLinearAcceleration() only? Do I need a different approach to work with setLinearAcceleration() only?