pcb2gcode with Bundgard

This is a baseline script for converting Gerber (.gbr) files from Kicad to gcode for use with Bundgard.

Isolation/etching tool: 30 degree V bit or 30 degree etching tool

Cutting/milling tool: 1 mm (or change –cutter-diameter)

Isolation/etching offset (–offset) is 0.125. Can be tuned if pcb has room.

Working z-coordinage (zwork) is set at 0.0. Adjust z-coordinate after touch off (e.g. to 0.1/0.2 mm) to cut below surface (0.0 is usually a bit shallow if touched of on contact).

Cutting/milling deptch (zcut) is set at just -1.4 mm to avoid cutting into and damaging material below. You can break free the PCB and use sandpaper for finishing.

#!/bin/sh -exu
# Generate front+back mill + cut gcode
pcb2gcode \
  --back *-B.Cu.gbr \
  --front *-F.Cu.gbr \
  --outline *-Edge.Cuts.gbr \
  --drill *-PTH.drl \
  --cut-feed=128 \
  --cut-infeed=200 \
  --cut-speed=2 \
  --cut-vertfeed=128 \
  --cutter-diameter=1.0 \
  --dpi=1000 \
  --drill-feed=256 \
  --drill-speed=0 \
  --metric \
  --metricoutput \
  --mill-feed=500 \
  --mill-speed=2 \
  --mill-vertfeed=254 \
  --offset=0.125 \
  --zchange=10 \
  --zcut=-1.4 \
  --zdrill=-1.6 \
  --zero-start \
  --zsafe=3 \
  --zwork=0.0 \
  --extra-passes=1
  
# Strip tool changes from drill file
#
# notooldrill.ngc is the drill file without tool changes
grep -v "^T" drill.ngc > notooldrill.ngc

# Make outline occupy the same coordinate space as back and drill files
sed -e "s/X/X-/g" outline.ngc > flipped-outline.ngc