What's new
What's new

Programming to machine an array of parts

rbmgf7

Aluminum
Joined
Oct 18, 2017
I'm curious how some of you write your programs to accommodate machining an array of similar parts.

I've done it before but I've never called my self a programmer or machinist however I have managed to get the job done.

I just downloaded a V8 engine layout but let's assume the cylinders are the parts.

How I've done it was I'd set my work coordinate center mass to the fixture. Then I'd use macros to give each cylinder/part a pseudo X0 Y0 work coordinate. I'd use subroutines so the main program (in G90) would use the macro X0 Y0 for each part and then would jump down to do the machining in the subroutine while programmed in G91.

Screenshot 2023-05-02 093723.png

Wondering what other ways there are to achieve the same?
 
If your sub program is going to be used in other programs or going to be used in many locations, I would use incremental programing.
 
I'm curious how some of you write your programs to accommodate machining an array of similar parts.

I've done it before but I've never called my self a programmer or machinist however I have managed to get the job done.

I just downloaded a V8 engine layout but let's assume the cylinders are the parts.

How I've done it was I'd set my work coordinate center mass to the fixture. Then I'd use macros to give each cylinder/part a pseudo X0 Y0 work coordinate. I'd use subroutines so the main program (in G90) would use the macro X0 Y0 for each part and then would jump down to do the machining in the subroutine while programmed in G91.

View attachment 395037

Wondering what other ways there are to achieve the same?
The same results as using a Macro Statement to alter your Base Work-shist, if you simply move the X/Y axes to the Absolute Coordinates of the other cylinders that corresponds to the X0.0 Y0.0 of the first cylinder and run your Incremental Subprogram from that point.

Lets say that the Vertical Pitch is 150mm and the Horizontal 400mm. Starting with the G54 Work-shift set to X0.0 Y0.0 of Cylinder 1, G52, what Fanuc refer to as a Child Offset, can be used as follows:

G52 X0.0 Y0.0 (NUMBER 1 CYLINDER)
G90 G00 G54 X0.0 Y0.0
M98 P1000
G52 X0.0 Y150.0 (NUMBER 2 CYLINDER)
G90 G00 G54 X0.0 Y0.0
M98 P1000
G52 X0.0 Y300.0 (NUMBER 3 CYLINDER)
G90 G00 G54 X0.0 Y0.0
M98 P1000
G52 X0.0 Y450.0 ((NUMBER 4 CYLINDER)
G90 G00 G54 X0.0 Y0.0
M98 P1000
G52 X400.0 Y450.0 ((NUMBER 8 CYLINDER)
G90 G00 G54 X0.0 Y0.0
M98 P1000
G52 X400.0 Y300.0 ((NUMBER 7 CYLINDER)
G90 G00 G54 X0.0 Y0.0
M98 P1000
G52 X400.0 Y150.0 ((NUMBER 6 CYLINDER)
G90 G00 G54 X0.0 Y0.0
M98 P1000
G52 X400.0 Y0.0 ((NUMBER 5 CYLINDER)
G90 G00 G54 X0.0 Y0.0
M98 P1000
G52 X0.0 Y0.0 (RESET TO THE BASE G54 WORK-SHIFT OFFSET)

Including G54 in each move to the next Cylinder X0.0 Y0.0 position makes it easier if you have to start again from other that Cylinder Number 1 position.

Regards,

Bill
 
  • Like
Reactions: ???
If the parts are exact distances from each other I will shift the work offset. If their positions may change some then I use separate work offsets for each part.

Here is part of a program for reference. Each sub machined 4 parts for efficiency. This is faster to set up than using separate fixture offsets for each position. Since the parts are machined from one plate there was never any fine tuning the offsets.

O1(VAC PLATE 24 PARTS)
G0G17G40G49G53G80G90X-10.Y-.1Z0
G52
G92X4.2525Y4.7555
G10Q2P1X0Y0(REMOVES ANY WORK SHIFT FOR SAFETY)
T4M6(1/4" FINISH)
G0G43X0Y0Z.1D4H4G54S2800M3
M8
G10Q2P1X0(REMOVES ANY WORK SHIFT FROM T3)
M98P4G54
G10Q2P1Y-2.58
M98P4G54
G10Q2P1Y-5.16
M98P4G54
G10Q2P1X6.25
M98P4G54
G10Q2P1Y-2.58
M98P4G54
G10Q2P1Y0
M98P4G54
G10Q2P1X0Y0 (REMOVES ANY WORK SHIFT)
 
Depends on the number of stations needed.

If I don't have hundreds of stations, I like using separate work offsets along with variables to call them up within a DO WHILE loop.

So G[#100] (or whatever variable # you want to use) would be the "work offset" and the variable value changes for each loop.

This way it is fairly easy to turn on and off stations to run only some of them if desired.

And it is nice to have all the code stay contained within the main program.
 
For a first op, you don't need the work offset to be precise, just land the part within the stock, so do whatever's convenient. I've sometimes done a 1st op on an array of dozens of parts from a solid plate of material held on a vacuum fixture. Single work offset, rough the whole batch with a high feed and "Dynamic Optirough", leave a .020" floor between parts, score with an engraving cutter to snap the parts apart. For second ops I use a work offset per part, which may need to shift a tad on occasion. I program one part, then use Mastercam's "Transform Operations" function to make subroutines and their calls.
 
It can be done in a simplistic manner also.
Write the program for the part in the incremental mode, choosing a convenient point as the first point, which will be used as the reference point. Save it as a subprogram.
Position the tool at desired points, and call the subprogram every time (the reference point of the subprogram will be at the desired locations).
 
Incremental programs can have cumulative error, especially longer ones with dynamic roughing or surfacing. I haven't used one since I was hand coding last century; there's just no need for it. It doesn't even make for smaller programs. If you want to use the same code on multiple parts without separate work offsets, just use a work offset shift as described above.
 
CAM pattern that and be done with it.

Why fiddle fart around all these offsets, and increments, and other slop designed for old timey hand programming? Unless the control is some ancient thing where I need to feed it punch cards, or it measures memory in "tape," just send the bastard a pile of code and go live the rest of your life.
 
I haven't used one since I was hand coding last century; there's just no need for it.
The last time I used it was back in 1989-1990 on a Mori-Seiki SL35.
I used to make a ton of poly vee pulleys and I had to write incremental programs and loop them in a sub for the pulley form. Separate programs for each type of groove both rough and finish.
We didn't have a computer at that time, and very few people did. So pencil,paper and a calculator was my CADCAM. I don't miss that at all, but it was a great learning experience.
These days nobody knows simple trig and they are too lazy to learn it.
 
CAM pattern that and be done with it.

Why fiddle fart around all these offsets, and increments, and other slop designed for old timey hand programming? Unless the control is some ancient thing where I need to feed it punch cards, or it measures memory in "tape," just send the bastard a pile of code and go live the rest of your life.
Well said. Unless you have a need to adjust individual parts, let your CAM system do it; takes what? 3 seconds. Done. Not to mention less room for human error. I use subs for multiple fixtures and multiple vises when it's appropriate but I never create multiple work offsets for my fixtures that hold many small parts.
 
@rbmgf7 The way you describe would work just fine. One way I tackled a similar layout was, I used G10 to write in the work offsets, then sub programs to machine the parts. This was on a fixture that had 18 parts on it, and the machine was limited to six work coordinates.
 
Better to use system variables, rather than G10. Would be easy to store the initial setting, and go back to it in the end. And, no need to remember the G10 syntax.
 
We make fixture offset files. The program uses logic to move through the fixture positions. This is an example for a 4 leg column...

O1000 ( PART A )
G20
G0 G90 G80 G40 G17
G91 G28 Z0
G49
G90
M98 P7998 (LOAD FIXTURE OFFSET FILE)
#104=6 (NUMBER OF PARTS PER FACE)
M1
N10 (11/16 INSERTED DRILL)
T8710 M6
T3020
#100=0 (INITIAL B-AXIS POSITION)
#101=21 (G54.1 P VALUE) (FIRST POSITION ON FIXTURE)
#102=#101+#104 (INITIAL G54.1 P VALUE + PARTS PER FACE)
N20 G90 G0 G54.1 P#101
M11
B#100
M10

**CUT STUFF**

G0 Z5.
G54.2 P0
/ #101=#101 +1 (CHANGE TO NEXT FIXTURE POSITION/PART COUNTER)
/ IF [#101 LT #102] GOTO 20 (REPEAT OPERATION UNTIL COMPLETION OF LEG)
/ G91 G28 Z0
/ #101=21 (G54.1 P VALUE) (RESET P VALUE FOR NEXT LEG)
/ #100=#100 + 90 (CHANGE TO NEXT LEG)
/ IF [#100 LE 270] GOTO 20 (CHECK FOR COMPLETION OF COLUMN)
M9
G0 G91 G28 Z0 M5
G90

This keeps the program short, easy to read and you only have to prove out the operation on the first part because it loops through the same code until completion.
 








 
Back
Top