Two years later... I wanted to add some details about the typical speed vs vibration/noise for any step motor.
When stepping very slowly, like one per second, the shaft will move to the new location and overshoot then undershoot many times until it stabilize on that step. The process repeat on each new step.
The electric voltage/current has to be sufficient for the load and the motor size need to be selected to match the torque required.
Once the motor does not need to move, the voltage/current can be reduced by about 50% to 75% to maintain that position. In cases where the friction is dominant, or using some type of gear, the motor can be desenergized completely. This is similar to relays which need for example 12 volt to activate, but then easily keep the contact activated with only 9 volt.
When increasing the speed to about 20 per second, the vibration/noise reach it maximum. This is a speed that most engineer will try to avoid.
As the speed is increased, the vibration/noise decrease, by the torque also falls. If you plot the noise vs frequency, the shape will show a clear down direction with some local maxima, often at harmonic frequency.
Let's assume that a typical value above 100 step per second, the vibration is low enough to be tolerable and let say that the torque become too weak for reliable operation above 500 hertz.
You can start a step motor using any of these frequency right away, without ramping the speed from 100 Hz to 500 Hz. Similarly, you can stop abruptly the steps, no matter the frequency. The holding current is sufficient to lock the motor at that step.
The ramping is needed when you want to exceed the maximum frequency. Given the "typical" number above, you may find that your motor still have enough torque, when smootly accelerated, to work from 500 Hz to 700 Hz. The trick for a reliable operation is to start the ramp somewhere like 400 Hz, then let it increase up to 700 Hz. Keep it at that speed until approaching the target position.
Then, decelerate smoothly from 700 Hz to 450 Hz. If target position still not reached, keep the motor at that speed. Then, from 450 Hz, you can stop. Keep the motor energized at max current/voltage for 0.1 second to 1 second to make sure all source of vibration dissipated.
The linear ramp is easier to create. But the optimum is the "S" shape. You start at the safe frequency, increase slowly at first and change rate of increasing the speed exponentially until reaching the maximum.
When it is time to decelerate, the same algorithm apply, decreasing the speed slowly and exponentially changing the rate of speed decreasing, stop decreasing the speed when reaching the safe speed, which allow to stop the motor abruptly.
The actual code doing all that, using a motorola 68HC05 microcontroller, was taking about 500 bytes (the internal EPROM was 8K total and the RAM was 128 bytes). It was written in assembler.
If you have the hardware for micro-stepping, then you can ignore all the mention about noise and vibration. You still need a "S" shape acceleration if you want to exceed the usual maximum speed. But since there is no vibration no matter the speed, you can let the deceleration go as low as you want.
The lessons learned from the square wave drive still hold thru. Thhat is, for the most efficient way to reach destination, you want the deceleration to sit at the frequency just below the point where the motor torque is sufficient for abrupt stop and start.