Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Anyone post work offsets as a macro variable?


Bob W.
 Share

Recommended Posts

I find myself manipulating and replacing work offsets enough that I wonder if it would just be better to modify my post so that it always posts the work offset as a macro variable. Instead of posting G54 it would post G#500 and a line in the NC program header would be #500 = 54 (WORK OFFSET). This way I would only have to edit one line of code to move a program to another work offset. It would also greatly help to run the same program on different offsets at the machine using M98 commands

 

delete the #500 = 54 line in the program and in a master program:

 

%

O0100

#500=54

M98 P10

#500=55

M98 P10

etc...

M30

 

I have done this numerous times and some programs are set up this way permanently. Is there a drawback to setting the post up to do this permanently?

Link to comment
Share on other sites
Guest CNC Apps Guy 1

I've always just used G10's to set work offsets unless I'm looping through a DO/WHILE routine in which case I'll just have one offset and then use G52 for my position shifts.

Link to comment
Share on other sites

The way I have been using this horizontal thus far is I have had different programs assigned to each face of a tombstone so I might be running the machine with 6-8 unique programs at any given time. Say I am running both tombstones with part A in a high volume job and I need to quickly insert part B on one face of one of the tombstones. It is very quick to drop two of the part A M98 commands in the master program while leaving the work offset in tact, and add program B to that face and put it on another unique work offset. I have been doing this so far with great results but it winds up being a lot of hand editing and find/replace work offsets, etc... Would it be an easy post mod so no matter what it posts G#500 every time? Not really sure where to start.

Link to comment
Share on other sites

The way I have been using this horizontal thus far is I have had different programs assigned to each face of a tombstone so I might be running the machine with 6-8 unique programs at any given time. Say I am running both tombstones with part A in a high volume job and I need to quickly insert part B on one face of one of the tombstones. It is very quick to drop two of the part A M98 commands in the master program while leaving the work offset in tact, and add program B to that face and put it on another unique work offset. I have been doing this so far with great results but it winds up being a lot of hand editing and find/replace work offsets, etc... Would it be an easy post mod so no matter what it posts G#500 every time? Not really sure where to start.

 

We do that same thing quite a bit Bob, but we just have the G10 lines at the start of each program.

 

Even when we're just running one job, and it's OP10 on pallet 1 and OP20 on pallet 2, both OP10 and OP20 use G54-G50whatever, with totally different values. The offsets are always refreshed at the beginning of the program.

Link to comment
Share on other sites

We do that same thing quite a bit Bob, but we just have the G10 lines at the start of each program.

 

Even when we're just running one job, and it's OP10 on pallet 1 and OP20 on pallet 2, both OP10 and OP20 use G54-G50whatever, with totally different values. The offsets are always refreshed at the beginning of the program.

 

This is the way that we do it.

Link to comment
Share on other sites

I use variable work offsets for all of my milling parts.

 

Here's a router for a square tombstone;

 

O5035 (14.00 SQUARE TOMBSTONE)

#151=6 (NUMBER OF PARTS PER FIXTURE)

(-0-)
N111 #150=1 (SURFACE 1)
#900=#539+[#151*3]  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
N112 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5302]GOTO121
IF[#172EQ5303]GOTO131
IF[#172EQ5306]GOTO121
G91 G00 X0 G54 P[#900]  ************
G90 G00 B90.
G201 B90.
G91 G00 X0 G59
M#173 P[#170+1]
GOTO113
END1
N113 IF[#150EQ#151]GOTO121
#150=#150+1
#900=#900+1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GOTO112
N121 #150=1 (SURFACE 2)
#900=#539 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
N122 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5301]GOTO211
IF[#172EQ5303]GOTO131
IF[#172EQ5304]GOTO131
G91 G00 X0 G54P[#900]  ************
G90 G00 B0.
M#173 P[#170+2]
GOTO123
END1
N123 IF[#150EQ#151]GOTO131
#150=#150+1
#900=#900+1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GOTO122
N131 #150=1 (SURFACE 3)
#900=#539+#151 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
N132 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5301]GOTO211
IF[#172EQ5302]GOTO221
IF[#172EQ5305]GOTO211
G91 G00 X0 G54 P[#900]   ************
G90 G00 B270.
G201 B270.
G91 G00 X0 G59
M#173 P[#170+3]
GOTO133
END1
N133 IF[#150EQ#151]GOTO211
#150=#150+1
#900=#900+1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GOTO132
(-90-)
N211 #150=1 (SURFACE 1)
#900=#539 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
N212 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5302]GOTO221
IF[#172EQ5303]GOTO231
IF[#172EQ5306]GOTO221
G91 G00 X0 G54 P[#900]   ************
G90 G00 B90.
G201 B90.
G91 G00 X0 G59
M#173 P[#170+1]
GOTO213
END1
N213 IF[#150EQ#151]GOTO221
#150=#150+1
#900=#900+1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GOTO212
N221 #150=1 (SURFACE 2)
#900=#539+#151 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
N222 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5301]GOTO311
IF[#172EQ5303]GOTO231
IF[#172EQ5304]GOTO231
G91 G00 X0 G54P[#900]  ************
G90 G00 B0.
M#173 P[#170+2]
GOTO223
END1
N223 IF[#150EQ#151]GOTO231
#150=#150+1
#900=#900+1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GOTO222
N231 #150=1 (SURFACE 3)
#900=#539+[#151*2] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
N232 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5301]GOTO311
IF[#172EQ5302]GOTO321
IF[#172EQ5305]GOTO311
G91 G00 X0 G54 P[#900]  ************
G90 G00 B270.
G201 B270.
G91 G00 X0 G59
M#173 P[#170+3]
GOTO233
END1
N233 IF[#150EQ#151]GOTO311
#150=#150+1
#900=#900+1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GOTO232
(-180-)
N311 #150=1 (SURFACE 1)
#900=#539+#151 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
N312 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5302]GOTO321
IF[#172EQ5303]GOTO331
IF[#172EQ5306]GOTO321
G91 G00 X0 G54 P[#900]  ************
G90 G00 B90.
G201 B90.
G91 G00 X0 G59
M#173 P[#170+1]
GOTO313
END1
N313 IF[#150EQ#151]GOTO321
#150=#150+1
#900=#900+1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GOTO312
N321 #150=1 (SURFACE 2)
#900=#539+[#151*2] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
N322 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5301]GOTO411
IF[#172EQ5303]GOTO331
IF[#172EQ5304]GOTO331
G91 G00 X0 G54P[#900]  ************
G90 G00 B0.
M#173 P[#170+2]
GOTO323
END1
N323 IF[#150EQ#151]GOTO331
#150=#150+1
#900=#900+1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GOTO322
N331 #150=1 (SURFACE 3)
#900=#539+[#151*3] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
N332 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5301]GOTO411
IF[#172EQ5302]GOTO421
IF[#172EQ5305]GOTO411
G91 G00 X0 G54 P[#900]  ************
G90 G00 B270.
G201 B270.
G91 G00 X0 G59
M#173 P[#170+3]
GOTO333
END1
N333 IF[#150EQ#151]GOTO411
#150=#150+1
#900=#900+1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GOTO332
(-270-)
N411 #150=1 (SURFACE 1)
#900=#539+[#151*2] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
N412 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5302]GOTO421
IF[#172EQ5303]GOTO431
IF[#172EQ5306]GOTO421
G91 G00 X0 G54 P[#900]  ************
G90 G00 B90.
G201 B90.
G91 G00 X0 G59
M#173 P[#170+1]
GOTO413
END1
N413 IF[#150EQ#151]GOTO421
#150=#150+1
#900=#900+1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GOTO412
N421 #150=1 (SURFACE 2)
#900=#539+[#151*3] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
N422 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5301]GOTO501
IF[#172EQ5303]GOTO431
IF[#172EQ5304]GOTO431
G91 G00 X0 G54P[#900] ************
G90 G00 B0.
M#173 P[#170+2]
GOTO423
END1
N423 IF[#150EQ#151]GOTO431
#150=#150+1
#900=#900+1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GOTO422
N431 #150=1 (SURFACE 3)
#900=#539 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
N432 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5301]GOTO501
IF[#172EQ5302]GOTO501
IF[#172EQ5305]GOTO501
G91 G00 X0 G54 P[#900] ************
G90 G00 B270.
G201 B270.
G91 G00 X0 G59
M#173 P[#170+3]
GOTO433
END1
N433 IF[#150EQ#151]GOTO501
#150=#150+1
#900=#900+1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GOTO432
N501
M99

Link to comment
Share on other sites

We do the same way as Joe, we also do the same thing with tool offsets, so that tool 1 is always tool 1 no matter what pot it is in when running multiple part numbers. The offsets (work and tool) for each program are read at the beginning of the program every time a pallet goes in the machine.

Link to comment
Share on other sites

We do the same way as Joe, we also do the same thing with tool offsets, so that tool 1 is always tool 1 no matter what pot it is in when running multiple part numbers.

 

I have my tools set up this way as well. Since I run multiple programs at the same time it has to be that way. If I am running two programs that use an M3 tap, it will be tool #75 in both programs.

Link to comment
Share on other sites

what i mean is that the tool is called out as a macro number like T[#701] will be tool 1 in the program, so that the program never needs to be modified due to tools in different pots. That tool can be in any pot I want.

 

The way my Makino works it that it doesn't matter where the tool is, it will call it correctly every time. If I put tool 355 in pot 50, every time there is a T355 M6 the machine will call tool 355 so there are no modifications to the program. When setting up I do need to assign the tool numbers to the pots though. I typically load the tools into the pots and record which tool is going into which pot, then type it into the tool data screen on the machine and it handles the rest.

 

This is my first experience with anything other than a Haas and I am really impressed with both the Makino and the Fanuc control. It is really hard to believe how quickly this machine gets work done.

Link to comment
Share on other sites

 

This is my first experience with anything other than a Haas and I am really impressed with both the Makino and the Fanuc control. It is really hard to believe how quickly this machine gets work done.

 

Wait until you get a job that justifies building a 16 or 20 station fixture. It's gonna blow your mind how many parts you'll get done in a day. :thumbup:

Link to comment
Share on other sites

Wait until you get a job that justifies building a 16 or 20 station fixture. It's gonna blow your mind how many parts you'll get done in a day. :thumbup:

 

I know what you mean. Thus far I am getting work done 3X faster (literally!) than on my Haas verticals. Jobs that were taking a few days are now done in less than a day. On a few jobs I significantly reduced the price to the customer to be more competitive, and due to the productivity increase I am netting twice the shop rate. It makes the Haas machines look expensive when you think about it...

Link to comment
Share on other sites

On a few jobs I significantly reduced the price to the customer to be more competitive, and due to the productivity increase I am netting twice the shop rate. It makes the Haas machines look expensive when you think about it...

 

Shhhhhhhhhhhhh! :no

Link to comment
Share on other sites

I know what you mean. Thus far I am getting work done 3X faster (literally!) than on my Haas verticals. Jobs that were taking a few days are now done in less than a day. On a few jobs I significantly reduced the price to the customer to be more competitive, and due to the productivity increase I am netting twice the shop rate. It makes the Haas machines look expensive when you think about it...

 

 

Very Nice.

 

The first thing that we noticed after the HMC purchase were decreased setup times. Jobs that took three hours to set up on the verticals take 15 minutes on the HMC. Bolt on fixture place, load parts, hit start button. Its nice when the first run of parts come out exactly like the last run even months apart.

 

Most of our cycle times decreased by a minimum of 1/3.

 

The initial investment in the tooling was greater but it has far more than paid for itself already.

Link to comment
Share on other sites

Here's how we are dealing with multiple parts (and multi angle parts) on a horizontal machining center with pallet rotating around Y axis.

- We set one and only G54 (or G55,...) at the beginning of program. This origin is attached to pallet rotating axis (X0. Z0.).

- Each part uses a set of variables to describe its own origin relative to G54 origin

- A macro is called to calc every origin offset (especially for whatever machining angle #640)

 

%
O00040131

(TOOL TABLE)
N10 #506=04 ( DRILL 8.5 )
N20 #507=05 ( CUTTER 5 )

(WEAR COMPENSATION)

N30 G0 G40 G80 G17 G49
N40 M912
N50 G30 G91 X0. Y0. Z0.

(ORIGIN PART 1)
N60 #621=89.02 (X OFFSET - PART/ROTATING AXIS)
N70 #622=193.44 (Z OFFSET - PART/ROTATING AXIS)
N80 #625=0. (Y OFFSET)
N90 #626=0. (B OFFSET)

(ORIGIN PART 2)
N100 #623=-88.45 (X OFFSET - PART/ROTATING AXIS)
N110 #624=193.44 (Z OFFSET - PART/ROTATING AXIS)
N120 #627=0. (Y OFFSET)
N130 #628=0. (B OFFSET)

N140 G54 (SET UP TO ROTATING PALLET AXIS)

( OUTIL T506  /  DRILLING 8.5  / H506  / D506 )

N150 T#506 T#507 M6
N160 G0 G90 S1498 M3
N170 #640=0. (B POSITION)

(PART1)
N180 M98 H580
N190 M98 H220
N200 G0 Z100.
N210 GOTO 270

(MACHINING)
N220 G0 X40. Y-65.
N230 G43 Z20. M51 H#506 D#506
N240 G98 G73 Z-30. R-5.5 Q8.5 F150
N250 G80 Z50.
N260 M99
(END MACHINING)

(PART2)
N270 G90
/N280 M98 H640
/N290 M98 H220
N300 G30 G91 Z0. M9
N310 G30 G91 X0. Y0. M5
N320 M1

( OUTIL T507  /  CONTOURING  / H507  / D507 )

N330 T#507 T#506 M6
N340 G0 G90 S2122 M3
N350 #640=0. (B POSITION)

(PART1)
N360 M98 H580
N370 M98 H400
N380 G0 Z100.
N390 GOTO 500

(MACHINING)
N400 G0 X16.514 Y-123.144
N410 G43 Z20. M8 H#507 D#507
N420 Z-37.5
N430 G1 G41 X17.953 Y-123.567 F212
N440 G3 X17.978 Y-122.532 I-1.919 J0.563
N450 X-17.978 I-17.978 J-4.363
N460 X-17.954 Y-123.567 I1.944 J-0.472
N470 G1 G40 X-16.515 Y-123.144
N480 G0 Z50.
N490 M99
(END MACHINING)

(MACRO)
N500 G90
/N510 M98 H640
/N520 M98 H400
N530 G30 G91 Z0. M9
N540 G30 G91 X0. Y0. M5
N550 M911
N560 M99
N570 GOTO 840

(PART1 ORIGIN TRANSFER TO VARIABLES)
N580 #610=#621 ( X )
N590 #611=#622 ( Z )
N600 #618=#625 ( Y )
N610 #619=#626 ( B )
N620 M98 H700 (CALC MACRO CALL)
N630 M99

(PART2 ORIGIN TRANSFER TO VARIABLES)
N640 #610=#623 ( X )
N650 #611=#624 ( Z )
N660 #618=#627 ( Y )
N670 #619=#628 ( B )
N680 M98 H700 (CALC MACRO CALL)
N690 M99

( OFFSETS CALC MACRO )
N700 #641=#640
N710 #615=SQRT[#610*#610+#611*#611] ( RADIUS )
N720 IF[#615EQ0.]GOTO 790
N730 #616=ACOS[#611/#615]
N740 IF[[[#610GT0.]AND[#611GT0.]]OR[[#610GT0.]AND[#611LT0.]]]GOTO 770
N750 #617=-#616
N760 GOTO 780
N770 #617=#616
N780 #642=#617+[-#641]
N790 #612=#615*SIN[#642]
N800 #613=#615*COS[#642]
N810 G90 G52 X#612 Y#618 Z#613 B#619 (OFFSETTING )
N820 G0 B#640
N830 M99
N840 M30
%

Link to comment
Share on other sites
The way my Makino works it that it doesn't matter where the tool is, it will call it correctly every time. If I put tool 355 in pot 50, every time there is a T355 M6 the machine will call tool 355 so there are no modifications to the program.

 

 

what i mean is that the tool is called out as a macro number like T[#701] will be tool 1 in the program, so that the program never needs to be modified due to tools in different pots. That tool can be in any pot I want.

 

 

What he is saying is we can have different tools be called by any tool number. (Example. program 1: tool #1 .5 end mill Program #2: tool #1 .25 spot drill)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...