Saturday, April 16, 2011

Calculating the Flow Rate value

The Flow Rate setting under the Speed menu in Skeinforge appears to be the first key to getting high quality prints. However, it’s still a bit of a mystery to me. From what I have read, the aim appears to be to vary the Flow Rate until the layer height is equal to the Layer Thickness setting in the Carve menu while at the same time creating a layer width equal to Layer Thickness multiplied by Perimeter Width over Thickness ratio (both in the Carve menu).

The settings for these values I have selected are Layer Thickness = 0.4mm, Perimeter Width over Thickness ratio = 1.8. This means that the perimeter filament width should be 0.4mm x 1.8 = 0.72mm wide.

So the aim of adjusting the flow rate setting is find the value of flow rate that creates both a layer height of 0.4mm and a layer width of 0.72mm. This can be a tedious task of printing multiple test structures and accurately measuring the width and height of the resulting object – there has to be a way to calculate the values without all the trial an error.

Working through the Physics:

Let’s consider a situation where the extruder is stopped over the bed and the nozzle is 0.4mm above the bed. The nozzle extrudes filament at 0.5mm:
Minimum Filament Extrusion to Fill the Space Under the Nozzle:

Figure 1: Nozzle Extruding Minimum Amount of Filament to Fill Space under Nozzle

The minimum volume of filament deposited in this situation is :

 = 0.07854mm3

Creating the Required Extrusion Profile:

To get the required filament width we need to extrude more filament than the minimum so that it is forced to spread out under the nozzle and create a wider trace. The Layer Thickness should always be 0.4mm as the filament will be trapped by the nozzle head and it is unlikely to end up thicker than this height – so we don’t need to worry about the Layer Thickness. It could conceivably get thinner if the flow rate is too low, as it will get stretched as the extruder head moves.

Figure 2: Nozzle 'over-stuffing' to Create Wider Trace under Nozzle

The volume of this squashed filament can be calculated by approximating the cross sectional area and multiplying by the length. The cross-sectional area looks roughly like this:

This area can be calculated as:

H = 0.4mm and W = 0.72mm
Therefore, A = 0.253664mm2

The volume is therefore A x L = 0.37933 x 0.5 = 0.12683mm3

So, to extrude sufficient filament to create the oval cross section, for every millimeter the extruder travels, the extruder needs to extrude 0.12683/0.07854 = 1.6148mm (Something I will refer to as the Volume Ratio)

Setting up the Flow Rate:

Now we need to find a flow rate setting that creates a GCode file that attempts to extrude 1.6148mm of filament for every 1mm of extruder travel.

The easiest way to do this is to set an arbitrary Flow Rate value and create a GCode file. Then look at pairs of G1 codes to calculate the length the extruder head moves and compare it to the extruder E-values. To calculate the distance the extruder head moves:

GCode Fragment:

G1 X91.08 Y89.73 E34.7135
G1 X89.73 Y91.08 E37.801

Calculating Extruder Travel:

L = [(89.73 – 91.08)2 + (91.08 – 89.73)2]0.5
L = [-1.352 + 1.352]0.5
L = [1.8225 + 1.8225]0.5
L = 3.6450.5
L = 1.9092mm

The Extruder head is moving 1.9092mm from (91.08, 89.73) to (89.73, 91.08), at the same time the extruder is being told to extrude:

E = 37.801 – 34.7135 = 3.0875mm of filament

So the extruder is outputting E/L mm of filament per mm traveled.

E/L =3.0875/1.9092 = 1.617

In this example, the Flow Rate setting that was used to generate this GCode file is set perfectly. But, if E/L is too high, decrease Flow Rate and re-run the GCode generation and calculation. If E/L is too low, increase the Flow Rate and re-run the GCode generation and calculation until you get the right value.

I have written a Python script that performs the calculations on the whole GCode file to make things simpler when trying to find E/L.

I’ve also found that multiplying the Volume Ratio by 547 yields the correct Flow Rate value.

Test Print:

With my parameters, the Flow Rate value works out to be 880. When I create a GCode file of a test object with this value and print it on my Mendel I get very high quality print results as shown below. The width of the filament varies between 0.71mm and 0.78mm based on a dozen measurements around the perimeter, with the average value being 0.74mm – just marginally bigger than my required 0.72mm.

Figure 3: Side View of Test Print Hollow Cube

The bottom layer fill is very full without being over-filled. The inner-layer fill still needs a bit of work, it appears that the overlap settings aren’t quite right as the inner fill disrupts the outer layers on solid objects. I think that I’ll reduce the Infill Perimeter Overlap, I’m also going to add an extra shell on all layers to give an extra thick shell on the outer layers to try and keep it as neat as this test print.

Figure 4: Bottom Layer of Test Print Hollow Cube - A little over-filled in one corner.


  1. Wow man, what an excellent and in depth guide on how you calculated this stuff. Very impressive, my only regret is that I read this on my work break, so now I have to wait until I get to implement it at home XD

    Seriously, outstanding.

  2. Agreed, would be nice to also see the python file.