I want to know the math behind how Slic3r calculates E values. $E_{value}$ represents amount of filament in mm (unless volumetric extrusion is selected) that has to be fed into the hotend to obtain a road of specific extrusion width.
Consider an example with following parameters:
- Nozzle diameter = 0.6 mm
- Layer height = 0.35 mm
- Extrusion width = 0.61 mm (for external perimeter)
- Length of the line segment (distance of the deposition path) = 98.2 mm
- Diameter of filament = 1.75 mm
First part of the question: How is $E_{value}$ calculated for this case?
Second part of the question: How is velocity of extruder motor calculated for this case?
The Slic3r manual has limited information on flow math but is not comprehensive.
Let's assume volume of plastic fed in equal volume of plastic comes out
$$Volume_{in} = \pi\times{(\frac{d}{2})}^2 \times E \times x = \frac{\pi\cdot d^2}{4}\times E \times x$$
Where,
- $d$ = diameter of the filament
- $x$ = extrusion multiplier
- $E$ = $E_{value}$ to solve for
$$Volume_{out} = (A_{road} \times L)$$
Length of path, $L$, is obtained from start and end coordinates
Area of the road, $A_{road}$, is calculated according to this link (Slic3r flow math; Section: Extruding on top of a surface). The formula for area of the road according to Slic3r manual is:
$$A_{road} = (w - h)\times h + \pi\times{(\frac{h}{2})}^2 $$
Where,
- $w$ = Extrusion width
- $h$ = layer height
Seems like I am missing something. Math doesn't yield me same result as Slic3r $E$ value.
Many of you have marked this question duplicate. I know the first question is similar to what has asked before (calculating E value) but the answer doesn't match actual E value in G-code.
Also there is a second question on how to calculate extrusion speed given an E value
I have added G-code from actual Slic3r with the same settings as above to check the math.
The advance extrusion width settings in slic3r are as shown in the picture below: The settings are from a Prusa config for 0.6 mm nozzle
Consider a 100 mm x 100 mm x 5 mm part (X x Y x Z dimensions). Following is the output G-code from Slic3r:
; generated by Slic3r 1.3.0 on 2019-06-04 at 16:36:24
; external perimeters extrusion width = 0.61mm (6.55mm^3/s)
; perimeters extrusion width = 0.65mm (10.54mm^3/s)
; infill extrusion width = 0.70mm (15.25mm^3/s)
; solid infill extrusion width = 0.65mm (8.78mm^3/s)
; top infill extrusion width = 0.60mm (6.43mm^3/s)
------ Values of parameters defined in Slic3r -------
- first_layer_acceleration = 1000
- first_layer_bed_temperature = 60
- first_layer_extrusion_width = 0.65
- first_layer_speed = 30
- first_layer_temperature = 215
- first_layer_height = 0.35
- max_print_speed = 100
- nozzle_diameter = 0.6
- external_perimeter_extrusion_width = 0.61
------ some initialization lines above --------
G1 F1800
G1 X78.400 Y169.100 E8.21483 ; perimeter
**G1 X78.400 Y70.900 E8.21483 ; perimeter**
G1 X176.600 Y70.900 E8.21483 ; perimeter
G1 X176.600 Y169.010 E8.20731 ; perimeter
G1 X177.175 Y169.675 F10800.000 ; move to first perimeter point
The above code snippet refers to the perimeter of the very first layer in the print. Let us consider the highlighted line in above G-code. According to equations we have above, the values of the variables are:
- $d$ = 1.75
- $x$ = 1
- $E$ = $E_{value}$ to solve for
- $w$ = 0.61
- $h$ = 0.35
- $L$ = 169.100 - 70.900 = 98.2
Area of the depositied road is:
$$A_{road} = (0.61 - 0.35)\times 0.35 + \pi\times{(\frac{0.35}{2})}^2 $$ $$A_{road} = 0.187211 mm^2 $$
For calculating $E_{value}$, We use volume equality
$$Volume_{in} = Volume_{out}$$
$$E_{value} = \frac{A\times L \times 4} {\pi\times d^2 \times x} = \frac{0.187211 \times 98.2 \times 4} {\pi \times 1.75^2 \times 1} = 7.6432 $$
The $E_{value}$ in the G-code is 8.214
This is a big difference isn't it? I know about the die swell effect and expansion of molten plastic at the tip, but there seems to be no uniform compensation factor for this!