PCB Router Machine Software Setup Guide: G-Code Generation, Cutting Parameter Calibration, and Workpiece Coordinate Alignment
The PCB router machine’s performance depends not only on its hardware (spindle, worktable, cutting tool) but also on precise software setup. Incorrect software configurations—such as flawed G-code, mismatched cutting parameters, or misaligned coordinates—can lead to defective PCBs (e.g., broken traces, incorrect hole sizes), tool damage (e.g., bent drill bits), or even machine jams. This guide focuses on three core software setup steps for CNC PCB routers: G-code generation (translating PCB designs into machine-readable instructions), cutting parameter calibration (matching speed/feed rate to materials/tools), and workpiece coordinate alignment (ensuring the machine targets the correct position on the PCB). It includes step-by-step procedures, common pitfalls, and verification methods to ensure reliable, high-quality routing.
1. G-Code Generation: Translating PCB Designs to Machine Instructions
G-code is the universal "language" of CNC machines, defining every movement (e.g., spindle position, tool depth, cutting path) the router executes. Generating accurate G-code requires bridging PCB design software (e.g., KiCad, Altium Designer) and router control software (e.g., GRBL, Mach3, UGS Platform). The goal is to convert PCB layout files (e.g., Gerber, DXF) into error-free G-code that accounts for the router’s hardware limits (e.g., maximum spindle speed, worktable size).
1.1 Pre-Generation Preparation
Before generating G-code, confirm these prerequisites to avoid downstream errors:
PCB Design File Validation:
Use PCB design software (e.g., KiCad) to export Gerber files (the industry standard for PCB manufacturing) for all layers (copper top/bottom, solder mask, drill holes). Ensure no overlapping traces, missing holes, or invalid dimensions (e.g., trace width < router tool minimum size).
Export a drill file ( Excellon format) separately—this defines hole positions and sizes (critical for routing vias or component pads).
Tool Library Setup:
In the router control software, create a tool library matching the physical tools you’ll use. For example:
Tool Type
Tool Diameter (mm)
Tool Material
Purpose
End Mill
0.15
Carbide
Cutting fine copper traces
Drill Bit
0.8
High-Speed Steel (HSS)
Drilling component mounting holes
V-Cutter
30° tip angle
Carbide
Engraving silkscreen labels
Input tool-specific parameters (e.g., maximum depth of cut—typically 0.2–0.5mm for PCB copper) to prevent over-cutting.
1.2 Step-by-Step G-Code Generation
The process varies slightly by software, but the core workflow (using KiCad + GRBL as an example) is as follows:
Step 1: Import PCB Files into CAM Software
Use a CAM (Computer-Aided Manufacturing) tool (e.g., FlatCAM, a free tool for PCB routing) to import Gerber and drill files:
Open FlatCAM and click File > Import > Gerber to load the copper top layer Gerber file.
Click File > Import > Excellon to load the drill file. Ensure the software recognizes hole sizes (e.g., 0.8mm holes for resistors).
Step 2: Define Routing Layers and Operations
For copper layer cutting:
Select the copper Gerber layer and click Operations > Isolate Traces. Set the isolation width (gap between the tool path and trace—typically 0.05–0.1mm) to avoid damaging traces.
Choose the end mill from the tool library (e.g., 0.15mm carbide) and set the cut depth (0.3mm for 1oz copper—enough to cut through copper but not the PCB substrate).
For drilling:
Select the drill file and click Operations > Drill. Match each hole size to the corresponding drill bit (e.g., 0.8mm hole → 0.8mm HSS drill).
Enable peck drilling (for deep holes >1mm) to clear debris and prevent tool overheating—set peck depth to 0.5mm (drill 0.5mm, retract to clear chips, repeat).
Step 3: Generate and Validate G-Code
Click Generate G-Code for each operation (isolation cutting, drilling). The software will output a .gcode file.
Validate the G-code using a simulator (e.g., GRBL Simulator, integrated into UGS Platform):
Load the G-code into the simulator and run a virtual cut.
Check for:
Tool collisions: Ensure the tool does not hit the worktable or machine frame (simulator will highlight red if collisions occur).
Incomplete cuts: Verify all traces are isolated and all holes are drilled (no missing paths).
Excessive speed: Confirm spindle speed and feed rate do not exceed the router’s limits (e.g., max spindle speed 30,000 RPM).
1.3 Common G-Code Pitfalls and Fixes
Pitfall
Cause
Fix
Missing drill holes
Drill file not imported or hole sizes mismatched
Re-import the Excellon file and verify hole size-tool matching.
Damaged traces
Isolation width too small (tool cuts into traces)
Increase isolation width by 0.05mm and re-generate G-code.
Tool breakage
No peck drilling for deep holes (debris clogs tool)
Enable peck drilling with 0.3–0.5mm peck depth.
2. Cutting Parameter Calibration: Matching Speed/Feed to Materials & Tools
Cutting parameters (spindle speed, feed rate, depth of cut) directly impact routing quality and tool life. Using incorrect parameters—e.g., too high a feed rate for a small carbide end mill—can cause tool chatter (vibration leading to rough cuts) or tool breakage. Calibration ensures parameters are optimized for the PCB material (e.g., FR-4, aluminum-backed PCB) and tool type.
2.1 Key Cutting Parameters and Their Effects
Parameter
Definition
Impact on Routing
Spindle Speed (RPM)
Rotational speed of the cutting tool
Too low: Poor cut quality (burrs on traces); Too high: Tool overheating (shortens life).
Feed Rate (mm/min)
Speed at which the tool moves across the PCB
Too low: Slow production + tool rubbing (heat damage); Too high: Tool deflection (inaccurate cuts).
Depth of Cut (mm)
How far the tool penetrates the PCB
Too shallow: Incomplete copper cutting; Too deep: Damages PCB substrate (e.g., FR-4 delamination).
2.2 Step-by-Step Calibration (Using FR-4 PCB + Carbide End Mill)
Step 1: Reference Initial Parameters
Start with manufacturer-recommended parameters (adjust based on your tool/machine):
Tool/Material
Spindle Speed (RPM)
Feed Rate (mm/min)
Depth of Cut (mm)
0.15mm Carbide End Mill (FR-4 copper)
25,000–30,000
100–150
0.2–0.3
0.8mm HSS Drill (FR-4)
15,000–20,000
50–80
1.6 (full PCB thickness)
30° Carbide V-Cutter (FR-4 silkscreen)
20,000–25,000
80–120
0.1 (shallow engraving)
Step 2: Test Cuts on Scrap Material
Always calibrate using a scrap PCB (same material as the target PCB) to avoid wasting good boards:
Mount the scrap PCB on the router worktable (use double-sided tape or a clamp to secure it).
Load the test G-code (a simple pattern: 10mm straight line + 2mm hole) into the router control software.
Run the test cut with initial parameters, then inspect the result:
Test Result
Parameter Adjustment Needed
Burrs on copper edges
Increase spindle speed by 2,000 RPM (smoother cut) or decrease feed rate by 20mm/min.
Tool chatter (wavy cuts)
Decrease feed rate by 30mm/min or increase spindle speed by 3,000 RPM.
Tool overheating (smoke)
Decrease spindle speed by 5,000 RPM or increase feed rate by 20mm/min (reduces tool contact time).
Incomplete copper cut
Increase depth of cut by 0.05mm (ensure copper is fully severed).
Step 3: Fine-Tune and Document
Repeat the test cut with adjusted parameters until the result is optimal (smooth edges, no burrs, no tool damage).
Document the final parameters in a calibration log (include tool type, material, date, and parameters) for future use. For example:
"0.15mm Carbide End Mill + FR-4 (1oz copper): 28,000 RPM, 130 mm/min feed, 0.25mm depth of cut."
2.3 Parameter Adjustments for Special Materials
Material
Parameter Modification
Rationale
Aluminum-backed PCB
Decrease feed rate by 20% (100→80 mm/min)
Aluminum is harder than FR-4; slower feed reduces tool wear.
Flexible PCB (PI substrate)
Increase spindle speed by 10% (25k→27.5k RPM)
PI is flexible; faster spindle ensures clean cuts without tearing.