Now for the g-code generation…
I use Eagle as my PCB layout program, and pcb-gcode (a kind of “plugin” to Eagle) to generate the g-code file, though the result needs some post processing. I have older versions of Eagle (5.12.0) and pcb-gcode (22.214.171.124), so things may need to be fixed if using newer versions. You have been warned
First, I have made a new profile for pcb-gcode, that will need to be placed among the existing profiles:
pcb-gcode Vertex Nano machine profile
Then I use these settings in pcb-gcode:
Note the settings for “Z Up”, “Z Down” and “Drill Depth”. The numbers mean nothing, but they need to be different from one another, as we are going to use them in a moment.
Now click “Accept and make my board”, and Eagle will generate a .ngc file.
This .ngc file is g-code, but we can’t use it just yet (for that, I still need to do some work on the pcb-gcode machine profile).
Now open the .ngc file in an editor, one with a search and replace function. I prefer Notepad++
First, find a line near the top containing:
G00 X0.0000 Y0.0000 F9000
Change it to:
G00 X0.0000 Y0.0000 Z2.0000 F9000
(just add Z2.0000 in there). My laser is focused for use at 2 mm height.
Next, use search/replace to find all lines with:
G01 Z40.0000 F230.00
and replace them with:
The Z40 indicates that this is a “Z down” command (from the pcb-gcode settings above). This is replaced with the gcode M106 S25 that turns on the laser at 10% power.
Again search/replace all lines from:
G00 Z42.0000 F9000
This is “Z Up”, and M107 turns the laser off.
Finally do one more search/replace:
G01 Z35.0000 F230.00
Yes, two lines. In Notepad++ this can be entered as “M106 S25\nG04 P100” in the replace dialog.
This makes the drill spot marks.
That is all. Save the modified file to a SD card, and put a photosensitive PCB in the Vertex Nano.