Acceleration algorithm for step pulse generator
-
Hello all. I’m working on a step controller using an FPGA to generate the pulses. The issue I’m having is calculating acceleration. The software I’m using makes it easy to use clock cycles of the 40MHz for the timing of the pulse and the frequency of the pulses. I can generate consistent pulses. Where I am struggling is to make controlled movement where the acceleration is consistent over a given number of pulses then stay constant, followed by a controlled deceleration.
If I need say 100 pulses to accelerate over say 0.5 seconds then that would be 2million clock cycles for acceleration. If I shorten the timing between pulses I don’t get smooth acceleration but rather slow acceleration with a sudden quick ramp at the end.
I can’t seem to find anything on google so I thought I would reach out here as I can only assume someone on here has solved this before.
Thanks.
-
@baird1fa for smoothly accelerating or decelerating motion the time t of the nth step pulse measured from the start of the move is given by this formula:
t = t0 +/- sqrt(q + p * n)
where p = 2/a, q = t0^2
where t0 = -u/a, a is the acceleration and u is the initial speed.