G-code is the language the machine understands. The app generates it from your drawing; you do not need to know it. If you want to understand what the machine does or check a file from elsewhere, you find every command Grbl 1.1 knows here, plus the extensions of grblHAL and FluidNC.
The parts
- G commands: motion, planes, units, coordinate systems, probing.
- M commands: program flow, spindle, coolant.
- Other G-code words: X, Y, Z, F, S, I, J, K, P, R and others.
- Controller $ commands: read settings, homing, unlock, jogging.
- Real-time commands: status, hold, resume, reset, overrides.
- Settings $0 to $132
- Alarms
- Error messages
Reading a line of G-code
G1 X40 Y25.5 F800
G1 means “move in a straight line at feed rate”, X40 Y25.5 is the target in mm, F800 the speed in mm/min. Many commands stay in effect until another one comes; the next line may therefore just say X60.
A short program
G21 G90 (millimetres, absolute targets)
G0 Z5 (rapid to 5 mm above the material)
M3 S12000 (spindle clockwise, 12000 rpm)
G4 P2 (wait 2 s until it spins)
G0 X0 Y0 (to the start)
G1 Z-1 F300 (plunge 1 mm)
G1 X50 F800 (cut)
G0 Z5 (up)
M5 (spindle off)
M30 (end of program)
Text in round brackets is a comment.