## Wednesday, December 19, 2012

### Octet Truss for Topology Optimization

 Random Octet Truss Array (on shapeways)
This post demonstrate a work-flow for topology optimization using open source tools (with mixed success). The approach uses an unpenalized method (see wiki) that maps the material density output from the optimizer to unit-cells based on the octet truss (inspired by this white paper, see pp10). As some further motivation for this approach, the students working on the record-setting human powered helicopter demonstrated that multi-scale trusses (trusses with elements made of smaller trusses) were a very efficient structural concept (see the comments for further references on multi-scale structures). One of the benefits of not penalizing (using variable density solutions rather than trying to achieve predominantly solid-void solutions) is that we don't need to spend time doing parameter continuation on the penalization exponent.

### Work-flow Steps

1. Define design domain
3. Run optimizer (ToPy)
4. Map optimized density to octet truss unit cells, generate mged (BRLCAD) script
5. Run mged script, export stl of the geometry
6. 3D Print It!
For demonstration purposes I'll just use the dogleg example from ToPy which takes care of steps 1 and 2. The input deck for that example must be modified to change the penalization and gray-scale filtering (GSF) options. Here's a gist that shows the modified input deck (note that P_FAC=1, and I have commented out the continuation and GSF parameters).

The output of running the optimizer this way is a variable density solution.
The vizualizations show a peel-away (iso-volumes) with various density thresholds to give an idea of the density variation through the part. There are still solid (red) and void (not shown) cells in the solution, but there are also a significant number of intermediate density cells (compare to this penalized solution which results in predominantly solid-void solutions).

The limits (either fully solid or completely void) are based on the manufacturing constraints for Shapeway's Strong and Flexible material (manufacturing constraints provide a natural way to regularize the problem so we can get unique solutions). On the low density side, the minimum diameter of the truss members is 0.7 mm. The high density limit is determined by the ratio of volume in the octet mesh to the corresponding unit cube. When this ratio reaches unity the octet cell is replaced by a cube of solid material. Shapeways recommends at least 0.5mm clearance and feature size, so clearance between truss members smaller than this is unlikely to be cleared of unconsolidated print material. Shapeways recommends an aspect ratio of 10 (length to thickness) for members. This gives a minimum octet truss cell made of members 0.7 mm in diameter and 7 mm in length; just to be on the safe side I bumped the minimum up to 0.4 mm radius and 8mm length. The maximum bounding box for a print is 650x350x550 mm.

This gist shows a python script which defines functions to generate an octet truss unit cell parameterized by the solid fraction. The solid geometry is generated in BRLCAD. This gist creates an array of octet truss primitives. The script is just a really crude way to automate mged through its command line interface (here's an example of scripting BRLCAD in Perl that uses a similar approach).

I attempted to run through this work-flow with the ToPy dogleg example shown above, but it resulted in a 7GB database file, and my poor little laptop ran out of memory trying to create an stl. I guess I have another thing to try out on GCE or AWS now. There are also file size limitations on Shapeways, so even after I generate the stl it's likely that I'll have to do some decimation to get the file size down.

### Limitations of this Implementation

The connection between density and stiffness of the octet truss cell is currently not well established. A more accurate optimization would take in to account how the stiffness of the octet truss varies as the diameter of the members varies (stiffness vs. density). This would require a bit of finite element analysis on some trusses of varying thickness with periodic boundary conditions (e.g. section 3: Microstructure Approaches in this review).

As the figure above shows, only the radius of the octet truss members is varied, but not their position. Thus, the bounding box for each radius is different. It would be more consistent to adjust the position of the members to remain within a constant bounding box as the radius is varied.

The approach outlined above does not scale to 3D problems very well with the present tools.