Pages

Wednesday, June 18, 2008

Line buffering in the Arduino


Arduino line buffering from Adrian Bowyer on Vimeo.

I have implemented a poly-line buffer in the Arduino code. This means that, when the host software wants to plot a polygon, it doesn't have to wait till one line segment is finished before sending the next. It can just blast them at the Arduino as fast as it likes (it gets stopped when the buffer is full...) and, more importantly, the Arduino always has a line ready to plot so there is no dwell between one line and the next.

The video shows it working. As you can see, the movements are much smoother with fewer and shorter pauses (unless your broadband is a bit narrow, when any jerkiness will be download delays...).

There are still some tweaks that need to be made to the host Java software (this upgrade has very temporarily killed temperature polling, for example...). We'll do that over the next few days.

Meanwhile, if you want to experiment, the host software is here, and the Arduino code is here.

For it to work you have to set the properties variable Extruder0_PauseBetweenSegments to false.

7 comments:

  1. Be interesting to try some small holes with that.

    ReplyDelete
  2. Does that make it finish something noticeably faster?

    ReplyDelete
  3. Speed isn't the issue with this fix that they're working on. The point is that Darwin's positioning system is agile and has a very fast response time. The extruder, otoh, doesn't. It can take the Mk II several seconds to change it's flow rate. What that means is that if you pause at corners, which both Darwin and my own Tommelise did, you tend to put more plastic down there than you ought. Getting rid of the pause greatly reduces that problem.

    ReplyDelete
  4. Hi, is the acceleration/deceleration of the plastic flow predictable?

    If it is would it be possible to stop the screw, starting the slowing of the flow before reaching the end of a section and then slow the heads travel to compensate?

    Volume(l)/distance(mm) = flow rate (l/seconds) * head travel (mm/seconds) * k

    If we know or can find out the curve for flow when starting or stopping we should be able to alter the head travel speed to keep the volume laid down per mm travelled the same.

    The flow curve could be found by extruding while maintaining a constant velocity and then measuring the width and thickness of the line put down.

    ReplyDelete
  5. Forrest is right that this is not a speed-up thing, it's a make-it-go-smoother thing. I haven't finished experimenting yet, but it does also seem that you can run the machine considerably faster with this as a side benefit. Nophead, who's cracked this problem on his experimental machine builds pretty fast - about the same speed as a commercial RP machine, in fact.

    "is the acceleration/deceleration of the plastic flow predictable?"

    In principle, yes. But the machine goes at constant speed now, accelerating and decelerating to that speed in a single stepper-motor step. So all that's needed is a constant polymer flow to match.

    The problem is more delay in the polymer flow - it starts a while after you turn the screw on, and stops a while later too. The software has times that you can put in to match this, though.

    ReplyDelete
  6. Adrian,
    So has it made a dramatic improvement to the build quality?

    There are still some pauses between poly lines. I assume that is where you wait for the extruder to stop flowing / start again?

    I don't do that at the moment but I might reduce stringing if I did. Because I don't wait after I switch it off, I just move quickly to the new start, I don't need a pause at the start either.

    Peter,
    I think the flow rate will reduce exponentially when the extruder is switched off, unless you have a valve. I did think about slowing down the head exponentially to match but obviously you have to truncate the exponential at some point!

    ReplyDelete
  7. Looks nice. It has a very solid, smooth, professional movement to it now.

    ReplyDelete