Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Any way to nest existing G-Code jobs?

Status
Not open for further replies.

sp8472

Mechanical
Oct 12, 2010
29
0
0
US
I'm not entirely sure if this is even possible, and the only lead I've heard thus far was not terribly promising, but I'd like to ask here to see if there is another option.

Background: We manufacture various sizes of simple custom circuitboards as a part of our business, using a router and small milling bits to etch isolation paths to create circuit traces, and drill out the holes. We previously had a small router that was specifically intended for this purpose, which used its own proprietary software. Unfortunately, its size was quite limited and it required constant babysitting to keep changing tools, so we purchased a large format CNC router that accepts standard G-Code, and it also features an automatic toolchanger.
Our in-house programming expert put together a script that converts our individual circuitboard files directly to G-Code, so we can now run jobs on this large router.

What I'm looking for: Something that can take multiple existing G-code jobs and nest them together so that we can batch a bunch of jobs at once. (Nesting in the circuitboard software takes longer than we'd like, as the software isn't really cut out to do very large boards, or nesting.)

It doesn't need to be terribly complex or snazzy, just something that can fit a bunch of G-code rectangles and their associated artwork into a predefined area, and be able to rotate them by 90° for a better fit.

So, is this something that exists in any fashion? The one lead I got said that doing something like this requires some manner of reverse-engineering software package that'd cost >$10k. I guess in my mind, it sounds like just a bunch of coordinate math - the 90° rotation functionality aside, it's just a matter of finding the size of the first job, and then taking the second job and move its origin by a certain amount, and quick sift through the text in its code to find and alter the coordinates by the necessary amount.
We'd just prefer to find and buy something now rather than have to spend the time and resources developing yet another piece of software in-house.


Thank you!
 
Replies continue below

Recommended for you

You do not say what kind of router you have.
The canadian AXYS router has a proprietary post processor Called Toolpath that does just what you are asking.

I think what you are asking for is a nesting program.

B.E.

The good engineer does not need to memorize every formula; he just needs to know where he can find them when he needs them. Old professor
 
It is an LC-series Techno CNC router, 48x96" table. It's equipped with two spindles - one is the primary one with the toolchanger, used for routing/etching boards and drilling the holes. The other one is a larger spindle, and is primarily there for resurfacing the table as it gets worn, or for handling overflow from our other router, should that becomes necessary.
Link


I've looked around at various nesting programs out there, but any that I've seen will only import files such as DXF or 2D/3D models - none that I've seen can import G-code directly.

 
I've never seen anything software wise but to change the Gcode by hand is simple (if your programmer knows what they are doing :) ). You simply make each gcode a sub program/routine, then modify the offsets to the correct starting point and run that sub, then change the the offsets again to a different starting point and run the next sub,etc...
These are M/G codes specific for our machine so yours may differ but this basically starts at absolute 0,0 for one program then changes to absolute 5,0 for the next. In ours setting G52 makes the machine think that whatever X/Y we call out is the 0,0 point

Something like this
G52 X0.000 Y0.000
M98 P1000 (Call PCB Sub1)

G52 X5.000 Y0.000
M98 P1001 (Call PCB Sub2)

O1000 (PCB Program 1 Starts here)
Gcode here

O1001 (PCB Program 2 Starts here)
Gcode here
 
Sorry forgot the end sub

G52 X0.000 Y0.000
M98 P1000 (Call PCB Sub1)

G52 X5.000 Y0.000
M98 P1001 (Call PCB Sub2)

O1000 (PCB Program 1 Starts here)
Gcode here
M99 (End Sub 1)

O1001 (PCB Program 2 Starts here)
Gcode here
M99 (End Sub 2)
 
Ideally we'd be after something of a graphic interface.

It might end up being simpler though - maybe a non-graphic "Nest Jobs" script.

Moving them isn't much trouble - we've already got the ability to stack boards, but no ability to rotate and manipulate them otherwise.

The tricky parts:
- Rotate 90°. Sure it's not as bad as arbitrary angle rotation, but it could be interesting, as we want to be able to route out arcs.
- Automatic and reasonably efficient nesting. We could always brute-force that though. Absolute worst-case might be figuring out how to fit 8 rectangles into a larger rectangle.

In any case, I was hoping that something was already on the market to nest and manipulate existing G-Code, but it looks like what's out there all starts with a DXF file, and generates G-Code from that. We may end up having to buckle down and write our own piece of software that'll do the offsets, nesting, and rotation.

However, I'll still gladly take recommendations for software that's available off-the-shelf.
 
The router you have, should have what you want in its operating system. The preview screen should show you the shape generated by the G code program you are entering. Part of the problem you are experiencing is that a lot of the nesting programs take the printer output from the Cad program and use it to generate the G code. You are already beyond that. For what you want, some of the free sheetmetal nesting programs will give you part orientation and distance up the sheet, and you can simply alter the origin in your router for the start of the program. If you want to get more fancy, This company Jet Cam, can make you a program that will take G code inputs they call it legacy programming.

B.E.

The good engineer does not need to memorize every formula; he just needs to know where he can find them when he needs them. Old professor
 
jeff7 said:
Our in-house programming expert put together a script that converts our individual circuitboard files directly to G-Code, so we can now run jobs on this large router.
can't they make a program that converts them to dxf in stead?

NX 7.5
Teamcenter 8
 
Walterke said:
can't they make a program that converts them to dxf in stead?
Isn't a DXF just a drawing file though? Doing that, I'd think that we'd lose all of the toolpaths and tooling data that is available directly from the circuitboard software.

I've been exploring some of the options here, and a few others.
One company has some of our G-Code files, and will get back to me as to what of their software might be a match.
Most of the rest have never seen an application quite like this one. (Admittedly, this application does appear to be rather unique, as well as our present solution.)
The price estimate I've been given from this one company is "Somewhere between $1,000 and $30,000. It depends on the files."


As an aside, I've seen and used software that directly manipulates Gerber files, and they strike me as being in the same genre as G-Code. Of course, I've also got no idea how much that software package costs.
 
hm you're right. My only experience with G-codes lies in lasering, where the drawing is the most important part of the code (since lasers don't have tools).
Swapping over the dxf's would've been fast (enough) then.
With drilling tools etc, you would indeed lose a lot of information.

Would it be possible to make the nestings in the old software, and then coverting them to g-code?

More questions:

-Since you're switching from a manual tool change to an automatic tool changing machine, won't you have to 'recode' all of the tools anyway?

-Does your new software come with an option to automatically create the toolpaths?

-Even if both are G-code, aren't there brand/machine-specific differences in the code between the 2 machines?

NX 7.5
Teamcenter 8
 
The PCB software is limited in terms of its working area, and doing the nesting there requires manual rework to get the various features set up properly.

- The switch from manual to automatic occurred as a result of a machine switch, from the old router to the new router. The new router is quite different from the old one - the old one used its own proprietary interface and conversion software.
Whereas G-code is all a bunch of nice plain-text files, the CAM files that the proprietary software creates show up (quite expectedly) as gibberish in a text editor.

- The scripting solution we use creates the toolpaths from the PCB editor software. It creates various masks around the traces, and creates toolpaths based on the entered diameters of available tooling.

- See first bullet. The old way we routed circuitboards is effectively its own separate system. We switched away from that because of the limitations on working area - the old had a working area of approximately 12x30". The new is 48x96".
 
One approach I have used in the past is to program an individual part in incremental mode and position between parts using absolute positioning and call the incremental program to cut the part. If you need to turn the part 90 degrees then write another incremental program. Your program involves creating a locations where to start the incremental portions of the part cutting process.

Optinest is a nesting program which can also do what you want to do but it is pricey.
 
Our resident programming guru is diving back into Visual Basic, so it looks like we're just going to buckle down and write our own application.

He's going to strip down the individual G-code jobs to get the perimeter rectangles, then have a GUI so the operator can import the day's batch of files, arrange the rectangles by drag-and-drop, rotate 90° as needed with a right-click, then click Output, which will generate the whole nested mess of code. That can then be run as a single job.
Once that's proven out, I'm sure that the next step after that will be automatic nesting.
 
Assuming you only have to nest perfectly rectangular elements (or you nest them AS rectangular elements), it probably won't be that hard to write your own nesting program.

Do know that, as far is I know, the only way to do this is iterative. I don't think any formula exists that will allow you to calculate this. The only other option is write out every possible solution and take the best one.

In laser-nesting programs, they usually start with the biggest items and then fit the smaller ones in between those. I guess this is your best bet.

NX 7.5
Teamcenter 8
 
We have some manner of experience with "nesting" and a brute-force approach. Part of our business involves making LED signs with two overlaid messages, and it is of course important that none of the LEDs interfere with one another on the circuitboard. We've got a program that will try iterations of the board, shifting the messages around slightly until they will fit together, or at least show best-fit variations, allowing then for manual tweaking.
I have a feeling that the interface will take more time than the nesting itself, possibly with the exception of 90°-rotation functionality.

I have a feeling we'll also go with a larger-to-smaller nesting sequence.
(And yes, these will be perfect rectangles. I can think of only 2 jobs in the past several years that required odd shapes.)
 
I'm pretty sure there's a G-code that lets you rotate/replace your coordinate system.

(very quick google search suggests G68, you should check your manual).

putting that one at the front, and the on that cancels it (google says g69) at the end of a job would fix your rotation problem.
Shouldn't be that hard to program.

NX 7.5
Teamcenter 8
 
Hm...it appears that this router does not support G68 or G69 commands.

Though I'd imagine that swapping out x for y coordinates shouldn't be too terribly horrific of a programming challenge.

Updates will arrive as the program progresses.
 
Status
Not open for further replies.
Back
Top