Micron units in G-Code
I now try to use Gerber files as G-code for Emc2 controlled mill, modified to use as solder paste disperser.
The Gerber code, at middle, looks like this
*snip*
G54D57*
X232410Y196850D3*
G54D65*
X248920Y120650D3*
Y123190D3*
X119380Y125730D3*
X121920D3*
Y146685D3*
X119380D3*
X114300D3*
X116840D3*
X113030Y194310D3*
*snip*
I also don't have skill to write parser which inserts decimal points into values. But i probably have enough skill to replace in text editor all D3*'s to subroutine call which makes solder paste piece.
So the question is, can I tell Emc2 to use micron units, OR, is there any scaling function present which i can set to 1:1000 once (probably in G-code)?
I also not found on the web any translators Gerber to G-code usable for this simple task.
Thanks=)
Please Log in or Create an account to join the conversation.
gcam.js.cx/index.php/
sourceforge.net/projects/gerbertogcode/
www.brusselsprout.org/PCB-Routing/
Please Log in or Create an account to join the conversation.
I try now to use it.
But gcam is constantly segfaults
2nd program is work. But 2nd and 3rd prorgams are intended to 'isolation routing', it is not what i search, i need something much more simple
So i try to use standard software like OpenOffice, to process my Gerber code.
I add decimal point in Calc, and auto-replace some codes according to G-code rules in Writer (a bit tricky: '\n' acts as line delimiter in RegExp autoreplace mode). Only i add to g-code are header, footer and small routine to place paste pieces. It was quick and conforms to KISS rule Drop me a line if you need details.
But the result i still can't use due to too many long X-Y jogs present (i.e., components not grouped). I will try to solve it... But i hope it is already very useable for people who has air compressor and electrical valve for control of paste flow - you just place valve relay control in subroutine.
Please see example picture
(example output)
X178.054Y135.382
O100 call
Y137.922
O100 call
X186.690Y121.920
O100 call
Y119.380
O100 call
Y137.160
O100 call
Y139.700
O100 call
Please Log in or Create an account to join the conversation.
Unfortunately, i can't tune my old pirated pcb software to output gerber files in millimeter units.
No problem, just use mm, but alter the EMC2 INI file so that the axis scale factors are 1000x bigger.
Please Log in or Create an account to join the conversation.
OK, a Gerber file contains coordinates with suppressed decimal point, and leading zeroes suppressed.Hi!
I now try to use Gerber files as G-code for Emc2 controlled mill, modified to use as solder paste disperser.
The Gerber code, at middle, looks like this*snip* G54D57* X232410Y196850D3*
(That's easier to handle than the Excellon files where the tradition is TRAILING zeroes suppressed!)
Still, a Gerber doesn't draw a component pad, it goes to the center and flashes the selected aperture.
Maybe all you are looking for is center of the pad, which is what is in the Gerber command.
Anyway, I think what you want to do is write a program in your favorite computer language that
reads in the whole Gerber file and picks out the Dxx aperture commands (to know pad size) and
the D3 lines (which I think are the flash commands for the pads). Ignore the D1 and D2, those
are the write line on and off commands, if I recall correctly. But, keep the coordinates of all lines,
as a flash command may allow a previous X or Y coordinate to remain without rewriting it.
Then, produce your G-code for the paste dispenser, maybe even doing a sort to reduce
paste printing time.
Jon
Please Log in or Create an account to join the conversation.
It looks exactly what i need! But i have some problems with it:just use mm, but alter the EMC2 INI file so that the axis scale factors are 1000x bigger.
I found in my-mill.ini these values: (only one axis shown for example)
[AXIS_0]
MAX_VELOCITY = 16.0
MAX_ACCELERATION = 1000.0
STEPGEN_MAXACCEL = 1250.0
SCALE = 266.666666667
MIN_LIMIT = -1000.0
MAX_LIMIT = 2000.0
2. This method is now requires to use two different ini files for different tasks. It is not excellent, while it still much more simple than processing Gerber file in OpenOffice Calc to get decimal points in it. So thank you for this solution!
Ideally i may need some G-code command for set scaling, but i still can't found it: it looks non-industry-standard for professional fab use of G-code. Maybe in far future, it can be realized in Emc2's G-code for DIYers
Yes, it is only i need take from Gerber file.Maybe all you are looking for is center of the pad, which is what is in the Gerber command.
I take all possible skills i have to avoid any custom programming and thus make my research/solutions not only simple, but also useable for most other usres. But, unfortunately, i found that i can't avoid programming now, because ofAnyway, I think what you want to do is write a program in your favorite computer language
This sort (grouping of components to limit max jog length) is looks to be required for me, because i have free-running solder paste flow from needle. It is may not required for people who use switched paste flow.maybe even doing a sort to reduce paste printing time.
So i now start C programming. While writing in C is a headache for me, hope results can be useful in community. Maybe real programmers can help me with two tasks:
1. Take Gerber string like X248920Y120650D3*, Y123190D3* and pull one or two values from it into float variables;
2. Has anyone an idea about minimizing jog paths algorithm? It is like a task about tourist's shortest way?
Thanks for your support!
Please Log in or Create an account to join the conversation.
1. When i change (multiply) it all by factor of 1000, i probably get Emc2 working in microns domain, but, now i can't anymore use [+] and [-] manual jog buttons in Axis GUI, they are now 1000x times slower.
Have a look at INCREMENT in the INI file.
www.linuxcnc.org/docview/html/config_ini...5BDISPLAY%5D-section
(You probably also want to change the default jog velocity too)
Please Log in or Create an account to join the conversation.
I almost done a small C program to optimize jogs a bit. While C programming is a big headache (>90% of time is hair tearing solving tasks like why strcpy not work or why variable named 'mm' works like null device), i still get some useful results. It contain Gerber parser also, so i not need anymore to turn Emc2 to work with microns. (How to mark topic as [Solved]?) I keep the code as simple and small as possible, so i hope it will be useable by others for paste or even drilling the PCB. The optimizer must minimize total path length (it's what others want), but, as side effect, result shows almost all individual jogs good enough (it's what i want).
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I also test it on other pcb's and get very nice results, these are production-quality and quantity, i already put these pcb's in my radio stations and turn it on. (pick'n'place was done too and it of course EMC-controlled; there is not too much of programming because of optimizing almost not need; if anyone need then i publish my C code.) I was impressed how quality and precise is EMC-controlled hardware work! Thank you developers for such a quality software suite!
Please Log in or Create an account to join the conversation.