Output SVG/Gcode for etching PCB?

Hello,

I’m just outfitted a laser engraver with RAMPs 1.4, and so far, so good. It will currently accept gcode from the output of Turnkey Tyranny’s laser Inkscape Plugin, using this Arduino/RAMPs FW drop. All well and good.

I’m using this method to etch PCBs. The idea is simply to cover the copper clad with spraypaint, and then use the etcher to etch away the paint to expose the copper you DON’T want to keep…Then, sit it in an acid batch, burn the copper and then run it through the laser again, this time etching away the copper you want to have exposed on the final board (pads for soldering, test points, etc.).

The problem I’m having is that when I output the SVG to inkscape (since I’m sort of tied to inkscape…that’s the input to my gcode outputter), this is what I get:

I don’t know if you can see it, but it imports as two layers, and the bottom layer is what I’m trying to train the laser on (the black). Since the plugin is expecting a path, It makes no sense since I’d be trying to turn a full blown black rectangle into a path!

Things I’ve tried:

  1. Using the Export SVG from the File Menu in KiCad

This is no good, because there’s no negative option with this…And I can’t figure out how to get Inkscape to do it in post-process…Although, it does come into inksacpe as something I can turn into a path…The problem is, the path that it creates is the copper I want to KEEP, not REMOVE, so this is no good.

  1. Using the Plot Feature in KiCad with SVG output.

This is better because it has the negative-plot option, but it outputs the picture shown above.
However, this will burn the wrong stuff, so I try to take the negative colors, as show here, and then redraw the paths…This is a mess though, because it draws a bullseye right down the center of all the tracks…It looks like it’s on the right path, but still, unsuable:

  1. Finally, I tried pcb2gcode, but that’s more for a mill, and this machine needs to see G1 (fire while moving) and M5 (stop firing) commands in the gcode to control the laser. My plan was to try to change the source code to issue those commands every time it tries to bring the spindle up or down depending on whether or not the laser should fire or turn off. However, I’m a lousy coder and this has proven to be very difficult for me.

Does anyone have any advice on how to pull this off?

Thanks!

KiCad for life :slight_smile:

Most PCB design flows create positive copper, so I would expect the downstream tools to manage polarity for Keep/Remove flip.

I would expect InkScape to manage polarity flip, but I think you want more than just simple polarity flip ?

There are CAD flows for mechanical milling of PCBs that create a outline - did you try those ?
What line-widths can your laser engraver control to ?

I’m with ya man,

I know Inkscape can flip the polarity, but I can’t get it to adhere to the lines that are drawn in black if it is flipped.

I need some way to preserve the outside of the tracks and pads…Currently, inkscape will import this as two separate…things. The pads and tracks as the white group and the black bit is a rectangle that is positioned underneath. So, although it looks good, the truth is, the black is just a background, not paths.

As I said, I’ve tried using positive copper tools like that for milling of PCBs…Those do generate G-Code, but it is not workable with a laser without modification to the FW’s mechanism for outputting G-Code.

Just to make sure I understand you correctly, but what you write ^^ doesn’t match what that dude on instructables does:

  • cover copper clad area in black enamel paint
  • “burn” enamel away with laser where you want NO copper at all (probably toxic and if not careful damages the laser)
  • etch the result of that step after prepping the board
  • burn enamel away with laser where you want NO enamel for pads/etc

As for your particular problem…

I remember when I did a print (NOT plot or SVG export) of a layout and then used a pdf generator for the final destination, that the copper pours were poly-line zones and the tracks became tracks when loaded with adobe reader.
I also remember the InkScape is able to read pdf, isn’t it?
You might check that path for viability…

I loaded that in inkscape and exploded the group, selected all and set properties for fill and stroke to flat color + 1 pix wide:

PS: I also took liberty to change your title to something more descriptive of what you want to do… otherwise people who might know about some sort of missing link for you will not see this topic… or do you publish a cooking book about blueberry recipes under the title ‘Me in an apron’? :slight_smile:

Looks like some experimenting will be needed.
How complex are these boards ?

I have noticed PcbNew is quite smart at Flood, and has a fill-by-outline mode, and if you select display outline modes, you can see the resulting paths.

Checking this, try Gerber first:

For some reason, it seems to also generate a ‘join path’ to those outlines, but those may be tolerable, and maybe you could even strip them ?

When I edit a couple, it gives this
129.1829,-109.4113
104.9302,-109.4113
104.9302,-109.4113
129.1829,-109.4113

Which is probably easy to find and strip.
Thermals geometry looks to be more an issue, in Gerber they render not as outlines, but if your designs are simple, and avoid thermals, it looks like you could use some simple code to
a) keep only fill-outline width paths (ie discard flashed Pads)
b) Strip the join paths (pair-path test) to get a workable outline-path set.

If you wanted to keep Text, using the fill-outline width would do that.
With a plane there, you could solder-bridge selected GND for shielding / lower resistance.

Next try DXF plot (DXF Plot,with Drill=Small, and then Import DXF into PcbNew to check )
- hmm, now DXF Plot looks a lot better. Even seems to manage thermals!
Gives 2 outlines on traces, and one on thermals, but probably ok for your laser engraver, depending on the line width
(here I tested with a fine 0.1mm)

See attached

Not sure I’d call that a ‘small’ drill as I expected a Drill-Dot, but maybe a drill Dot can be added, or PcbNew could be patched to use other than ‘Small’ (whatever that means ?!)
Or maybe a drill-dot can be added to a spare layer, and plotted ?
Certainly looks close enough to be usable, and could be tuned to add the drill dot ?

Can someone else try DXF plot, with Drill=Small vs Drill=Actual Size, as mine seems to be the same on both settings ? Looks like a bug ?

Maybe a bit OT (and a shameless plug)?: I have made dedicated “printer” in order to avoid such involved workflows, using a blu-ray diode. It renders a bitmap (currently bmp) to photosensitive PCBs at 1200 dpi. I plot to PDF and print the resulting file to a bitmap, then drop this onto the rendering application. I will add png-support as the latest PDFCreator printerdriver has dropped bmp from available formats. The whole project is available over at 430oh.com: http://forum.43oh.com/topic/9645-pcb-laser-exposerprinter/

I would like to add direct “printing” from KiCad to make the workflow even simpler, after more of KiCad is moved to plugin-based code?

1 Like

I have just push to github “Gerber2Gcode”,
there is many soft for “isolating” ploter.
But hardly nothing for traditional plotter, i mean mounting on the 3D printer a “water resist” pen and plotting what the etcher potion should not eat.
It accepts only “metric” file. Use the drill file to plot so that drilling by hand is made easier.

Mbeh

Use the Inkscape Gcodetools under the Extension menu. Experiment with the plugin particularly the Area tab. It is a bit tricky, but there are many youtube documentation in the Internet.

I’m not sure why this 2 year old thread is revived.
I’m also not sure If I should append, but still, here it comes:

I’m also mildly interested in stuff like this.
For lasers there seem to be 2 different ways.
1). Use black paint and burn away the un needed paint before etching.
2). Use UV curable paint and cure it with an UV laser.

A lot of different experiments are being done by different people, and they result in a lot of different software packages with overlapping effort.
“Marco Reps” is a well known youtuber who is eperimenting with this stuff.
One of the programs he uses is called “FLATcam”
https://www.youtube.com/watch?v=gm5P74vcB84

This way of the laser and plotter have a promising future. As kicad export SVG files and with a good SVG to G-CODE converter like the gcodetools plugin in the Inkscape graphic software, a pcb artwork can be both manipulated for isolation or direct print with a suitable laser or plotter. G-code commands are mean to follow lines as such suitable for pcb where resolution and fineness of line are of utmost importance. The Inkscape gcodetools plugin has a feature call Area which can break solid and bold lines into several g-code commands. This will open new possibilities for the DIYs for quick prototyping.