Thursday, May 07, 2009

 

4D Printing


Wot? Another coat hook? So what's new here?

The fact that it was printed in four dimensions, that's what. I've upgraded the Java host software and the Arduino/Sanguino G-code firmware so that the system treats the filament length to be extruded in each movement as another independent movement variable, like X, Y, and Z (as proposed here; you've got to have a stepper-driven extruder - like the pinch-wheel extruder - for this to work).

That is to say, the DDA in the firmware, which previously generated straight lines in (X, Y, Z) space, now generates straight lines in (X, Y, Z, E) space, where E is the growing length of extrudate needed.

From the outside, this means that everything works exactly as before. So why bother? The reason is that it makes it a lot easier to do tricks like accelerating and decelerating the extrude head as it moves, which means that it can both go faster and run on less current. This will be the next thing that I do.

I've done a new release of the host software in the repository available here, and written an upgrade to the Arduino/Sanguino firmware called FourD_GCode_Interpreter available here. To turn on 4-dimensional behaviour, simply set the flag FourD=true in the reprap.preferences file. Set it false to make the machine work as it did before.

Perhaps surprisingly, the firmware doesn't need to know if it is being driven in 4D mode or 3D mode. Lines in the G-code now look like:

G1 X23.9 Y39.0 Z0.2526 E66.5 F3000.0 ;print segment
G1 X23.9 Y39.7 Z0.2526 E67.2 F3000.0 ;print segment


So, for example, the second line is saying move 0.7mm in Y from where you last were and extrude 0.7mm of filament while doing so, all at 3000 mm/minute. But if you leave the Es out and turn the extruder on and off separately, everything works just as before (so old G-code files will still work). You can still control the extrude rate separately too - just set the extruder to go at a different speed to the carriage, and everything comes out right automatically.

Unsurprisingly in retrospect, this taught me something about the control of the stepper which drives a pinch-wheel extruder: you don't want to turn the current off between plotted segments. If you do, the stored spring energy in the compressed filament and the pressure in the melt chamber cause the stepper to slip back (as no current is flowing to hold it) at the end of one line segment and before the start of the next, resulting in a poor-quality build. The new firmware turns the current on when the extruder is first used, and leaves it on until the temperature is set to cool. The latter is a bit of a hack (and we could easily add a "current off" M-code instead), but in practice it works very well. The resulting build quality is excellent.

One final thing: I have only tried the firmware in the Sanguino, and not the Arduino. I can see no reason why the latter shouldn't work, though. Let me know...

Labels: ,


Monday, January 19, 2009

 

4 Dimensional RepRap

No - we're not doing an open-source time machine. When we get round to that we will do it last year.

This is a more prosaic idea prompted by G Codes and the fact that several people are doing stepper-motor-driven extruders or ones using Zach's neat shaft encoder. I hope I haven't stolen it from Nophead and recycled it as my own idea...

Clearly if you have a stepper extruder there is a precise relationship between the length in mm of filament extruded and the number of steps (this ignores time delays, melt compression and so on - run with me on this). So, why not incorporate the number of mm of filament to extrude as a dimension on each movement? You'd have things like

G1 W50.0 X30.0 Y40.0 F560.0

Where the W coordinate is the number of mm of filament to extrude. This could either get bigger and bigger as a build progresses (we're not going to run out of floating point numbers...) or we could have a convention that zeros it before each move, so it's Pythagoras on the X and Y numbers.

With that we can then control the machine with a 4D Bressenham DDA, which is just as easy to write as the current 3D one and takes hardly any more microcontroller space.

We can then obviously play tricks to get more or less extrudate:

G1 W100.0 X30.0 Y40.0 F560.0

would make a fat splongy line and

G1 W25.0 X30.0 Y40.0 F560.0

would make a jejune one. You can run the extruder without moving to take up any slack:

G1 W10.0 F560.0

and of course you can move with it turned off by omitting the W value altogether.

I'm not sure if this is:

  1. Clever,
  2. Dumb,
  3. Obvious, or
  4. Useless.
Thoughts?

Labels: , ,


This page is powered by Blogger. Isn't yours?

Subscribe to
Posts [Atom]

View mobile version