<p>I'm not sure what you mean by &quot;XYZE combined speed&quot;, but I wonder if it's the same misconception as in <a href="https://3dprinting.stackexchange.com/questions/14668/details-of-marlins-feedrate-calculation">Details of Marlin&#39;s feedrate calculation</a>. The feedrate is a regular 3-dimensional velocity in XYZ space which is the maximum rate the printer will attempt to achieve, subject to individual axis feedrate limits (including E) and acceleration profiles.</p>
<p>In any case, the simple answer your question of how the E-axis motion is synchronized with motion in space is no different from how motion along the X-axis is synchronized with motion along the Y-axis. If X and Y motion were just allowed to take place independently up to the desired speed, with no constraint that they happen in step with one another, then the path the print head traveled would not be a straight line but (ideally) the junction of one horizontal or vertical line with one diagonal one or (with acceleration profiles applied) some approximation of that by curves. But of course the X and Y motions do take place in sync with one another. Each spatial coordinate during the move is a function of time computed by the &quot;planner&quot; logic in the printer firmware based (essentially) on the ratio of the magnitude of individual components of the move to the overall length of the move and speed.</p>
<p>In traditional firmware prior to <a href="https://marlinfw.org/docs/features/lin_advance.html" rel="nofollow noreferrer">Linear Advance</a>, the E axis is synchronized exactly the same, according to the ratio of the move completed to the whole and the total amount to be extruded. With Linear Advance, that's adjusted by an offset proportional to the current baseline (before applying LA) extrusion speed, to compensate for the filament being compressible and/or its travel path (e.g. a bowden tube) being elastic.</p>

CC BY-SA 4.0
2020-12-07T12:08:58.020Z
Thank you, this is a really helpful answer. To your first point; Yes, I was indeed making the same mistake with the feedrate calculation, so that is very helpful to have corrected. Regarding the remainder, that all makes good sense. Can I physically see the code of the 'planner' logic in the firmware? I've had a look through but can't see anything that really does what you have described above. Am I also right in thinking that the G-code only overwrites the firmware values if a value is declared? eg. if the LA value (k?) is 0.22 in the firmware, but not defined in the G-code, it's 0.22?
Sam
CC BY-SA 4.0
2020-11-10T21:00:32.323Z
2020-11-10T21:00:32.323Z
R.. GitHub STOP HELPING ICE
<p>A typical line of (depositing) G-code seems to set a maximum speed (<code>F</code>), a new position to move to (<code>X</code>, <code>Y</code>, <code>Z</code>) and a new extrusion distance (giving a filament distance for the move). The <code>F</code> is common for the line of code, and I understand gives a maximum for the <code>XYZE</code> combined speed.</p>
<p>My question is: &quot;How is the extrusion rate synchronised to the movement distance and speed?&quot;</p>
<p>The G-code doesn't seem to have enough information to deal with this, but I've tried looking at a Marlin configuration file and don't see anything obvious there.</p>
<p>To take a really basic example: A 30 mm long single filament, layer height 0.2 mm and width 0.4 mm. A basic slicer will assume 0.2x0.4x30 mm³ total volume, but for each mm of travel you want 0.2x0.4x1 mm³ to be extruded. How is it ensured that this happens regardless of travel speed, without say more being extruded in the first half of travel than the second or vice versa?</p>
<p>It feels like this is dealt with somewhere in the firmware but I don't know where to look. A 'worked' example for a desktop printer or as much detail as you dare would be absolutely perfect. If it helps, I am generally using either an ANet A8 or Ultimaker 3 with the CURA slicer using Marlin-based firmware.</p>

<marlin><ultimaker-cura><firmware><extrusion><fdm>
How is the extrusion rate matched to the movement speed?
Sam
# How is the extrusion rate matched to the movement speed?

(Asked by: username_0 on 2020-11-10)

A typical line of (depositing) G-code seems to set a maximum speed (`F`), a new position to move to (`X`, `Y`, `Z`) and a new extrusion distance (giving a filament distance for the move). The `F` is common for the line of code, and I understand gives a maximum for the `XYZE` combined speed.

My question is: "How is the extrusion rate synchronised to the movement distance and speed?"

The G-code doesn't seem to have enough information to deal with this, but I've tried looking at a Marlin configuration file and don't see anything obvious there.

To take a really basic example: A 30 mm long single filament, layer height 0.2 mm and width 0.4 mm. A basic slicer will assume 0.2x0.4x30 mm³ total volume, but for each mm of travel you want 0.2x0.4x1 mm³ to be extruded. How is it ensured that this happens regardless of travel speed, without say more being extruded in the first half of travel than the second or vice versa?

It feels like this is dealt with somewhere in the firmware but I don't know where to look. A 'worked' example for a desktop printer or as much detail as you dare would be absolutely perfect. If it helps, I am generally using either an ANet A8 or Ultimaker 3 with the CURA slicer using Marlin-based firmware.

**Tags:** marlin, ultimaker-cura, firmware, extrusion, fdm


---

## 1 answers

### Answer by username_1 on 2020-11-10. Score: 2

I'm not sure what you mean by "XYZE combined speed", but I wonder if it's the same misconception as in [Details of Marlin's feedrate calculation](https://3dprinting.stackexchange.com/questions/14668/details-of-marlins-feedrate-calculation). The feedrate is a regular 3-dimensional velocity in XYZ space which is the maximum rate the printer will attempt to achieve, subject to individual axis feedrate limits (including E) and acceleration profiles.

In any case, the simple answer your question of how the E-axis motion is synchronized with motion in space is no different from how motion along the X-axis is synchronized with motion along the Y-axis. If X and Y motion were just allowed to take place independently up to the desired speed, with no constraint that they happen in step with one another, then the path the print head traveled would not be a straight line but (ideally) the junction of one horizontal or vertical line with one diagonal one or (with acceleration profiles applied) some approximation of that by curves. But of course the X and Y motions do take place in sync with one another. Each spatial coordinate during the move is a function of time computed by the "planner" logic in the printer firmware based (essentially) on the ratio of the magnitude of individual components of the move to the overall length of the move and speed.

In traditional firmware prior to [Linear Advance](https://marlinfw.org/docs/features/lin_advance.html), the E axis is synchronized exactly the same, according to the ratio of the move completed to the whole and the total amount to be extruded. With Linear Advance, that's adjusted by an offset proportional to the current baseline (before applying LA) extrusion speed, to compensate for the filament being compressible and/or its travel path (e.g. a bowden tube) being elastic.

> **Comments:**
> **username_0**: Thank you, this is a really helpful answer. To your first point; Yes, I was indeed making the same mistake with the feedrate calculation, so that is very helpful to have corrected. Regarding the remainder, that all makes good sense. Can I physically see the code of the 'planner' logic in the firmware? I've had a look through but can't see anything that really does what you have described above. Am I also right in thinking that the G-code only overwrites the firmware values if a value is declared? eg. if the LA value (k?) is 0.22 in the firmware, but not defined in the G-code, it's 0.22?  

---

