A GRBL-controlled laser is one of the friendliest places to learn G-code, because it uses only a small slice of the standard, and the result of each line is something you can see burned into the material. Practising here builds the same motion fundamentals used across all CNC.
The GRBL laser subset
G0: rapid move with the laser off (positioning).G1: controlled move that cuts or engraves, paired with a feed rateF.M3: laser on at constant power (set byS).M4: laser on in dynamic power mode, where GRBL scales power with speed so corners do not over-burn.M5: laser off.S: power level.G90/G91still set absolute or incremental as on any CNC.
Beginner exercises
| Exercise | What to do | What it teaches |
|---|---|---|
| Engrave a square | G1 around four sides | Feed moves and corners |
| Vary the power | Repeat changing S | How power affects the burn |
| Vary the speed | Repeat changing F | Speed versus power balance |
| M3 vs M4 | Engrave with each | Constant vs dynamic power |
| Absolute vs incremental | Same shape both ways | G90 vs G91 |
Work on scrap, at safe power, with proper eye protection and ventilation, following your machine’s safety guidance.
Why this transfers
The motion codes you practise here, G0, G1, and the G90/G91 modes, are the same ones used on mills and lathes, which is why laser practice is real CNC practice. The laser-specific part is just the M3/M4/M5 and S power control. Drill the shared codes with the common G-codes, the spindle-style codes in M03 vs M04 vs M05, and the method in beginner CNC code practice. A simple annotated program is in the most basic G-code program example. A free tool like G-Code Sprint drills the underlying codes.
Bottom line
GRBL laser G-code is a small, visible subset: G0/G1 moves, M3/M4/M5 for the laser, S for power. Practise with a square and vary power and speed. The motion fundamentals you build transfer to all CNC.
Sources
- GRBL wiki (laser mode, spindle/laser control)
- Wikipedia: G-code
- CNCCookbook: G-code and M-code cheat sheet
Frequently asked questions
What G-code does a GRBL laser use?
A small subset: G0 to move with the laser off, G1 to cut or engrave, M3 or M4 to turn the laser on (constant or dynamic power), M5 to turn it off, and S to set power. G90/G91 set absolute or incremental like any CNC.
What is the difference between M3 and M4 on a GRBL laser?
M3 runs the laser at a constant power set by S. M4 is dynamic power mode, where GRBL scales power with feed rate so corners and accelerations do not over-burn. M5 turns the laser off.
What are good beginner exercises for GRBL laser G-code?
Start by engraving a square, then repeat it changing the S power and the feed to see the effect, then try absolute versus incremental moves. A free tool like G-Code Sprint drills the underlying codes so the exercises make sense.
G-Code Sprint is a study and practice tool only. It is not a CNC simulator, machine controller, or safety authority. Always follow your instructor, employer, machine manual, and shop safety procedures.