On Mon, Nov 19, 2012 at 10:52 AM, ddurant <
ddur...@gmail.com> wrote:
> If s3g does all those calculations ahead of time on the pc, that's a
> definite savings in processing time for the Arduino..
This is huge. Soft floating point on a 16 Mhz 8-bit processor is
going to be *slooow*.
> ...but I still say that USB has plenty of bandwidth and, if done right, low
> enough latency to drive all of todays printers. And a Mega has enough
> horsepower to do it.
It's not the wire speed that's the problem here, it's latency and
keeping the silo full.
Back in the "old days", with real serial ports, if your application
wanted to squirt bytes out of a serial port, an OS driver (or in the
DOS days, your application code since the BIOS drivers were so
terrible), pulled bytes from your buffer and slapped them into a real
I/O register and they went out at wire speed, one at a time. The real
problem there was interrupt latency from the OS. Later chips (16550A)
had internal buffers that could accept more than one byte from
(usually) the modem before triggering an interrupt (usually 12 bytes
received on a 16-byte buffer) so that you wouldn't lose bytes, but you
wouldn't be spending all your "time" rushing back to the modem byte
after byte with all the overhead.
With USB, there's a huge (by comparison to a simple serial driver)
networking stack that takes your buffer and converts it to a series of
network packets that are deconstructed by the chip on the MakerBot
motherboard (the FTDI chip or the ATmega u8) and turned into a simple
(1 start bit, 8 data bits, 1 stop bit) serial stream.
What matters is that the stream of bytes coming out of the FTDI chip
keep coming fast enough to prevent pauses in the motion of the print
head because they are waiting for their next set of coordinates. If
_that_ silo "starves", the head will pause until the next batch of
bytes assembles into a move command.
The clock speed on the USB wire is *not* the bottleneck. It's
substantially faster than the async serial speed between the FTDI chip
and the AVR processor on the MakerBot. The bottleneck, as far as I
understand, is PC host overhead and the amount of time and CPU cycles
it takes to take a wad of s3g bytes from your file and get them _onto_
the USB wire. This is why printing from an SD card is "pause free" -
the AVR chip can pull the bytes it needs when it needs them, and no
latency and overhead to do it.
In a sense, I'm restating what you are saying with "THIS is really the
reason to print from SD, IMO, not speed/latency of USB or Arduino
speed," but the part I'm adding is that the PC-side of USB _is_ slow,
or rather has high latency, too high to reliably keep the commands
coming to the AVR/Arduino uninterrupted.
-ethan