3D Printing Blog

I bought a 3D printer because I wanted to make a heat exchanger core for a personal heat exchanger. That's basically an assembly of interleaved folded pipes - a lot of blind tunnels that you can't make by drilling holes in something, you'd have to built in layers clued together. I thought additive machining i.e. 3D printing would be ideal.

I'd seen 3D printers for sale in Industrial Plastics in Victoria, a business I've bought a lot of glass fibre and resin from in the past. One of their staff is an expert in 3D printing and suggested that I purchase a Bambu Labs printer online, rather than any of the models in the store, saying it would be easier, that I could spend more time designing and less time getting the printer to work. So I took his advice, and bought the smallest model to get started, the A1 Mini.

So how does 3D printing work?

Unlike a drill or milling machine, which start with a chunk of material and remove some to get the final shape, a 3D printer is additive - it adds material to create the final shape.

In most printers, the material is a thermoplastic filament, dispensed from a reel. (There are some using UV-cured resin and lasers). The filament is fed through a heated nozzle, to soften it and create a 0.2mm diameter thread. The thread is squirted onto a heated platter, somewhat cooler than the nozzle, so it solidifies. The warmth of the platter keeps it sticky so it doesn't slip off. The nozzle and platter are driven in (X,Y,Z) by stepper motors. In mine, the platter with the model moves in X,Y while the nozzle moves in Z.

The nozzle moves in a pattern, to build up the shape in layers, one by one. Here's a typical layer :

The data that drives the stepper motors is G-code, similar to that used by Gerber photoplotters to make printed circuit boards, or used by numerically controlled milling machines. G-code looks like this:

M109 S200 ; set temperature and wait for it to be reached
G1 Z0.350 F7800.000 ; set height 
G1 X81.469 Y82.653 F7800.000 ; move to X,Y
G1 F1800 ; set feed rate
G1 X83.222 Y81.174 E2.07096 ; extrude to X,Y
G1 X85.374 Y80.381 E2.14192
G1 X86.554 Y80.275 E2.17858
...
G1 E1.18647 F2400.00000
G92 E0
M107
M104 S0 ; turn off temperature
G28 X0  ; home X axis
M84     ; disable motors
For my printer, as produced by the Bambu software, it also includes a lot of meta-commands for things like calibrating the platter position, cleaning the nozzle, checking the flow rate. G-code depends on the particular printer, since they have different flow rates, platter and nozzle sizes. So it's not portable.

The step before G-code is usually a 3D solid model, defined by its surface, composed of a 3-D triangular mesh. That is usually in an STL file. STL looks like this:

  facet normal -0 0 1
    outer loop
      vertex 68.864013671875 78.7690124511719 23
      vertex 70.5528182983398 75.119010925293 23
      vertex 73.864013671875 77.2290191650391 23
    endloop
  endfacet
  facet normal 0 0 1
    outer loop
      vertex 75.7530136108398 74.369010925293 23
      vertex 70.5528182983398 75.119010925293 23
      vertex 72.775016784668 71.8090133666992 23
    endloop
  endfacet
though it's usually stored in a compressed binary form.

To get G-code from STL, you run it through a slicer. Before I bought the printer, I installed one on Linux called "slic3r". However, the Bambu Studio software includes configurations specific to the printer so it was easiest to just use that. It should be possible to create a configuration file for slic3r, but I never bothered.

To create STL, one needs some kind of CAD program. Or one can download models from online libraries such as Thingiverse or Makerworld.

I have had a program Geomview since the 1990's which allows viewing 3D objects defined in an accessible text format. I'd previously written scripts to convert from Geomview OFF format to VRML, so I wrote one to convert OFF to STL and vice-versa. It's pretty similar; OFF defines shapes as a more general polygonal mesh as opposed to a triangular mesh.
I use the Linux 2-D drafting program "Xfig" for everything. It has an accessible text-based file format and I'm familiar with it. So I wrote a script to convert from FIG to OFF, using Z co-ordinates in comments. It turns out that's a fairly common concept in modelling - draw some shape in (X,Y) then extrude it in Z. So if I want a 2cm cube, I'd draw a 2cm square and then extrude it 2cm on the Z axis, splitting the squares into triangles for STL. So, draw something in Xfig, convert to OFF, see what it looks like in Geomview, convert to STL, convert to G-code in Bambu Studio and send to the printer. A bit ridiculous, perhaps, but FIG and OFF let me colour faces, which STL doesn't, and I find Geomview nicer as a viewer. If I want to make a hollow cube, for instance, I can draw a filled square in Xfig on one layer, a hollow square on another, then another filled square in another layer, define all the Z coordinates, and convert the whole thing to a 3-D OFF model. That works nicely with the heat exchanger core, which is built up in horizontal layers, with either horizontal layers or vertical walls.


Layer 44 (level 1 walls) and layer 29 (level 2 roof, with holes)


Heat exchanger layers exploded in Geomview

That worked OK for something composed of vertical rectangular prisms, but not so well for things that have holes in them, or are aren't all at right angles. It turns out that Bambu Studio supports editing in the form of adding (or subtracting) simple shapes from an existing STL file, so I was able to add holes in the side of a hollow cylinder. However, it's WYSIWYG - there's no easy way to describe the object after adding it the GUI. Bambu Studio saves files in 3MF, which is a zipfile containing STL files and odd things like PNG thumbnails of what the object is supposed to look like. It does define the primitive shapes in an XML config file, but it's not very accessible.

Based on some recommendations in a forum, I found OpenSCAD, which creates STL from a text description. SCAD looks like this:

difference() {
  minkowski() {cube([58,17,3]);sphere(1);}
  translate ([5,8.5,0]) {cylinder(r=02,h=10,center=true);}
  ;translate ([8,03,2])
linear_extrude(2) {
 text("BANDIT",font="URW Gothic"
);}}
"Cube" really means cuboid. What that describes is a rectangular dogtag 58x17mm, with a 2mm hole in one end, chamfered edges and text incised 2mm deep.

As seen in Geomview (exported as STL than converted to OFF)

The OpenSCAD GUI has a text editor and a preview pane, so I can for instance change a "5" to a "3" to move something 2mm to the left and see what it looks like.

I wrote yet another script to convert from FIG to SCAD. That maps easily using the extrusion concept polygons in Fig to polygons in SCAD.

//  floor2
  translate([0,0,0])linear_extrude(1.601) {
    polygon([[167,-24],[167,-9],[205.3,-9],[218.7,-35.49],[204.7,-42.13],[196,-24]]);}
//  wall2 lo
  translate([0,0,1.6])linear_extrude(23.001) {
    polygon([[167,-24],[167,-22],[197.2,-22],[206.8,-41.13],[204.7,-42.13],[196,-24]]);}
//  wall2 hi
  translate([0,0,1.6])linear_extrude(23.001) {
    polygon([[167,-11],[167,-9],[205.3,-9],[218.7,-35.49],[216.9,-36.31],[204.2,-11]]);}
//  roof2
  translate([0,0,24.6])linear_extrude(1.6) {
    polygon([[167,-24],[167,-9],[205.3,-9],[218.7,-35.49],[204.7,-42.13],[196,-24]]);}


Extrusion imported from Fig, with a big circular bite out of it in SCAD.


Bambu printer platter and print head


Heat exchanger core showing "tree" supports

A couple of things about 3D printing that may not be immediately obvious:

  • Most objects aren't solid. They're printed with a honeycomb interior to save filament and print time. The parameters are adjustable in the printing software. So they're lighter than they look, but still strong.
  • The printer starts printing on the platter and builds upwards. It can't create things floating in space. So either you have to orient the object so it's vertical, like a cone standing on its base, or you need to add temporary supports. Bambu Studio does that automatically if asked, either ones that look like flat-topped trees, or vertical walls. They break away fairly easily after printing. Obviously you have to be able to get at them to remove them, so you can't make a complex open space with no gaps big enough to get pliers in. You can make open spaces up to something like 3mm across, like my heat exchanger.
Andrew Daviel