S-curve motion generator
Here is a s-curve step/dir motion generator I was working on a while back.
It could use some work, but it shows how to generate a trapezoidal with s-curve velocity profile for a given distance and feed rate.
Here is a s-curve step/dir motion generator I was working on a while back.
It could use some work, but it shows how to generate a trapezoidal with s-curve velocity profile for a given distance and feed rate.
Comments
Mine works beautifully and is generated in real-time. The full motion profile is only part of the problem; one needs to account for short moves that don't reach slew and also on-the-fly velocity/acceleration changes.
Craig
Yes, it doesn't handle short moves where block time is shorter than the acceleration time constant. To handle them correctly, the decel ramp starts before the accel ramp finishes, giving constant velocity while overlapped.
I should fix that, but software preprocessing of the move could lower the move feedrate so the blocktime is a bit longer than the acceleration time constant. That may not work properly if there are many short moves in a row. The feed rate override can be accomplished by making the PASM interpolation loop counter longer... the one set to 200 counts with the clock speed set at 200Mhz to get 1uSec interpolation period.
This program outputs step/dir pulses in realtime.