PCB Milling and Depth Probing

Post date: Jan 14, 2014 4:36:13 AM

There are a lot of things that can (and do) go wrong when trying to mill a PCB- backlash (in all dimensions), missed steps, runout, PCB design errors, variable board thickness, unaligned axes, ... LOTS of things.

The one I'm going to talk about here is variable board thickness. Even if you've got your axes perfectly aligned, and your table perfectly flat, any variation in thickness of your copper-clad board will result in a variable milling depth, and thus variable isolation path depths. Side note: In my experience, the main source of variable "thickness" is from the PCB not sitting completely flat. If it's clamped down in any way, it will tend to bow outward everywhere that isn't clamped down. A vacuum table would probably help this, though I don't have one of those (yet).

So, assuming you've got copper-clad board clamped down with two bars going across it, it'll tend to bow outward in the middle (relatively thicker), and be lower closer to the clamps (relatively thinner). This amount can be 10 mils or more (in my experience)- not conducive to nice, even milling. The actual variation in the copper-clad board thickness is closer to 1-2 mils, at least for the few samples I've taken of my own stock. What do you do about this?

What seems to be the easiest option is to probe your workpiece in a grid along the area you'll be milling, then adjust the milling depth accordingly. This works rather well- I should probably have pictures, but I don't. Conceivably, you could rig up your CNC mill to do this automatically. Since I don't have any spare IO pins, I've been doing it manually. Fortunately, it's pretty easy to do, since the milling bits are metal, and the copper-clad board is metal, so you can use a multimeter to determine when the bit makes contact with the workpiece- tedious, but not impossible. Just make sure your Z axis is precise.

Anyway, just zero the bit somewhere, then probe along the workpiece in a grid- how big is up to you. For the small boards I've been doing, 3x3 points seems to work OK enough. Save these values into a file with 3 columns- x y z. As an example:

0.0000 0.0000 0.0000

0.0000 0.5000 0.0010

0.5000 0.0000 0.0040

0.5000 0.5000 0.0045

This would be probing 4 points, with x in the first column, y in the second column, and the relative z depth in the third. The order of the lines isn't important. The entries must be evenly spaced- that is, dx and dy must be a fixed quantity (in this case, both are 0.5). Then, just edit the attached script with the desired input file, output file, and probing parameters, and you're good to go.

The script is pretty hacked-together, but it works. Assuming your milling gcode came from pcb2gcode, that is. pcb2gcode is nice in that it will break up straight lines into segments- so even if you're moving 1 unit straight along the X axis, it will create GCode telling you to move 0.1 units along the X axis, then another 0.1 units, and so on. That's terribly inefficient, but fantastic for appending depth data to each move command. That's all the script does- it interpolates based on the destination coordinates, and appends the correct milling depth to each command.