Custom Peck Drilling Toolpaths in FreeCAD Path

This article explains how to set up and configure custom peck drilling toolpaths in FreeCAD's CAM (formerly Path) Workbench. You will learn how to initialize a drilling operation, select the appropriate canned cycle or peck routine, adjust custom variables such as step-down depth and retract clearances, and verify the resulting G-code for safe CNC operation.

Step 1: Create a Job and Define the Tool

Before creating toolpaths, ensure your 3D model is active in the CAM Workbench.

  1. Click Create Job to establish your stock, coordinate system, and output path.
  2. Under the Tools tab in the Job setup dialog, add a drilling tool (e.g., twist drill) and set its diameter, feed rate, and spindle speed.
  3. Confirm that the tool controller is assigned to the current job.

Step 2: Add the Drilling Operation

  1. Select the cylindrical faces, top edges, or center vertices of the holes you intend to drill.
  2. Click on the Drilling tool icon in the CAM toolbar (or navigate to CAM > Drilling).
  3. In the operation dialog, verify that your selected geometry appears in the Base Geometry tab.
  4. Set the Depths tab values:
    • Start Depth: The top surface of the hole.
    • Final Depth: The total bottom depth of the drill point or full diameter depth.

Step 3: Select the Peck Cycle

FreeCAD maps drilling operations to standard CNC canned cycles (like G83 or G73) depending on your post-processor and cycle settings.

  1. In the operation window, navigate to the Operation tab.
  2. Locate the Peck Mode or Drill Cycle property (depending on your FreeCAD version).
  3. Select your desired cycle type:
    • Peck (Full Retract): Simulates a G83 cycle, pulling the tool completely out to the retract plane between pecks to clear long chips.
    • Chip Break (Partial Retract): Simulates a G73 cycle, pulling back only a short distance to break chips without fully clearing the hole.

Step 4: Configure Custom Peck Parameters

To customize how the peck cycle behaves, select the Drilling object in the Tree View and use the Property View (Data tab) on the bottom left:

  • Peck Depth (or Step Down): Defines the maximum material depth cut in a single pass before retracting.
  • Retract Height: Sets the clearance plane the drill returns to between pecks (essential for G83 cycles).
  • Dwell Time: If your machine requires a pause at the bottom of the hole or between cycles to improve surface finish, enter the dwell duration (in seconds).
  • Keep Tool Down: Toggle this property if you are using chip-breaking motions without returning to the clearance plane.

Step 5: Simulate and Inspect the G-code

  1. Select the CAM Job in the Tree View and click the CAM Simulator icon to visualize the operation. Ensure the drill pecks progressively rather than plunging straight down in a single move.
  2. Click Post-Process to generate the G-code for your specific machine controller (e.g., LinuxCNC, GRBL, Mach3/4).
  3. Open the output file in a text editor to confirm that the proper canned cycle (such as G83 X... Y... Z... R... Q...) or custom point-to-point pecking coordinates (Q representing the peck increment) are generated correctly according to your controller's syntax.