Details of Marlin's feedrate calculation I want to programatically generate G-code for a (Marlin-based) Ultimaker 2+ printer, and I have been looking at the Marlin documentation and working G-code examples generated by Cura.
This has left me confused about exactly how Marlin interprets the feedrate (F) parameter in G-code commands.
If I move on a single axis (e.g. G1 F7000 X10 or G1 F200 E50), then I assume F simply says how fast that axis should move (ignoring acceleration).
On CNC milling machines I've worked with, the same is true when moving on multiple axes – for instance, G1 F1000 X10 Y10 Z10 would mean the tool moves at 1000mm/min, and therefore the individual axes are each moving at 693mm/min.  Which is good, because it means the feedrate doesn't depend on the direction of movement.
But a 3D printer has four axes (E, X, Y, Z), and Marlin only uses a single feedrate parameter.  So do I need to calculate that in four-dimensional space?  In other words,
$F = \sqrt[4]{F_E^4 + F_X^4 + F_Y^4 + F_Z^4} ?$
If that is not correct, how is the feedrate related to the feedrates for the individual axes?.
Feedrates are not 4-dimensional, and yes this makes them a bit inconsistent. But physically the 4-dimensional speed would not make any sense - for example, slowing down the E axis while speeding up the X axis would not maintain the same &quot;overall speed&quot; in any meaningful sense.
So, feedrates work differently for:

Moves with a nonzero X, Y, or Z component: the feedrate is an ideal, desired speed in 3 dimensions, possibly limited by the max feedrates of each axis (including E) individually, as well as their acceleration profiles.

Extruder-only moves where X, Y, and Z components are all zero: the feedrate is an ideal, desired speed in one dimension: the E axis, and may be limited by the max feedrate and acceleration profile for the E axis.