As the scripts are a bit hidden in this post, check them out on GitHub.
Once the Dremel is on the machine, milling wood is pretty much a matter of converting a 2D drawing (e.g. stored as DXF) to Marlin compatible GCode. The weapon of choice here seems to be a program called dxf2gcode. What that program outputs however, is not directly suited for feeding it into the MendelMax:
- comments: comments are surrounded by parenthesis, whereas for this use they’re single-line comments starting with a semicolon.
- feed rate: feed rate is set using an F command (e.g. F400), whereas for the RepRap it should be a G1 expression (more like G1 F400)
- unsupported commands: As the generated GCode is designed for real CNC milling machines, several specific commands have to be issues such as starting the cooland flow or getting the spindle up to speed. As such commands could confuse the RepRap (not checked, just assumed) we should filter them out or replace them with more suited counterparts.
- different movement commands: dxf2gcode produces G0 for initial positioning, whereas moving a RepRap works with G1 commands.
- different use of whitespace: typically GCode seems to be written so that there is no whitespace between the code character and numeric data. dxf2gcode however, produces whitespace where they typically aren’t. That whitespace makes the output look nice, but again might not work so well with a RepRap.
All those steps are implemented in a little script on GitHub.
Drilling PCBs is something easy to do at first glance. It turns out, however, that aligning the layer mask with the drilled holes is a delicate issue. So far I’ve achieved the best results using the following steps (in that order):
- Export an excellon drill list from EAGLE using the CAM Processor excellon.cam script
- Convert the exported Excellon file (probably ending with .drd) to GCode using this script from GitHub.
- Drill the holes using the generated GCode
- Print the mask, cut it out and align it with the drilled holes
- Transfer the mask (toner transfer, UV exposure) and etch the PCB
Usage: gcodeutils/excellon2gcode.rb [options] drillfile.drd outfile.gcode -s, --start STARTPOINT The start point of the printer, format [XX]x[YY] [mm] -f, --first FIRSTPOINT First drill point to go for and equate to zero, format [XX]x[YY] [mm] -m, --mil2mm Translate units from MIL to MM -i, --invert-xX Inverts the x axis -t, --travel-height HEIGHT The travel height in mm -d, --drill-height HEIGHT The drill height in mm -r, --rotate ANGLE Rotates the holes by ANGLE degrees --preamble FILE Prepend the preamble from FILE -p, --postamble FILE Append the postamble from FILE -v, --verbose Produce verbose output -g, --gnuplot Plot the drill holes on the console -h, --help Display this screen