First off, the digitalwrites in that code are sequential, and I'm
almost certain it would be better if they were happening
simultaneously. If this is so, then this will certainly reduce the
maximum speed.
Check out this to get simultaneous pin switching/setting:
http://www.arduino.cc/en/Reference/PortManipulation
It probably isn't required for your purposes, but microstepping can
increase the smoothness of the rotation, though it is probably more
important in low-speed applications, but if you have the time to do
microstepping it won't hurt to do so (i.e. instead of step-transitions
between high and low, there is a curve of power applied, which can be
emulated using PWM (which because of the inductance on the motor
windings should actually smooth out the PWM spikes)):
http://arduino.cc/en/Tutorial/SecretsOfArduinoPWM
I have some arduino code that sets up the sine lookup-table (sine wave
is pretty smooth, so that's what they use), and anytime there's a
transition on the coils, instead of just turning one off and another
on instantaneously, it performs the transitions using PWM (starting at
0% duty, e.g. full-off, progressing up to 100% duty, e.g. full-on). I
can post this code later tonight.
>
https://groups.google.com/d/msgid/diybio/53F78814.4090102%40c2o.pro.br.
--
-Nathan