Programming Keyhole Router Bits on a CNC: The Reverse-Path G-Code Method

A keyhole router bit cuts a hidden wall-hanging slot by plunging straight down, traveling forward to expand the undercut, pausing to clear chips, then reversing along the exact entry path before lifting the Z-axis. This reverse-path requirement prevents the fragile neck of the T-slot cutter from binding or snapping during the retract.

Why Keyhole Bits Require Specialized Motion

Keyhole bits—also called T-slot bits—have a narrow shank that transitions to a wide, undercutting head. The head cuts a slot wider than the neck, allowing a screw head to slide in and lock the workpiece to the wall. This geometry is efficient for hidden mounting but creates a structural vulnerability: the neck is the weakest point.

If the toolpath follows a standard 2D contour or pocket routine, the CAM software may attempt to lift the Z-axis in the middle of the slot or travel laterally while retracting. This lateral motion while the wide head is engaged in the undercut will bind the neck against the wood, often snapping the bit or tearing the workpiece.

The solution is a kinematic sequence that respects the tool's geometry:

  1. Straight vertical plunge at the slot head

  2. Linear forward pass to cut the full slot length

  3. Dwell pause to allow chip clearance

  4. Exact linear reverse along the entry path

  5. Z-axis retract only after the neck is clear of the undercut

Anatomy of a Keyhole Bit

Understanding the bit's physical structure explains why the toolpath must be programmed this way.

Feature Function Motion Constraint
Narrow shank (1/4" or 1/8") Clamped in the collet; transmits spindle torque Must remain centered in the plunge hole
Wide cutting head (typically 1/2" or 12.7mm diameter) Cuts the undercut slot for screw-head clearance Cannot pass through the narrow neck hole
Transitional neck Connects shank to head; structurally weakest zone Must not experience lateral load while engaged in the undercut

The wide head creates a slot that is wider than the entry hole. Once the head is fully seated in the undercut, the only safe exit is to reverse directly back through the path it just cut, ensuring the head aligns with the narrow neck hole before the Z-axis lifts.

Programming Keyhole Toolpaths in CAM Software

Most CAM packages for desktop CNC routers—such as VCarve, Carveco, or Fusion 360—allow you to create a custom toolpath for keyhole bits. The essential step is to define a single open vector line representing the slot length, then configure the toolpath to plunge, cut forward, and reverse.

VCarve / Carveco Workflow

  1. Draw a single line representing the desired slot length (typically 1 to 1.5 inches for standard wall screws).

  2. Add the keyhole bit to your tool database with the correct diameter, shank size, and flute count (usually 1 flute).

  3. Select a profile toolpath and choose the open line as the geometry.

  4. Set the cut depth to the full depth of the undercut (commonly 0.375" or 9mm for hardwoods).

  5. Enable the "reverse direction" or "bidirectional" option if available, or manually edit the G-code to add the reverse pass.

  6. Add a dwell command at the end of the forward pass if your CAM software supports it, or insert it manually in the G-code.

Manual G-Code Method

For users who write or edit G-code directly, the sequence is explicit and reproducible. Below is a representative example for a 1.5-inch keyhole slot centered on the workpiece, using inch units and a 1/4" shank keyhole bit.

This code performs the following operations:

  • Positions the tool at the start of the slot (X-0.7500, Y0.0000)

  • Plunges vertically to Z-0.3750 at a conservative feed rate (F10.0 inches per minute)

  • Cuts forward to X0.7500 at a lateral feed rate (F25.0 inches per minute)

  • Pauses for 0.5 seconds using the dwell command ($G4\text{ P0.5}$)

  • Reverses along the exact same path back to X-0.7500

  • Lifts the Z-axis only after the tool is clear of the undercut

Speeds, Feeds, and Depths for Hardwoods

Keyhole bits operate under higher stress than standard end mills because the wide head creates significant resistance during the forward pass. Conservative feeds and speeds are essential, especially in dense hardwoods like oak, maple, or walnut.

Parameter Recommended Value Rationale
Spindle RPM 10,000–12,000 RPM High RPM reduces torque load on the fragile neck
Plunge feed rate 100–200 mm/min (4–8 IPM) Slow vertical entry prevents chip packing and bit deflection
Lateral feed rate 300–600 mm/min (12–24 IPM) Conservative forward pass reduces heat and binding
Depth of cut 0.375" (9mm) typical Sufficient for most screw heads; deeper cuts increase risk
Dwell time 0.5 seconds Allows chips to clear from the undercut before reversing

Desktop CNC routers with lead-screw or ball-screw motion systems, such as the TwoTrees TTC450 Pro CNC Router, maintain positioning accuracy down to 0.05mm. This precision is critical for the reverse-pass maneuver, as even minor lateral drift during the retract can cause the wide head to bind against the narrow neck hole.

Safety and Verification Steps

Before running a keyhole toolpath on your actual workpiece, follow these verification steps:

  • Clear chips from the plunge hole after each cut. Trapped wood chips inside the T-slot create friction and can lead to friction fires or bit breakage.

  • Visually verify the toolpath in your CAM software to confirm the cutter reverses along the exact entry path before lifting the Z-axis.

  • Run a dry test without the router bit installed to confirm the machine follows the expected motion sequence.

  • Use a sacrificial spoil board to protect your machine bed and ensure the bit does not cut too deep.

  • Wear appropriate eye and hearing protection, and ensure the workpiece is securely clamped before starting the spindle.

Machine Requirements for Keyhole Routing

Not all CNC routers are equally suited for keyhole operations. The following features improve reliability and reduce the risk of bit failure:

  • Rigid lead-screw or ball-screw Z-axis to maintain precise vertical positioning during the plunge and retract

  • ER11 or equivalent collet system capable of securely clamping 1/4" (6.35mm) and 1/8" (3.175mm) shank bits under high RPM loads

  • Stable spindle with minimal runout to prevent lateral deflection during the forward pass

  • Accurate motion control to ensure the reverse path aligns with the entry hole

The TTC450 Pro and similar models in the TwoTrees lineup meet these requirements with their precision motion systems and industrial-grade collet compatibility. 

Frequently Asked Questions

Why can't I use a standard end mill or spiral bit for keyhole slots?

Standard end mills cut a slot with uniform width from top to bottom. A keyhole bit creates an undercut—wider at the bottom than at the entry—allowing a screw head to slide in and lock the workpiece. Without the undercut, the screw head would not fit through the entry hole.

What happens if I don't reverse along the exact entry path?

If the toolpath deviates laterally during the retract, the wide cutting head will bind against the narrow neck hole. This binding can snap the bit's neck, damage the workpiece, or cause the tool to deflect unpredictably.

Can I cut keyhole slots in plywood or MDF?

Yes, but adjust your feeds and speeds accordingly. Plywood and MDF are generally softer than solid hardwoods, so you can use slightly higher feed rates. However, the reverse-path requirement remains the same regardless of material.

Do I need air assist or dust collection for keyhole routing?

Air assist is not typically required for keyhole slots because the cut is relatively shallow and brief. However, dust collection or a vacuum is recommended to clear chips from the plunge hole and prevent buildup inside the undercut.

References

  1. TwoTrees TTC450 Pro CNC Router Machine

  2. IDC Woodcraft Keyhole G-Code Example

  3. Vectric Software Keyhole Bit Tutorial – Mark Lindsay CNC

  4. Amana Tool Keyhole Speed Chart


How to CNC Mill Brass Wax Seal Stamps for Beginners

How to CNC Mill Brass Wax Seal Stamps for Beginners