Scroll to navigation

PCB2GCODE(1) General Commands Manual PCB2GCODE(1)

NAME

pcb2gcode - command-line tool for engraving PCBs using CNCs

SYNOPSIS

pcb2gcode [options]

DESCRIPTION

This manual page documents briefly the pcb2gcode command.

pcb2gcode is a program that takes the files typically produced by PCB (printed circuit board) designing tools, in particular Gerber (RS-274X) and Excellon (an RS-274C variant) files as parsed by gerbv, and produces files that can be used to control a CNC (computer numerical control) milling machine. These files are in G code format (RS-274D/NGC) that can be read, for example, by the linuxcnc EMC2 system.

When these files are executed, an engraving bit is used to remove the surface from a copper covered circuit board, thus creating isolated areas. In another step, holes are drilled into the board at the appropriate positions, and it can be cut out in another step. (For each step, a separate output file is created.)

OPTIONS

These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below.

Instead of passing all options on the command line, nearly all options can be stored in a file named millproject. There, options are given one per line as option=value pairs (without the two dashes), and can be separated by blank lines and commented (everything after a `#` character is treated as a comment). Options that don't take an argument (like --metric) are entered as option=1 there.

Unless configured otherwise, numeric values are in units of inch and inch/minute. When the --metric option is given, they are in mm and mm/minute.

Engrave the front side according to the given file (typically used in two-sided boards).
Engrave the back side according to the given file.
Cut out the board to the shape exposed in the given file. Typically, there is only a polygon in this gerber file. Alternatively, this file can contain a closed line chain (see --fill-outline).
Convert the given file (containing drill sizes and positions) to G-code.

For every option --x that takes a filename, there is an --x-output option that specifies where the resulting G-code is saved, defaulting to x.gbr. Instead of giving each output file name, the --basename option can be used; the base name will be used as a prefix to the default output file names.

The parameters that define engraving are:

Z-coordinate at which engraving happens
Z-coordinate for movements between engraving steps
feed rate at which engraving takes place (horizontal speed)
spindle speed during engraving (rounds per minute)
distance by which the tool movement will be outset from the contours in the gerber file to be engraved

If this distance can't be satisfied because copper areas are too close, a warning will be printed and the line will be drawn between the areas. This behavior can be used to get voronoi-style (flood-filling) areas; simply set the offset to a large value (like 1 inch).

number of additional isolation passes

For each extra pass, engraving is repeated with the offset width increased by half its original value, creating wider isolation areas.

The parameters that define outline cutting are:

amount by half of which the tool path is outset from the shape in the outline file
Z-coordinate indicating where the outline cutting ends
feed rate at which outline cutting takes place (horizontal speed)
spindle speed during outline cutting (rounds per minute)
maximum Z distance that is cut away in a single pass (positive value; if less then zcut's value, there will be more than one pass)
If --fill-outline is given, it is assumed that the outline file contains not a polygon but a closed chain of lines. The board will be cut along the centres of these lines.
thickness of the lines that form the outline (if --fill-outline is given)

Drilling takes another set of options:

Z value down to which will be drilled
Z-coordinate for movements with the drill head
feed rate for drilling (vertical speed)
spindle speed during drilling (rounds per minute)
If --milldrill is given, the milling head will be used to drill the holes in the PCB. Holes up to the size of the milling head will be drilled regularly (possibly creating a bigger hole than intended), the other holes are created by moving the head in circles using the feed and infeed parameters used in cutting.
use the coordinates of the front side for drilling instead of the coordinates of the back side

These options govern the general behavior of pcb2gcode:

resolution used internally (defaults to 1000)
mirror operations on the back side along the Y axis instead of the board center, which is the default
export the resulting contours to an SVG (scalable vector graphics) file

The only options that can't be used in the millproject file are the common ones:

-?, --help
Show summary of options.
Show version of program.

SEE ALSO

gerbv(1), pcb(1).

For further information about pcb2gcode, see the project wiki ⟨URL: http://sourceforge.net/apps/mediawiki/pcb2gcode/ ⟩.

AUTHOR

pcb2gcode was written by Patrick Birnzain, loosely based on an earlier program of the same name by Jeff Prothero (Cynbe ru Taren), which in term was based even more loosely on Matthew Sager's gerber_to_gcode.

This manual page was written by chrysn <chrysn@fsfe.org> for the Debian project (and may be used by others).

2010-11-10