Closed dakcantagalli closed 3 months ago
Good observation and the behavior like that is by design. As the doc states:
setLinearAcceleration expects as parameter the number of steps, where the acceleration is increased linearly from standstill up to the configured acceleration value. If this parameter is 0, then there will be no linear acceleration phase
The background is, that this implementation is quite straightforward. The math is described here. Add a linear acceleration increase phase for an already running stepper requires IMHO way more sophisticated math.
stale
Hey guys.
Firstly, I would really like to thanks for the incredible work that was developed in this library!
I would like to share a strange behavior of the "setLinearAcceleration()" function. I expected that the linear variation in acceleration would occur with every change in speed, but it only occurs at the beginning and end of the movement. Below is a graph (speed x time) that I plotted.![image](https://github.com/gin66/FastAccelStepper/assets/88406868/5204e979-d033-4ce7-8b1f-dd629e85d49b)
In RED the behavior I expected:![image](https://github.com/gin66/FastAccelStepper/assets/88406868/6b8ecd4b-cda6-4478-829b-268a1c52921c)
If deceleration is initiated before reaching maximum speed, this is the behavior:![image](https://github.com/gin66/FastAccelStepper/assets/88406868/b1469aef-3815-4308-978b-f01c3e2f5af1)
In RED the behavior I expected:![image](https://github.com/gin66/FastAccelStepper/assets/88406868/fbf34a84-9f07-43f5-a2f3-ce135eb5a9c7)
Am I doing something wrong or is this the expected behavior of this function?