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?.