Example program · Mill
GRBL Router: Rectangle Cut-Out in Depth Passes — G-Code Example
Cuts an 80 × 50 mm rectangle out of 6 mm plywood with a 3 mm two-flute bit on a GRBL router, in three 2 mm passes, tool centre on the line.
Cuts an 80 × 50 mm rectangle out of 6 mm plywood with a 3 mm two-flute bit on a GRBL router, in three 2 mm passes, tool centre on the line.
| Item | Value |
|---|---|
| Machine | CNC mill / machining centre (Fanuc-style) |
| Units | Metric (G21) |
| Lines | 25 |
Program
(GRBL - 80 X 50 RECTANGLE, 3 MM BIT, 6 MM PLY)
G21 G90 G17
G54
M3 S18000
G0 Z5
G0 X0 Y0
G1 Z-2 F300
G1 X80 F1200
Y50
X0
Y0
G1 Z-4 F300
G1 X80 F1200
Y50
X0
Y0
G1 Z-6.2 F300
G1 X80 F1200
Y50
X0
Y0
G0 Z10
M5
G0 X0 Y0
M30▶ Simulate in the G-code viewer
How it works
- GRBL has no canned cycles or subprograms, so each layer is written out.
- The last pass goes 0.2 mm below the material to cut cleanly through — use a spoilboard.
- For a part to the exact size, offset the path by the bit radius in CAM (GRBL has no G41/G42).
Codes used in this program
- G00 — Rapid Positioning
- G01 — Linear Interpolation (Feed Move)
- M03 — Spindle On Clockwise
- M05 — Spindle Stop
Always check feeds, speeds, offsets and clearances for your own machine and tooling, and prove new programs with single block and reduced rapid.
More milling programs
- Face Milling Program (Zig-Zag Passes)
- Outside Contour with Cutter Compensation (G41)
- Circular Pocket with Helical Entry
- Bolt Hole Circle with Polar Coordinates (G16)
- Peck Drilling a Hole Grid (G83)
- Rigid Tapping Program (M8 × 1.25)
- Internal Thread Milling M12 × 1.75
- Rectangular Pocket in Depth Passes Using a Subprogram
- Machining Multiple Parts with G54–G57
- Counterbore Holes for M6 Socket Head Screws
- Fine Boring a Precision Bore (G76 on a Mill)
- Milling a Slot with Ramping Entry
- Chamfering an Outside Edge with a Chamfer Mill
- Parametric Bolt Circle Macro (WHILE Loop)
- Spindle Warm-Up Program
- Setting a Work Offset Automatically with a Probe (G31)
- GRBL / LinuxCNC Touch Plate Z Probe (G38.2)
- Haas G12 / G13 Circular Pocket in One Line
- Haas M97 Local Subprogram for Repeated Features
- High-Speed Peck Drilling in Aluminum (G73)
- Helical Boring a Ø20 Hole with a 10 mm End Mill