designing of router machine

Hi there,

I'm new in the google group. I saw this electronic design group anddecided to ask some questions on design I'm currently making.

I'm designing a PCB routing machine. The machine has to accept gerber files in 274X formate. I've downloaded this (

formatting link
) tutorial about gerber files and read it all and tried to decode some gerber file by my self which I acctualy succeded to.

My problem is this. While decoding the gerber files I realized that when the gerber code tells u to draw a line, it actualy tells you (or the router bit) to pass directly on the line and not arround it. In other word, it is like if the polarity of the pcb is inverted.

please guid me on this! I wish I could know wht to do?

Reply to
debattista_5
Loading thread data ...

You need some software to generate a path around the lines and pads, preferably with cutter radius compensation (which depends on whether you're cutting left or right). Have a look around, I think you'll find some open source info on this.

Best regards, Spehro Pefhany

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

formatting link
tutorial

They already make some machines that do this. The ones I have seen work in a raster like mode when running the bit. The bit is thrust down where the copper is to be removed and up where it is to be left in place.

I assume you want to leave the bit down as much as practical and move so as to remove the copper and not cover the same area a second time.

The obvious place to start is with a giant hunk of memory all filled with zeros. As you decode the gerber file, you fill in locations with

0xFFFF. After you are done with that, you new have an image of where the traces are to go. Now we have to process it into a cutter path.

If you pass over the memory like this:

function ScanDownRight Changed = FALSE for I = 1 to MaxX-2 for J = 1 to MaxY-2 T = max(A(I-1,J-1), A(I,J-1), A(I,J+1), A(I,J-1),A(I,J+1), A(I+1,J-1),A(I+1,J),A,I+1,J+1)); Changed = Change OR (A(I,J) (T-1)); A(I,J) = T-1; next J next I return Changed end function

When you are done with this pass, the 0xFFFE values will outline the traces. The Changed variable only comes into play if you intend to remove more than one pixels worth of the copper around the traces. I assume this is the case.

while TRUE if not ScanDownRight then break if not ScanDownLeft then break if not ScanUpRight then break if not ScanUpLeft then break end while

This is basically like a flood fill but it fills in with ever decreasing values as you move away from the trace.

Now you need to know what the area is that your cutter will remove in terms of pixels. This pattern will determine which value(s) in the memory you follow. If the radius of the cutter is 2 you will follow the (0xFFFF-2) values.

Basically you want the cutter to step from pixel to pixel that has your removal value. If you are directly wired to the machine, you don't have much of a problem with data rate so you can litterally step to each pixel value.

As you cut away material, you write zeros into the locations you have done. When you can't find another value to remove on the edge of the area you just removed, you have to look for another disconnected bit to be removed. To make the code easier, I suggest you pick the bit up and move there but you could include code to look to see if it will be a short trip over an area that is filled with a value less than the removal value.

After you have removed what is the edge of the trace, you may want to make another pass making the removal area wider. If you are going to do this, you need to zero a little less area than the cutter really removes in the above step and then follow the new lower removal value.

This is probibly full of errors I haven't had my coffee yet,

Reply to
MooseFET

Not that it solves your general case, but Eagle has a script called OUTLINES that will actually produce the routing lines. Perhaps that would give you some tips.

--
Ben Jackson AD7GD

http://www.ben.com/
Reply to
Ben Jackson

hey,

thank you for the reply. I got some ideas now of ho the make the path for the raster. Only one thing. You gave me the code below:

function ScanDownRight Changed = FALSE for I = 1 to MaxX-2 for J = 1 to MaxY-2 T = max(A(I-1,J-1), A(I,J-1), A(I,J+1), A(I,J-1),A(I,J+1), A(I+1,J-1),A(I+1,J),A,I+1,J+1)); Changed = Change OR (A(I,J) (T-1)); A(I,J) = T-1; next J next I return Changed end function

I know that this code is used to generatte the path for the raster. the only thing is that i don't know exactly what is doing (example what does 'A' stands for?). I am using C# as a programming language to decode the gerber file. can you at least tell me what the code obave is doing exactly?

Reply to
debattista_5

Well there's your problem right there C# rots your brain and makes obvious bits of pseudo code hard to understand. :)

Take the gerber input and "plot" it into an image in an array. This array is called "A" for my example above. The first thing you need to do before you can start to make the path for the tool is find all of the places that are where the center of the tool will go.

The code I suggested is showing a proposed way to do this. It assumes that the copper is represented by full scale values. It makes decreasing values in the array A as you go away from the copper. I only showed the "down and to the right" version. For the best speed, you want the 4 versions I suggested. With only one version in the loop that checks "changed" each time around, a single copper dot at the lower right corner takes a long time to figure out.

One of the problems in working on gerber files is that the pad flashes and the trace runs may be far apart in the file. By converting the whole file to a raster image first, we can avoid that problems with that.

to

Reply to
MooseFET

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.