What's new
What's new

Another G10 macro thread

thunderskunk

Cast Iron
Joined
Nov 13, 2018
Location
Middle-of-nowhere
Hey gents,

I'm glad I did a few searches on this, pretty much found what I need, but there's hundreds of threads on macros. I could use some help figuring out which general direction I should be looking.

Our horizontal mill doesn't have many offsets. Kind of annoying having 16 faces across 4 tombstones, but barely enough offsets to get one for every face. I just made a fixture to mill 12 parts at once requiring 36 offsets.

Here's my theory;

One program links macro parameters to G10 offset changes, so you have every offset listed in this program to be called up via M98. This makes it so I can use one offset without disturbing the rest, and change the offsets in said program like I would any G54 or greater.

A master program that calls up the work offset from said offset program, then calls up the milling program like a canned cycle.

Last, splitting each tool into its own program with a zero-return to a G53 point.

Am I doing things the hard way? I'm using Inventor to post the code, so having different program numbers is a band-aid fix to not having developed a post to do all this G10 craziness; Modifications can be posted just as easily as any other code, since the master program makes all the offsets and simply calls up said code.

Thanks for the help,
 
Anyway you can reduce the number of offsets on the fixture? If I mill the fixture in the machine, I try to get away with just one offset for the whole lot of parts on that face. But maybe your parts don't allow that?

Perhaps use of DWO macro to use one offset per part? Then you don't need different angle offsets. Or do you need to make small adjustments?

By default I just stick to G54 on each pallet (and go up from there depending how many programs per pallet) and every program has a G10. To me it keeps it simple, but others have told me it's an accident waiting to happen.
 
Maybe I misunderstand what you wrote, but I wouldn't have the "master program" call up your G10. I would insert your G10 lines at the beginning of your program for each individual pallet. You may call them in a subprogram that your pallet program if you want.

If it isn't clear, I would do something like this:



O1000 (MAIN PROGRAM TO RUN ALL 4 PALLETS!)

M98P2001(PROGRAM 1 ON PALLET 1)

M98P2002(PROGRAM 2 ON PALLET 2)

M98P2003(PROGRAM 3 ON PALLET 3)

M98P2004(PROGRAM 4 ON PALLET 4)

M99

O2001(PALLET 1 PROGRAM)
G10L2P1X1Y1Z1B0
...
T1M6
...
M99

O2002
M98P3002(G10 SUBPROGRAM FOR PALLET 2)
...
T10M6
...
M99

... And so on.


You can put your G10 lines in another sub program like i did for program O2002 above, which would allow you to edit it while the machine is in operation (via background edit)


That isn't perfect, but seems simpler than what you described? Unless I missed your point.


I hate G10 btw. Really hate when I have to use it to set coordinates. Love it for initial setup on a job to get close, but despise having to use it during operation.
 
Why G10 at all?

Use G52 for a private offset for each position. Say you have 4 pieces on a plate and they are fixtured 100mm XY from each other.

Piece one:

<MILLING CODE>

Piece two:

X100 Y0
G52 X100 Y0

<MILLING CODE>
G52 X0Y0

Piece three:

X100 Y100
G52 X100 Y100

<MILLING CODE>
G52 X0Y0

Piece four:

X0 Y100
G52 X0 Y100

<MILLING CODE>
G52 X0Y0

Wouldn't that help you? You can have a million work offsets if you want to.
 
Last edited:
Hey guys,

I was in the middle of making this fixture when I got pulled from the job, but I’m still interested in how to program it.

From the discussion here, I’d have probably ditched the “master program” and just put the G10 offsets at the beginning of the program. That way you call up the program and you have the offsets. The fixture was meant to never come off the tombstone, and was pinned so it would have repeated fairly well.

G52 would not have worked I think. To change an offset, I’d have to make the change a hundred times in a very long code, and there was barely enough room for the code as is. Maybe if the control was a bit easier to manage, but it wasn’t.
 
On an old turret punch press I had to learn to run last year, it used a main program with sub calls for each tool, then the sub programs had G91 G52 shifts for each part location, and then when it came back into the main program there was a work offset call that reset to the original position, then on to the next tool. The code looked like what Tichy posted.

That said, HSM/Fusion will do patterns very well so I've used that and the "reorder to minimize tool changes" whenever I can for 4th axis work (i.e., whenever I also cut the fixture with the same work offset so I know all the relationships are good). In fact I had started to keep the center of rotation of the Lang sub plate at its face on the 4th axis as the WCS zero so no matter what fixture we put on there, we didn't have to set a zero, much less zero every face of a multi-faced pallet.

Just know that unless your machine control can do a work plane conversion that you do need to use the center of rotation when using a circular pattern or the code gets weird!
 
Hey guys,

I was in the middle of making this fixture when I got pulled from the job, but I’m still interested in how to program it.

From the discussion here, I’d have probably ditched the “master program” and just put the G10 offsets at the beginning of the program. That way you call up the program and you have the offsets. The fixture was meant to never come off the tombstone, and was pinned so it would have repeated fairly well.

G52 would not have worked I think. To change an offset, I’d have to make the change a hundred times in a very long code, and there was barely enough room for the code as is. Maybe if the control was a bit easier to manage, but it wasn’t.
Hello thunderskunk,
G10 is not going to be any more economical than using G52. In fact, there will be more characters involved when using the G10 command.

You've not stated the control being used, or at least I've not picked up on it. G52 works differently with some controls.

Rick Finsta said:
On an old turret punch press I had to learn to run last year, it used a main program with sub calls for each tool, then the sub programs had G91 G52 shifts for each part location, and then when it came back into the main program there was a work offset call that reset to the original position, then on to the next tool. The code looked like what Tichy posted
Hello Rick,
Are you saying that you used G52 with G91 Mode? Although this is not an illegal operation, except when used with a Yasnac Control, G52 has the same effect whether programmed in Incremental, or Absolute Mode. The execution of G52 must be followed by an Absolute Coordinate move for the Local Coordinate Shift to take effect, otherwise the program will execute as if no Coordinate Shift had been executed and the program will function just like any other program operating in Incremental Mode.

Regards,

Bill
 
G52 would not have worked I think. To change an offset, I’d have to make the change a hundred times in a very long code, and there was barely enough room for the code as is. Maybe if the control was a bit easier to manage, but it wasn’t.
Okay, so that's the problem.

Code:
#101=0
#102=0
WHILE[#101LT1000]DO1
WHILE[#101LT1000]DO2
X#101 Y#102
G52 X#101 Y#102
<MILLING CODE>
#101=#101+1
G52X0Y0
END2
#102=#102+1
END1

There you go, a million offsets. No need to repeat anything.

(Maybe I forgot something, I'm not by my machine and about to go to sleep. Don't sue me.)
 
Last edited:
Hello Rick,
Are you saying that you used G52 with G91 Mode? Although this is not an illegal operation, except when used with a Yasnac Control, G52 has the same effect whether programmed in Incremental, or Absolute Mode. The execution of G52 must be followed by an Absolute Coordinate move for the Local Coordinate Shift to take effect, otherwise the program will execute as if no Coordinate Shift had been executed and the program will function just like any other program operating in Incremental Mode.

Regards,

Bill

This was a GN6 (FANUC 6P) controller on an old Strippit. I don't have access to the code, but I think I didn't explain it very well (and my memory sucks). The G91s and G52 were used in different levels of the sub programs if I recall correctly: G91 was used for the actual punch code and then the G52s were used to move the WCS for each individual part, then to reset the WCS for the next tool. It may have just been the way the guy had programmed them for years because I never understood the benefit of using incremental over absolute in that case. On prints that were dimensioned from feature to feature it sure did make tweaking positions easy; maybe that's why he did it?
 
This was a GN6 (FANUC 6P) controller on an old Strippit. I don't have access to the code, but I think I didn't explain it very well (and my memory sucks). The G91s and G52 were used in different levels of the sub programs if I recall correctly: G91 was used for the actual punch code and then the G52s were used to move the WCS for each individual part, then to reset the WCS for the next tool. It may have just been the way the guy had programmed them for years because I never understood the benefit of using incremental over absolute in that case. On prints that were dimensioned from feature to feature it sure did make tweaking positions easy; maybe that's why he did it?

Hello Rick,
As stated in my previous Post, an Absolute move must follow the execution of G52, whether executed in G91,or G90 Mode, otherwise there will be no Local Workshift Offset applied. And you are correct, there would be no tangible benefit of using Incremental over Absolute when the Work Coordinate System Zero is moved, either by G52 (Local), or any Workshif Offset.

Regards,

Bill
 








 
Back
Top