Code Monkey home page Code Monkey logo

smtcut's Introduction

cut SMT stencils from Gerber files



GPL Python GitHub Release

About

SMTCut, previously called gerber2graphtec, is a tool for cutting accurate SMT stencils on a Graphtec or Silhouette vinyl cutter from Gerber, SVG, DXF or PDF files.

Techniques include separately drawn line segments (no complex paths), antibacklash, drag-knife-angle "training", and multiple passes.

This produces stencils usable down to approximately 0.5 mm pitch (QFP/QFN) and 0201 discrete components, or perhaps even slightly better; but it is slower than normal cutting.

Getting Started

To be able to run this software, make sure that you have installed the following dependencies:

Install on Mac OSX:

Make sure you already have installed Homebrew and simply run the following commands:

brew install gerbv
brew install pstoedit
brew install ghostscript
brew install libusb

Also make sure that you've installed the libusb1 python package or install it via

pip3 install libusb1

Usage

In general there are two different cases to distinguish depending on your operating system. Please note that this process can take a few minutes before the cutter starts to cut!

Linux

E.g. a solderpaste gerber file (paste.gbr), and default settings:

./smtcut.py paste.gbr >/dev/usb/lp0

Or a more elaborate command line with linear map (to correct spatial miscalibration) and multiple passes with different speeds and forces:

./smtcut.py --offset 3,4 --matrix 1.001,0,-0.0005,0.9985 --speed 2,1 --force 5,25 paste.gbr >/dev/usb/lp0

Mac OSX and Windows

With Mac OS X or Windows, the file2graphtec script can take the place of /dev/usb/lp0. But keep in mind that the software is tested on Mac OS X but not on Windows!

E.g. a solderpaste gerber file (paste.gbr), and default settings:

python3 smtcut.py paste.gbr > tmpfile
python3 file2graphtec.py tmpfile

Or a more elaborate command line with linear map (to correct spatial miscalibration) and multiple passes with different speeds and forces:

python3 smtcut.py --offset 3,4 --matrix 1.001,0,-0.0005,0.9985 --speed 2,1 --force 5,25 paste.gbr > tmpfile
python3 file2graphtec.py tmpfile

Calibration

To achieve the best results, one should run different calibrations, which can be found in the test folder after the blade is set. The following example shows how to calibrate the cutter on Mac OSX but the commands are also applicable to other operating systems (make sure you run these files from the main folder).

python3 tests/test_forces.py > tmpfile
python3 file2graphtec.py tmpfile

GUI

An optional GUI has been provided by jesuscf. It allows interactive selection of the input Gerber file, parameters, and cutting operations.

To use it, run the following command:

python3 smtcut-gui.py

Tips & Tricks

You may want to have your CAM tool shrink the paste features by about 2 mils before exporting to gerber. The craft-cutter knife, when cutting thin mylar, seems to spread out the geometry by about this amount. I'd suggest using mylar with thickness between about 3 and 5 mils; the IPC-recommended thicknesses for fine-pitch stencils are approximately in this range. (Typical inexpensive laser-transparency sheets happen to be just right, being somewhere between 3.5 and 4.3 mils.) You may have to experiment with the cutting speeds and forces for best quality with your materials.

For Fedora-like systems, "yum install gerbv pstoedit tkinter".

On some Linux distributions, permissions on /dev/usb/lp0 are restricted by default. To fix this, add yourself to the lp group and then log out and log back in:

sudo usermod -a --group lp your_userid

Additional Information

These pages have hints on usage (e.g. on Windows), materials, performance, calibration, etc:

Credits

Thanks to the authors of robocut and graphtecprint for protocol documentation:

Also thanks to this web page (Cathy Sexton) for inspiration:

Her cutter seems to be quite a bit better than mine was out of the box. With Silhouette's default software my 0.5 mm pitch pads were distorted to the point of unusability.

smtcut's People

Contributors

adamfeuer avatar colinoflynn avatar courcirc8 avatar fishpepper avatar foxtrotzulu94 avatar gatcode avatar jana-marie avatar jeinzi avatar linuxjedi avatar pklaus avatar pmonta avatar

Watchers

 avatar

smtcut's Issues

Win 10 cameo

Please describe Jeinzi in more detail how to install and run this script on win 10/64? I managed to start it through rawprint but all the information goes through the win buffer (print queue) as a result, the file does not completely arrive on the device. If you install this https://zadig.akeo.ie/ and choose the winusb driver, it works great with https://github.com/Timmmm/robocut but not with our script.....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.