Close

Drilling PCB board with BCAM

A project log for BCAM - 2D computer-aided manufacturing

If you are hobbyist and existing free and open source CAM programs do not satisfy you, take a look at BCAM.

snegovickSnegovick 01/29/2015 at 12:320 Comments

Yep, let me show some kind of "hack" for drilling PCBs.

Here is a screenshot of some kicad project, we are going to work with:

Lets suppose that we drill file in excellon format and CNC machine expecting G-Code input. There is pcb2gcode project, that can help you, but it is somewhat complex to use. If you are familiar with it, then probably the way im going to describe is not for you, otherwise, follow my steps.

First lets export our project to excellon format:

Now we have a text file with drill coordinates (and instrument list, which is not very useful so far, because hobbyist machines dont usually let you use several instruments).

We want to import that file to LibreCAD, but the format of this file is not directly supported by librecad, so we want to convert it to something usable. With this one-liner we can do that:

grep ^X $1 | sed -e "s/X//" | sed -e "s/Y/, /" | awk '{printf "%s, %s, 0.0, t\n",NR,$0}' > $1.ascii
Save it as drl2ascii.sh and call like that:
bash drl2ascii.sh my_drl_file.drl
It will output stripped coordinates with some extra data needed for appropriate import by librecad:

Lets import it in LibreCAD (go to File->Import->Read ASCII points)

Press Accept and check that points are placed correctly:

Adjust position:

Now when the points are properly placed, we can save the project to dxf and import it into BCAM:

Set material thickness prior to assigning drills to points (drill depth is set to material thickness initially) and set desired tool properties (all of these are on the right panel):

Select all the points and click drill:

Now go to File->Export and save the result to .ngc file. This G-Code can be fed to your machine:)

Discussions