back to index

BMP 2 laser tool, adjusting circuitboard bitmaps for MoshiDraw laser

Problem

The market is full of cheap, 40-watt CO2 lasers. Typically they are derived from the K40 type, a cheap Chinese one known due to its electronics and especially the software as "Blue Horror". They usually use MoshiDraw, a quite atrocious but somewhat functional control software for cutting and engraving.

Circuitboards can be easily made by covering copper-clad boards with spray paint, then burning the patterns into the paint, washing off the residues and then chemically etching.

The laser requires certain minimal width of the features to burn them reliably. Otherwise it just scorches the paint, and the etching does not happen there.

Etching is another finicky process. The bath tends to underetch the copper. Any piece that provides additional margin is welcomed. The etching bath also gets spent less if there is less of copper to remove.

Soldering of contact pads also benefits from bigger-than-minuscule areas of copper. Further margin is also welcomed.

Bitmaps exported from Eagle at 1000 DPI are typically used, white for copper, black for etch.

Solution

A utility was written that takes the source bitmap and process it in several passes.

The first pass increases horizontal size of to-etch features that are too narrow, taking them preferentially from the wider areas of copper.

Other passes then grow copper areas in single-pixel increments, based on a cellular automaton; if an etch pixel is on the edge of copper, and there is more than a limit size of etch pixels in all directions, the pixel is flipped to copper.

The copper areas therefore "grow" organically into the etch areas.

bmp2laser

Example: convert input.bmp to output.bmp, using 8 iterations:

bmp2laser -i8 input.bmp output.bmp

Parameters: [-i<iterations>] [-b<MINBLACK>] [-w<MINWHITE>] <input-filename> <output-filename> Defaults: -i6 -b12 -w20

Compiling (requires libMagicWand):
cc -std=c99 -o bmp2laser `pkg-config --cflags --libs MagickWand` bmp2laser.c

Example:

A Nixie clock circuitboard, from Instructables, a contract job. The image was supplied as a PDF file, was converted to 1000DPI bitmap. The original lines were atrociously thin, subject to underetching and to even minuscule process variations. The processed circuitboard was much more robust.

Before:

After (3 iterations, -i 3):

After (6 iterations, -i 6):

After (10 iterations, -i 10):

After (20 iterations, -i 20):

After (50 iterations, -i 50):

Disadvantages:

The process destroys exact shapes. It will mangle texts and other markers. Do not use on boards that must have precision features, or at least copy the features back at postprocessing (e.g. via ImageMagick - cut parts from the source board, overlay them to the same coordinates of the processed board).

Downloads

Todo:


If you have any comments or questions about the topic, please let me know here:
Your name:
Your email:
Spambait
Leave this empty!
Only spambots enter stuff here.
Feedback: