PCB Milling

From RepRap
Revision as of 16:29, 10 October 2010 by Peer (talk | contribs) (Toolpaths found to work)
Jump to: navigation, search
Crystal Clear action run.png
PCB Milling

Release status: Concept

No image available.png
Description
Collection of software helpful for milling PCBs and their application to RepRap
License
unknown
Author
Contributors
Based-on
Categories
Electronics, PCB/Circuitry Making
CAD Models
External Link


One obvious goal of making a RepRap replicatable is getting it to make it's own PCBs or other electronic circuitries. Recent firmwares understand a pretty standard flavour of GCode, opening the door to a lot of toolpaths already existing. This page describes a few promising ones.

Software suites

While a gazillion of softwares for creating and manufacturing circuits and PCBs exists, it was surprisingly difficult to find a working combination. As RepRap is open source, we want also to use open source tools for designing RepRap stuff, of course.

All applications described claim to run on all major OSs: Linux, Windows, Mac OS X. Testing was done on Ubuntu 10.04, 64-bit version.

Eagle

While Eagle is a proprietary and closed source tool; an almost full functional, free evaluation version exists. The only limitation of the free version is the maximum size of the resulting PCBs. Eagle is widely used among hobbyists and currently most RepRap designs are made with it, too.

Eagle is helpful for

  • Schematic design.
  • PCB design.
  • Mill/Drill file creation (Gerber).

KiCad

KiCad is the rising star on the open source PCB creation sky. It's GPLv2 and in terms of features and user interface quite comparable to Eagle.

KiCad is helpful for

  • Schematic design.
  • PCB design.
  • Mill/Drill file creation (Gerber).
  • Creating offsets for isolation milling (HPGL).

Fritzing

Fritzing User Interface

Fritzing is an open source schematic and PCB editor with a user interface for mere humans. As a highlight, you can pick and place electronic components just like you'd do this on a breadboard on your real desk. The schematic editor autoroutes connections similar to the PCB autorouter to tidy them up and all three parts - breadboard, schematic, PCB - are always kept in sync.

While this application is a very promising approach, it currently lacks a serious library. However, an Eagle to Fritzing converter is in the works, so this problem might be solved soon.

Fritzing is helpful for

  • Schematic design.
  • PCB design.
  • Mill/Drill file creation (Gerber).

Replath

Replath Isolation Path

Replath is RepRap's own effort to create a PCB manufacturing application. I'm not sure about it's status, as the last Wiki edit is from October 2008 and obviously the app's name got forgotten in the recent (September 2010) discussion about how to reprap PCBs.

Replath is helpful for

  • Creating offsets for isolation milling.
  • GCode isolation milling file creation.
  • Sending the GCode file to the RepRap machine controller.

hp2xx

hp2xx is a very basic tool which can create GCode from HPGL. This is useful in conjunction with KiCad's export to HPGL outline feature.

hp2xx is helpful for

  • GCode isolation milling file creation.

cam.py

cam.py is a single-file script by Neil Gershenfeld, capable of creating GCode files for isolation milling and drilling.

PCB-GCode

PCB-GCode is an add-on for Eagle, creating drill and isolation milling GCode files directly.

Installation on Linux, Mac OS X

PCB-GCode comes as a ZIP file. Unzip all the contents into one of your ULP folders, typically $HOME/.eagle/ulp. As the file permissions in this ZIP are found to be funny, PCB-GCode wants to write into it's installation folder (*sigh*), Eagle by default links $HOME/.eagle/ulp to /usr/share/eagle/ulp, you have to correct things a bit:

sudo chmod 777 $HOME/.eagle/ulp
cd $HOME
wget http://pcbgcode.org/file.php/download/12/93/pcb-gcode-3.5.2.11.zip
mkdir pcb-gcode
cd pcb-gcode
unzip ../pcb-gcode-3.5.2.11.zip
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
mv * $HOME/.eagle/ulp/
cd ..
rmdir pcb-gcode

Perhaps there's a simpler way, but this one worked for me.

pcb2gcode

pcb2gcode is a command-line program that calculates machine toolpaths from given PCB layouts. Despite it's name, it does NOT accept unix "pcb" files, but standard gerber RS274-X and Excellon files, and creates fully EMC2-compatible RS274-NGC files.

cynbes-gcoder

Cynbe's GCoder is an early version of pcb2gcode which was found to actually work.

GCAM

GCAM Is a GUI-based tool claiming to handle Gerber files, and of course outputting GCode files.

Installation

For more detailed instructions, see [1].

Everybody except Windows and 32-bit Ubuntu users has to compile from source:

# probably apt-get install something, but here it compiled without any
wget http://gcam.js.cx/files/gcam-2010.07.27.tar.gz
tar -xvzf gcam*
cd gcam*
./configure --prefix=${PWD}/installation # install locally for now
make && make install
./installation/bin/gcam # test it!

gerbv

gerbv showing the Gerber files of an Opto Endstop

gerbv is part of the gEDA software suite and can view gerber files. This doesn't help directly, but is helpful in finding solutions and for troubleshooting.

gEDA is yet another software suite with schematic and PCB layout editor. It wasn't included in the set of preferred choices here because it requires hand-coding of text files in between usage of the different GUI tools.

Toolpaths found to work

Toolpaths found here give a full solution from the PCB editor to creation of RepRap firmware compatible GCode.

For sending GCode to the machine controller, one can use RepRap Host software or any terminal emulation software capable of connection to a real serial device in conjunction with a firmware capable of doing flow control, e.g. FiveD on Arduino.

Eagle -> PCB-GCode -> GCode

Once it works, PCB-GCode works just nicely. Type

run pcb-gcode-setup

in Eagle's command line, hit Enter, modify settings to what you need, then click "Accept and make my board". If any question dialogs appear, you can answer them always with Yes. A GCode preview will appear, type 'x' or 'q' to leave it. After that, a bunch of GCode files show up in the project's directory, which are (almost) ready to be sent to the RepRap machine.

Settings

That's already well documented, see 10bull's web page, Christoph Selig's Blog (german, but with pictures) and of course PCB-GCode's own documentation, which is part of the code distribution and typically ends up in $HOME/.eagle/ulp/docs/readme.html.

Highlights

  • Can follow an isolation path multiple times with raising offset. This is needed when using engraving tips as tools.
  • Can mill arbitrary geometries. Just put lines (wires) or arcs on layer 46 "Milling" and the appropriate GCode will appear.
  • Mills any text put on layer 46 "Milling" with a single milling vector, so text is actually readable.
  • Strategy for manual tool change included:
    1. The tool head will move to the tool change position (typically up in the air).
    2. Change the tool and fix it in a position too short for milling.
    3. Continue to run the GCode, it will stop at X=0, Y=0, Z=0.
    4. Loosen the tool a bit and let it drop onto the PCB's surface.
    5. Tighten the tool holder again and your tool should be right at the correct length.

Missing Features

  • Ability to mill larger holes with the milling tool. PCB-GCode asks for an appropriate drill for each of the used hole diameters. This eventually requires a lot of tool changes and a well sorted tool rack.
  • Ability to replace curved movements (G02/G03) with a set of straight movements (G01).
  • Ability to mill circles, rectangles or polygons. A workaround is to replace them with lines and arcs.

Toolpaths found to work partially

Toolpaths which mostly work, but lack some needed features. One example would be generation of valid isolation mill paths, but no GCode for drilling.

Toolpaths found to NOT work

Toolpaths with major roadblocks. Usually cases where promises of one software package or another just don't hold true.

Hardware Tools

A few words about useful hardware tools ...

Spindle

Obviously, you need a spindle motor. The faster this spindle is, the better. You can get away with 5.000 RPM and a lot of patience. 10.000 RPM are better, as this cuts manufacturing time by almost 50%. Professional machines have 100.000 RPM or more.

Also, the spindle's bearings should be free of play. As we're going to use mills in the sub-millimetre range, a play of 0.1 mm is already too much. Some motors reduce their play as they warm up.

Power/wattage of the motor is no point to worry about, though. The power needed to drive a 0.8 mm mill or drill is probably less than 10 Watts.

Milling tools

When it gets to milling tools, there is more than one choice. One has success with end mills, others swear on engraving tips of various sizes. The only thing all people agree about is: the non-sharp end has to fit into the spindle's chuck.

End Mills

Picture of a typical end mill

The advantage of end mills is, you can achieve higher feed rates. When driving horizontally, they do all cutting at the outer perimeter.

The disadvantage is, they are of constant thickness along the rotation axis, making them weak. Diameters down to 0.3 mm exist, but you break them by just looking sharply. Thicker diameters like 1.0 mm are already too thick to isolate between the pin pads of ICs, much less you can draw traces between such pads.

Engraving Tips

Principal drawing of an engraving tip

These don't allow feed rates as high as end mills, but due to their angle, they are relative stiff while still allowing isolation cuts down to 0.2 mm.

Opinions are different about which tool angle is the best. Some use 90 deg tools, others report best results with 60 degs, even others use exclusively 10 deg tips.

Common to this type of tools is, the isolation path gets wider the deeper you plunge the tool into the material. Accordingly, the PCB raw material has to be very flat and well leveled to the machine. Try to allow no more than 0.1 mm.

The additional widening of the isolation gap is

2 * penetration depth * tangens ( tool tip angle / 2 )

That results in 17% of the penetration depth for a 10 deg tip, 54% for 30 deg, 115% for the 60 deg version and no less than 200% for a 90 deg tool tip angle. 0.1 mm additional penetration depth means a 0.2 mm wider isolation gap in the latter case.

Judging by reports found on the net, sharper tips have a stronger tendency for burr, so - like always in life - the best angle is a compromise.

Raw Material

Raw material is usually a copper plated sheet of some isolating material and some choices exist. For the german speakers among us, there's a good comparison sheet on the net.

FR-2

FR-2 (e.g. Pertinax) is typically of dark yellow to brownish colour. Often used for cheap electronic devices, it's also the easiest one to machine. In other words, it takes quite some time until your tool becomes dull.

FR-4

FR-4 (glass fiber reinforced epoxy) is a lot stronger and is available as two-sided sheet as well. However, due to the glass fibers, even carbide tools wont last forever. Or, like some core team member said: "It eats bits like nothing".

Other raw materials

Whatever you can mill, will work, of course.

Example Circuits

Examples made on a WolfStrap

30 deg 0,2 deep.jpeg

This shows a PCB for an Opto Endstop 2.1, modified to be single-sided: path widths 0.5 mm, Restring 40% (about 0.32 mm). GCode generator was pcbgcode on Eagle, milling depth set to 0.2 mm, mill path width set to 0.36 mm. Milling tool for the paths was a 30 deg engraving tip, a 0.7 mm drill for all small holes and an 1.0 mm end mill for the bigger holes and for the outer cut.

Both PCBs are actually the same, photoshop'd together. The scanner used for making the photos puts more emphasis on the scratches than are visible in natural. The upper view shows the PCB as it came off the machine, the lower one after deburring on a grind stone (typically used for sharpening knifes). The mill paths width actually achieved is about 0.41 mm. Notably are inaccuracies due to the play of the threaded rod driven machine (see bone-shaped path to the lower left) and the tendency for a bridging chip where narrow mill paths are close enough to meet in a sharp angle (see near top center).

Examples on the Net

  • Fabio: Arduino compatible microcontroller board.