9.4.12

Retract Calibration

Besides putting plastic where you want, the other half of the 3D printing problem is avoiding putting plastic where you don't. This is easy for large, potato shaped objects, but when you want to create fine features at the resolution of the machine you need to pay close attention to settings that affect voids.
I know of at least three modules in the Skeinforge module chain that attempt to address this problem, but there are probably more. The one that comes out-of-the-box is called comb. From what I understand so far, comb works by moving the extruder over already printed parts as much as possible rather than moving the extruder over a void which would leave a thread of filament dangling. This only works to an extent since often there's no place to hide.
To illustrate, I've created a fine featured part similar to the 0.5mm Thin Wall Box. It looks like this.
Castellated 0.5mm Thin Wall Box
The dimensions are 20mm on a side, 5mm high and the walls are 0.5mm thick. The slots are 2, 4, 6, and 8mm wide and 4mm deep. This is what the part looks like when using comb and with comb off beside the normal thin wall box.
With and Without Comb
As you can see comparing the walls, comb messes up the extruded areas in addition to cleaning up the void areas. Another module in the module chain that tries to fix the problem is called oozebane. From its description oozebane turns off the extruder before crossing a void and turns it on before resuming. The oozebane module is not turned on or exposed by the Cura software.

The module that is exposed in Cura is dimension. The dimension module converts the simple extruder on/off codes (the obsolete M101 and M103 codes), that are carried through the module chain up to that point, into the E 'dimension' values passed to the firmware. This relieves the firmware of calculating the extruder motor distances using the travel distances which involves compute intensive square root operations that the little microprocessor really doesn't have time for. It also provides a way to manipulate the extruder 'E' commands to retract filament when passing into a void by reversing the extruder motor - ostensibly to suck molten plastic back into the extruder, but more likely just to remove the latent pressure in the melt chamber. When starting extrusion on the other side of the void, it adds 'E' to perform a catch-up by advancing the filament back to where it was before the void.

The knobs you get to play with in ReplicatorG and Cura are a subset of the parameters available for the dimension module, but include the basic ones:

Dimension Parameters in ReplicatorG and Cura
What I need to find out is valid, or hopefully optimum, values for the four Cura parameters (on the right).
  • Minimum travel (mm) - the length of void path that has to be present before using retraction when jumping the void. This is not exposed in the UI of ReplicatorG.
  • Speed (mm/sec) - the speed of the extruder motor when doing the retraction and subsequent catch-up to start extruding again. This corresponds to Extruder Retraction Speed (mm/s).
  • Distance (mm) - the amount of filament to draw back and catch-up when doing a retraction. This corresponds to Retraction Distance (millimeters).
  • Extra length on start (mm) - the amount of extra filament to extrude when doing the catch-up. This corresponds to Restart Extra Distance (millimeters).
But first, I need a good test case. Part of the reason that comb-off print looks as bad as it does for this example is because there is a prior module called inset that behaves badly with small features. It's algorithm works well for large areas, but small features drive it nuts. The algorithm has two phases, one that does the actual insetting, and another that tries to simplify extrude paths that lie basically on top of one another. It works well for the thin wall box, but not so well for the castellated version. Here is a picture of what it does.
Inset Algorithm.
By way of explanation, the image is of just one corner of the castellated box on a layer above 1mm, so the inset is a 1mm wide rounded corner L shaped polygon (0.5mm wall thickness less 0.2mm of inset on both sides = 0.1mm) down the center. Overlayed on top of that are the algorithmically "widened" edges in two flavours - narrow diamond shapes and thicker hexagonal shapes. As it processes the polygon edge by edge, subsequent segments running through these "widened" areas are removed - identified in red. This leaves the magenta segments to be printed - which is a problem. The problem is well illustrated by the (excellent) GCode viewer built into Cura, as the mess on the left.

Before and After GCode using Cura
The red lines are extruding, and the blue lines are move operations. As you can see the extrude paths remaining after the inset algorithm finishes leave no choice but for large numbers of void jumps to and from the corners (where the magenta paths start and end).
One of the huge benefits of open source software is the ability to go in and fix a problem. It's also one of the drawbacks, because it can be an incredible time sink. After quite a while of looking into the code, I eventually gave up trying to fix it and wrote my own module. The result is shown on the right.

So, on to the calibration.

Varying the retraction distance first, I observed that only with retraction distances greater than 0.4mm or so did the small 2mm slot start to open up. I think this is because of the hysteresis built into the system with the filament rattling around a bit in the Bowden tube, compression of the filament, gear backlash in the extruder, etc.

Retract 0.4mm distance, 0 extra, 13.5mm/sec speed, 0.1mm layers, PLA, 200°C, 25mm/sec feedrate

There is also a noticeable thickening of the wall before and after the void where the extruder pauses to retract and catch-up. This may be able to be fixed if the firmware can handle changes to the extruder while travelling so that the retraction can begin before the movement finishes.

There are also diagonal sprue like artifacts that grow where the plastic snot rubs off in mid void. These are very weak and may pose no problem other than having to be cleaned up manually.

The wall thickness is also reduced from 0.48mm to 0.30mm, which indicates the extrudate isn't catching up after the void.

Varying the retraction speed has surprisingly little effect, other than to make the print speed slower or faster, so I recommend making it as fast as the extruder will allow, say 40mm/sec - since the maximum speed is 45mm/sec according to the firmware.

Increasing the extra length parameter causes the wall thickness to increase back to the nominal thickness (as for the thin wall box without the slots) with only a very small value, e.g. 0.025mm at a retraction distance of 0.6mm and 0.035mm at a retraction distance of 1.0mm.

So it seems the parameters I'll use in the future are:

  • Minimum travel (mm) - 1.0mm (default).
  • Speed (mm/sec) - 40mm/sec (maximum).
  • Distance (mm) - 1.0mm (to remove hysteresis).
  • Extra length on start (mm) - 0.035mm.


Retract  0.8, 0.9 and 1.0mm distance, 0.035 extra, 40mm/sec retract speed, 0.1mm layers, PLA, 200°C, 25mm/sec feedrate
This is still not ideal, but I think it's better than it was.





3.4.12

Cura

I've been struggling for a while (besides being out of town) with the open source ReplicatorG software used in conjunction with the Marlin/Sprinter firmware. It seems that there isn't a fork of ReplicatorG being maintained for the Ultimaker community, so if you choose that route (as opposed to buying software like Nettfab) you are pretty much on your own.

Now admittedly, a lot of the time was spent trying to understand the new open source development paradigm around Git and Github, but my progress was almost zero and I was getting pretty down-hearted.

Then I saw Florian's post about Cura and leaped on it. I'm glad to say the results were quite good.


I was a bit put off by a disconnect between the E (extruder axis) scale and the usual Marlin/Sprinter scale.
From what I understand, the E axis had always in the past been the amount of "filament", i.e. 2.9mm diameter input to the extruder. Then somebody in the Marlin/Sprinter group decided that wasn't correct - I don't know who - and started defining the E value as the amount of "extruded" plastic, i.e. 0.4mm diameter hot output from the extruder.

Obviously there's a ratio of 50 between the areas of the filament and the extrusion, so if you aren't careful, your slicer will generate G code that will drive the extruder too hard (and back up plastic into the Bowden tube, see Nozzle cleaning) or have nothing being extruded at all.

To get the firmware and the slicer to agree, Cura makes a custom firmware based on the Marlin/Sprinter source. It's important to use the Cura feature that updates the Ultimaker firmware. And then the generated G code has E extrusion values in the old fractional values and uses a calibrating M92 code to set the steps per unit of E (for me it was calibrated at 848.17073123).

The really annoying thing is these calibrated values are not stored in the profile.ini file for the program, but some secret as-yet-undiscovered location.