G-code Workshop

Pocket milling G-code

A pocket milling program removes material inside a closed outline in layers. For each layer the tool enters the material, clears the area with overlapping passes, and the last pass follows the wall to finish it. The main choices are how the tool enters, the stepover, the depth per pass and the finishing allowance.

Tool entry: plunge, ramp or helix

A straight plunge needs a centre-cutting end mill and loads the tool hard. A ramp moves down at an angle along a line; a helix moves down in a circle. Both spread the load and are easier on the tool. In CNC Pocket Cam Programmer, the rectangular pocket uses a linear ramp and the circular pocket a helical ramp.

Stepover and depth per pass

Stepover is the sideways distance between passes, usually given as a share of the tool diameter. Depth per pass is how deep each layer goes. Both depend on the tool, the material and the machine's rigidity; start conservative and increase after a test cut.

Finishing pass and cutter compensation

Leave a small allowance on the walls during roughing, then take a finishing pass along the wall. With cutter compensation (G41 left, G42 right) the control offsets the path by the tool radius stored in its tool table, so you can correct the size on the machine without a new program. Climb milling is G41 on a pocket wall followed counterclockwise; conventional is G42.

What to check before cutting

  1. Tool diameter and corner radius match the tool in the spindle.
  2. Work offset (G54 or other) and tool length offset are set.
  3. Safe Z clears clamps and the part.
  4. The toolpath stays inside the pocket in the 3D preview.
  5. Dry run, or run above the part first, with the feed override low.

Related: supported controllers, FAQ.

By Miguman, CNC machine operator, programmer and toolmaker with more than 25 years of experience. Updated .