We should use end-to-end optimization algorithms for 3-D printing design

Kragen Javier Sitaker, 2015-09-03 (14 minutes)

I just spent a few hours designing and printing things in PLA with a US$400 Prusa Mendel RepRap, using a workflow that goes like this: OpenSCAD → Slic3r → Pronterface → RepRap → break them. I think this is the wrong approach, for a couple of reasons.

Printing problems I've seen

The RepRap does not realize your 3-D model with perfect precision or reliability. Here are the ways I've seen it fail:

Often one problem leads to another: maybe flexing leads to mounding, which leads to lost steps, which leads to spaghetti spewed into the void.

All of these problems can be solved with software, and e.g. Skeinforge has settings you can use to solve them already. So what am I suggesting that we do differently?

We can automate solving these problems so you don't have to use trial and error to get a working print.

Design Rule Checks

Semiconductor fabrication has had decoupling between the design and fabrication steps since about 1980, using the methodology designed by Carver Mead and Lynn Conway. As I understand it, which might be wrong, this works as follows. First you design your masks in software with some kind of abstraction of the process steps provided by your fab; then you simulate the circuits to get a good idea of analog performance; then you send the masks (originally on tape, thus the term "tape-out") to the fab, who produces some number between 10 and 100 000 of your new design, which you can test a few weeks later.

A crucial aspect of this process is a thing called "design rule checks", which you run on your masks before simulation, and which the fab also runs on your masks before doing any photolithography. DRCs are mechanically checkable requirements which, if met, that ensure that your circuit will come out working properly despite the limitations of the fabrication process, things like "no wires less than 2Λ wide" and "minimum 2Λ spacing between wires". If your layout passes the DRCs specified by the fab, it's dramatically more likely to produce a working chip.

Shapeways publishes a sort of set of DRCs (they call them "design guidelines" or "printability checks") for STL files that you'd like them to print; for example, their ceramic page says, among other things:

Max bounding box: 340 × 240 × 170 mm and X + Y + Z ≤ 400 mm
Min bounding box: X + Y + Z ≥ 120 mm
Min density: 5% material density
Max wall thickness: 15.0 mm thick
Min embossed detail: 2.0 mm high & wide

There are another ten parameters describing what kinds of models they can print, at the STL level of abstraction. They do some of these DRCs (density, bounding box, wall thickness, model integrity) when you upload a model, while others are done manually.

But I'm thinking about DRCs a layer of abstraction down from there, because none of the problems I've seen with RepRap prints are things that printability checks would have caught, except for the bounding-box violation I mentioned above.

I want DRCs that are checks you run on your final G-Code that would detect problems like these:

Simulation and Optimization for Toolpath Design

To a great extent, you could use AI search techniques to find a toolpath that most closely approximates the desired shape (as expressed in an STL file) without violating DRCs, and then to optimize the toolpath for metrics like minimal plastic use and maximal speed. If you take this a little further, you find yourself simulating the plastic as it comes out of the extruder and cools, rather than using rules of thumb about allowable overhang, slenderness, and cooling time, with dozens of parameters that you have to tweak until you get reliably good prints.

(I'm assuming here that the thermodynamics and mechanics of the plastic coming out of the extruder can be characterized with a smaller set of parameters, ideally parameters that can be measured to a few significant figures rather than attempted via trial and error.)

But really you'd like to optimize things besides plastic use and print speed, while keeping the shape as a given. For example, maybe you'd like to optimize strength or smoothness along with plastic use. But what is "strength"? That depends on the situation.

Why Are Long Bones Curved?

A lot of our long bones, like femurs, tibias, ulnas, and phalanges, are frequently subject to compressive stress. Since they're long and slender, an easy way for them to fail under compressive stress is by buckling: bending to one side or the other, giving the compressive stress progressively more leverage against the tensile strength on the outside of the bend, until the bone breaks. It's well known how to maximize resistance to buckling for a given slenderness of strut: make the strut as close to perfectly straight as possible, so that a greater force is needed to initiate buckling.

So why are all these long bones curved, since a broken bone is such a serious injury and so important to prevent?

I suspect that the answer is that early buckling, far from increasing the danger of broken bones, decreases it. The long bone's diaphysis acts as a spring, absorbing up to a certain amount of energy without damage, and limiting the forces experienced by other parts of the bone and the body until the energy and displacement are very large.

Now, I thought this was just a crank hypothesis I'd dreamed up, but it turns out that actual scientists published basically this idea in 1988: JE Bertram and AA Biewener, and they've been cited 149 times; they cited other forms of it published in 1984.

So long-bone curvature is actually an advanced design technique for making bones and bodies less brittle. It was evolved by exploring the possibilities thoroughly with genetic algorithms, and has produced remarkably resilient and strong skeletons for our bodies by the judicious use of an unremarkable mineral.

Simulation and Optimization for Shape Design

I printed a connector to connect two plastic coke bottles together, with a vertical axis. It had a coke-bottle thread (PCO-1810) on each side, and a lip in the middle. The print took 45 minutes; as soon as I got two bottles into it, it delaminated, each bottle keeping its section of the thread.

I rotated it to horizontal, took the opportunity to thin out the lip a bit, and printed it again. As soon as I got two bottles into it, it delaminated again, but this time that meant it split lengthwise; still unusable.

I gritted my teeth and added massive ugly discs girdling the pipe. This pumped the print time up to 75 minutes, put a bunch of extra plastic in places that weren't weak, added ugly cylinder corners that made it look like a ray-gun plumbing fitting, and made the knurling on the bottlecap model I was using inaccessible to your fingers, but it was an easy few lines in OpenSCAD. This time it withstood several double-bottle insertions, only failing once I tried to really crank two bottles down onto the gaskets to see if I could get it to seal, and it only cracked instead of failing completely like the older models. It used almost three meters of filament.

Much of the problem, of course, is that PLA is comparatively weak compared to the polypropylene normally used for bottlecaps, but more — it's brittle, in the sense that it can't be stretched very far before it breaks. But that's true of hydroxyapatite, too.

Suppose, instead, we were optimizing a feasible toolpath to provide strength and resilience with constraints to provide a lip against which the bottles could seal, without obstructing the bottles' threads (including as they screw in) or necks, and resisting movement of the bottles in all six degrees of freedom.

A first cut at the problem could be a huge block of solid plastic with bottle-shaped cutouts in it; a sufficiently large block would provide the required strength. (FEM simulation would be needed to find out how large.) Then, simply removing material from that block in different places would reduce the amount of plastic needed. Hill-climbing search might steer us to remove plastic less stressed by the bottle neck being screwed in tightly; some possible removals would reduce strength while improving resilience, while others would result in infeasible toolpaths. The ultimate result would surely be lighter-weight, more resilient, and more aesthetically pleasing than what I have sitting on my desk now, and it would take much less time to design and produce.

Topics