0
$\begingroup$

I've started learning G-code for 3D printing and I'm quite confused.

I'm using an Ultimaker S5 printer and the firmware is : 5.5.12 - 20200226-UltiBot

  1. Is there a difference between G1 F1200 X188 Y92 E0.01 and G1 X188 Y92 F1200 E0.01?
  2. Most of my code looks like: G1 X[coordinate] Y[coordinate] E[num] without Z! How is this possible?! My model is a 3D-model so how come the letter Z appears about 5 times in tens of papers?

Any help would be greatly appreciated!

$\endgroup$
0
2
$\begingroup$

I haven't used every flavor of gcode or firmware, but I've never seen the parameter order be important, provided that:

  1. The G or M code was the initial entry; and

  2. Each parameter was clearly listed with one or more spaces between parameters; and

  3. No spaces were in between the parameter letter and the value.

We use a custom version of Repetier firmware to run 3D printers and Fadal CNC machines, and in every use G1 F1200 X188 Y92 E0.01 would be evaluated and executed completely identically to G1 X188 Y92 F1200 E0.01

Nearly all gocde variable values are persistent, so if Z remains unchanged because it is only specified once per layer, or if Z remains unchanged because it is explicitly specified (with the same value) on every line, there should be no difference in the behavior of the printer.

$\endgroup$
2
  • 3
    $\begingroup$ To expand a little on @Davo's answer. Any parameter that is omitted but required for movement is assumed by the g-code interpreter to have the same value in the state machine as when it was last provided. This is true for F, X, Y and Z. If the op wants to go hardcore though: nist.gov/publications/nist-rs274ngc-interpreter-version-3 $\endgroup$ – user77232 Oct 13 '20 at 20:27
  • 1
    $\begingroup$ @user77232 And E! (then it will be a move without extrusion) See the G0-G1 sources. A parser is used to parse the arguments of a command, the seen method is used to determine if a parameter is specified in the G-code command (whatever the position is), if not, the already set one from previous commands is used. $\endgroup$ – 0scar Oct 15 '20 at 6:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.