Ramping down from full speed
you could utilize the same formula but decrease the time?
That is what the ramptime parameter is for.
Target position close to current position
terminate the rampup prematurely and then move the accumulated time into the rampdown time?
This gets complicated unless starting from a velocity and acceleration of 0. If starting from 0 speed and acceleration then the ramp time up and down is the total move distance divided by the peak velocity.
I noticed Alaric's method utilises (EndingSetpoint-StartingSetpoint)in the equation - but how to utilize similar with peters equation?
You simply need to compute the ramp time from the velocity and the ramp distance. I would use this formula
ConstantVelocity=1.5*MoveDistance/MoveTime
RampTime=MoveTime/3
The motion profile will spend 1/3 of the time ramping up, 1/3 of the time at constant velocity and 1/3 of the time ramping down. The ramp distance will be 1/4 of the total distance and the distance traveled at constant velocity will be 1/2 the total distance.
Compensation for loadswinging
allow more time - more gentle Ramp?
Just make the ramp time and move time longer.
Minimum Speed
Not necessary to start from 0Hz each time?
Assuming that the initial acceleration is 0 then
Velocity=StartingVelocity*(1-f)+EndingVelocity*f
RampTime=RampTimeFrom0toConstantVelocity*(ConstantVelocity-StartingVelocity)/ConstantVelocity.
The math becomes much more complicated if the inital or final accelerations are not 0.
This should give you a good start. Let us know how it turns out and how long it took to implement.