On Sunday 26 July 2015 11:13:52 Fons Adriaensen wrote:
On Sun, Jul 26, 2015 at 08:26:25AM -0400, Gene Heskett
wrote
The jitter is, for some folks minor enough they
do not notice it.
It is however, there. Those of us doing CNC machinery control are
very aware of it, primarily because when moving steppers at a decent
rpm, excessive jitter costs us considerable in motion speed.
Stepper torque about 3 or 4 hundred rpm depends hugely on having the
step signals at a steady rate.
USB by itelf is not to blame here, the way it is used to deliver
these stepper signals is. After all USB can transmit 64 streams of
48 kHz audio samples (e.g. RME MADI-USB) reliably. This requires
some HW buffering of course, but so what ?
There is no buffering in a cnc setup. The computer expects to get
uptodate data from the machine which I have done at rates to 4,000 times
a second, but normal is 1,000/second. Ditto sending data back to the
machine, that data cannot lollygag around in a buffer someplace for 20
milliseconds while USB is searching for a suitable sock to put it in.
Even 2 milliseconds will likely put the resultant part out of tolerance
bad enough its a mantle decorator.
If you try to exactly control the timing of pulses by controlling
the time they are actually sent by the SW then of course this will
fail. You need an approach similar to how audio is transmitted over
USB.
It would be quite easy to use a standard audio interface to do this.
Take the analog output, apply a simple first order lowpass at 3 kHz
or so (to have a controlled FR, independent of the DA converter's
filter), then convert to square wave with a classical Schmitt trigger
circuit with minimal hysteresis (a small fraction of the analog signal
range).
This way you can easily generate pulses up to 10 kHz or more and
control each edge with microsecond accuracy (provided the edges
are at least one sample period apart). All that remains is to
generate the required audio signal. Not trivial, but not rocket
science either.
Ciao,
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>