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:

Need post to put retract point at end of every block in drill can


Recommended Posts

Tricky question??

 

I have been trying to tweek a post processor to post codes for a a2100 control on a tree mill. the machine likes the drilling cycles to all use g83 with a j1 for no peck, a j2 for peck full out w/ k value, and a j3 for peck full out w/ k value and decrease peck by i value all canned cycles use w.? i.e w.1 for the retract point and it must be put in each block. so an example of ideal program is right hear.

 

The main problem is the $ symbol and space between W.1

 

I have done a ton of editting so far to get to this point. It started as a purely fanuc flavored post slightly tweeked for a fadal with 32 'E' offsets. there now 'H' offsets. i removed all tool offsets and have got the drilling cycles this far. im just an amature programmer with 3 years of mastercam and gibbs under my belt 4 years of writing g code by hand as well. This is celarly the logical step to undertake.

 

Im sure we all could trade knowledge on this thread, it is an interesting question in my opinion. Any help would be greatly apprecieated.

 

Rory C.

 

%

N10 O0000 ( T )

N20 ( CREATED ON 12-16-12 AT 8:17 PM )

N30 ( MCX FILE - C:\MCAMX\MCX\T.MCX )

N40 ( NC FILE - C:\MCAMX\MILL\NC\T.NC )

N50 ( MATERIAL - ALUMINUM INCH - 2024 )

N60 G0 G20 G17 G40 G80 G90 H0 Z0.

N70 G28 X0. Y0. Z0.

N80 ( .5 DRILL TOOL - 62 DIA. OFF. - 62 N80 ( TREE_VMC_1260_#96_3_AXIS_MILL )

N90 ( MACHINE GROUP-1 )

N100 T62 M6

N110 M7

N120 G0 G90 S2139 M3 H20 X1. Y1.

N130 Z1.5

N140 G83 X1. Y1. Z-1.0002 J1 W01.5 F4.11

N150 Y9. w1.5

N160 X9. w1.5

N170 Y1. w1.5

N180 G80

N190 ( TREE_VMC_1260_#96_3_AXIS_MILL )

N200 ( MACHINE GROUP-1 )

N210 X1. Z.1

N220 G83 Z-.7502 J2 W0.1 K0.1 F4.11

N230 X9. Y9. w.1

N240 X1. w.1

N250 X9. Y1. w.1

N260 G80

N270 ( TREE_VMC_1260_#96_3_AXIS_MILL )

N280 ( MACHINE GROUP-1 )

N290 X1.

N300 G83 Z-1.0002 J3 W0.1 K0.5 I0.1 F4.11

N310 X9. Y9. w.1

N320 X1. w.1

N330 X9. Y1. w.1

N340 G80

N350 M09

N360 M5

N370 G90 H0 Z0.

N380 H0 X0 Y0

N390 M02

%

 

 

i am currently with this

 

%

N10 O0000 ( T )

N20 ( CREATED ON 12-16-12 AT 8:17 PM )

N30 ( MCX FILE - C:\MCAMX\MCX\T.MCX )

N40 ( NC FILE - C:\MCAMX\MILL\NC\T.NC )

N50 ( MATERIAL - ALUMINUM INCH - 2024 )

N60 G0 G20 G17 G40 G80 G90 H0 Z0.

N70 G28 X0. Y0. Z0.

N80 ( .5 DRILL TOOL - 62 DIA. OFF. - 62 N80 ( TREE_VMC_1260_#96_3_AXIS_MILL )

N90 ( MACHINE GROUP-1 )

N100 T62 M6

N110 M7

N120 G0 G90 S2139 M3 H20 X1. Y1.

N130 Z1.5

N140 G83 X1. Y1. Z-1.0002 J1 W01.5 F4.11

N150 Y9. w$ 1.5

N160 X9. w$ 1.5

N170 Y1. w$ 1.5

N180 G80

N190 ( TREE_VMC_1260_#96_3_AXIS_MILL )

N200 ( MACHINE GROUP-1 )

N210 X1. Z.1

N220 G83 Z-.7502 J2 W0.1 K0.1 F4.11

N230 X9. Y9. w$ .1

N240 X1. w$ .1

N250 X9. Y1. w$ .1

N260 G80

N270 ( TREE_VMC_1260_#96_3_AXIS_MILL )

N280 ( MACHINE GROUP-1 )

N290 X1.

N300 G83 Z-1.0002 J3 W0.1 K0.5 I0.1 F4.11

N310 X9. Y9. w$ .1

N320 X1. w$ .1

N330 X9. Y1. w$ .1

N340 G80

N350 M09

N360 M5

N370 G90 H0 Z0.

N380 H0 X0 Y0

N390 M02

%

my drilling section in the post looks like this

# --------------------------------------------------------------------------

# Drilling

# --------------------------------------------------------------------------

pdrill0$ #Pre-process before drill call

sav_dgcode = gcode$ #Capture gcode for 5 axis drill

 

pdrlcommonb #Canned Drill Cycle common call, before

if initht$ <> refht$, drillref = zero

else, drillref = one

if sav_dgcode =81,

[

result = newfs(two, zinc)

if drillcyc$ = three | drillcyc$ = 7, drlgsel = fsg1(-ss$) + drillcyc$ * two

else, drlgsel = fsg2(dwell$) + drillcyc$ * two

prv_refht_a = c9k

prv_refht_i = c9k

prv_dwell$ = zero

prv_shftdrl$ = zero

]

if cuttype = three, sav_dgcode = gcode$

else, z$ = depth$

if cuttype = one, prv_zia = initht$ + (rotdia$/two)

else, prv_zia = initht$

pcom_moveb

feed = fr_pos$

comment$

pcan

#5 axis must map the true Z, correct Z calculation here

if cuttype = three,

[

prv_zia = zabs + (-depth$) + initht$

zia = fmtrnd(zabs)

zinc = zia - prv_zia

]

 

prdrlout #R drill position

if cuttype = one, refht_a = refht$ + (rotdia$ / two)

else, refht_a = refht$

refht_i = refht$ - initht$

#refht_i can never be positive (pg 4-4)

if refht_i > 0, refht_i = refht_i * -1.

if cuttype = three, refht_a = w$

if absinc$ = zero, refht_a, !refht_i

else, refht_i, !refht_a

 

pdrill$ #Canned Drill Cycle - G81/G82

pdrlcommonb

pcan1, pbld, n$, *sgdrill, *sgdrlref, pfxout, pfyout, pfzout, 'J1', pcout,

prdrlout, dwell$, *feed, strcantext, e$

pcom_movea

 

ppeck$ #Canned Peck Drill Cycle

pdrlcommonb

pcan1, pbld, n$, *sgdrlref, *sgdrill, pfzout, 'J2', pcout,

prdrlout, *peck1$, *feed, strcantext, e$

pcom_movea

 

pchpbrk$ #Canned Chip Break Cycle

pdrlcommonb

pcan1, pbld, n$, *sgdrlref, *sgdrill, pfzout, 'J3', pcout,

prdrlout, *peck1$, *peck2$, *feed, strcantext, e$

pcom_movea

 

ptap$ #Canned Tap Cycle - G84/G74

pdrlcommonb

feed = (1 / n_tap_thds$) * speed

pcan1, pbld, n$, *sgdrill, *sgdrlref, pfxout, pfyout, pfzout, pcout,

prdrlout, *feed, strcantext, e$

pcom_movea

 

pbore1$ #Canned Bore #1 Cycle - G85/G89

pdrlcommonb

pcan1, pbld, n$, *sgdrill, *sgdrlref, pfxout, pfyout, pfzout, pcout,

prdrlout, dwell$, *feed, strcantext, e$

pcom_movea

 

pbore2$ #Canned Bore #2 Cycle - G86

pdrlcommonb

pcan1, pbld, n$, *sgdrill, *sgdrlref, pfxout, pfyout, pfzout, pcout,

prdrlout, *feed, strcantext, e$

pcom_movea

 

pmisc1$ #Canned Misc #1 Cycle - G76

pdrlcommonb

pcan1, pbld, n$, *sgdrill, *sgdrlref, pfxout, pfyout, pfzout, pcout,

prdrlout, shftdrl$, dwell$, *feed, strcantext, e$

pcom_movea

 

pmisc2$ #Canned Misc #2 Cycle - G84.1/G74.1

pdrlcommonb

feed = (1 / n_tap_thds$) * speed

pbld, n$, *sgdrill, *sgdrlref, pfxout, pfyout, pfzout, pcout,

prdrlout, *tap_speed, *feed, e$

pcom_movea

 

pdrlcst$ #Custom drill cycles 8 - 19 (user option)

#Use this postblock to customize drilling cycles 8 - 19

if drillcyc$ = 8, pdrlcst8

else,

[

pdrlcommonb

sopen_prn, "CUSTOMIZABLE DRILL CYCLE - NOT CONFIGURED - FIRST HOLE", sclose_prn, e$

pcom_movea

]

 

pdrlcst8 #Custom drill cycle 8 - example custom cycle

pdrlcommonb

sopen_prn, "CUSTOMIZABLE DRILL CYCLE EXAMPLE - FIRST HOLE", sclose_prn, e$

pcan1, pbld, n$, *sgdrlref, *sgdrill, pxout, pyout, pfzout, pcout,

prdrlout, shftdrl$, dwell$, *feed, strcantext, e$

pcom_movea

 

# Additional Holes

pdrill_2$ #Canned Drill Cycle, additional points

pdrlcommonb #causes cordinates to be posted

pcan1, pbld, n$, pxout, pyout, pzout, pcout, *retractpoint$, feed, *w$, strcantext, e$ #format for cordinates # added *w$ by RLC

pcom_movea

 

ppeck_2$ #Canned Peck Drill Cycle

pdrill_2$

 

pchpbrk_2$ #Canned Chip Break Cycle

pdrill_2$

 

ptap_2$ #Canned Tap Cycle

pdrlcommonb

feed = (1 / n_tap_thds$) * speed

pcan1, pbld, n$, pxout, pyout, pzout, pcout, prdrlout, feed, strcantext, e$

pcom_movea

 

pbore1_2$ #Canned Bore #1 Cycle

pdrill_2$

 

pbore2_2$ #Canned Bore #2 Cycle

pdrill_2$

 

pmisc1_2$ #Canned Misc #1 Cycle

pdrill_2$

 

pmisc2_2$ #Canned Misc #2 Cycle

pdrlcommonb

feed = (1 / n_tap_thds$) * speed

pbld, n$, sgdrill, sgdrlref, pxout, pyout, pzout, pcout,

prdrlout, speed, feed, e$

pcom_movea

 

pdrlcst_2$ #Custom drill cycles 8 - 19, additional points (user option)

#Use this postblock to customize drilling cycles 8 - 19

if drillcyc$ = 8, pdrlcst8_2

else,

[

sopen_prn, "CUSTOMIZABLE DRILL CYCLE - NOT CONFIGURED - NEXT HOLE", sclose_prn, e$

pdrill_2$

]

 

pdrlcst8_2 #Custom drill cycle 8 - example custom cycle

sopen_prn, "CUSTOMIZABLE DRILL CYCLE EXAMPLE - NEXT HOLE", sclose_prn, e$

pdrill_2$

 

pcanceldc$ #Cancel canned drill cycle

result = newfs(three, zinc)

z$ = initht$

if cuttype = one, prv_zia = initht$ + (rotdia$/two)

else, prv_zia = initht$

pxyzcout

!zabs, !zinc

prv_gcode$ = zero

pcan

pcan1, pbld, n$, sg80, strcantext, e$

pcan2

  • Like 1
Link to comment
Share on other sites

You need to format the w$ variable, preferably up in the formatting for the other variables used for drilling. The line you need to insert is something like this:

 

fmt "W" 1 w$

 

The 1 may need to be something other than 1, though. My best guess is that you need the same format as the zabs variable, so you might look for the fmt line that formats zabs, which will look something like this:

 

fmt "Z" 1 zabs

 

Where the 1 might be a different number.

Link to comment
Share on other sites

Glad I could help, but...

 

Using refht_a will work, too, and might be more correct, if it is the reference height from the drilling dialogue you want, and w$ is the initial height value. However, if it reads

 

fmt W0 2 refht_a

 

then you migth not get the correct output, as that means that the value of refht_a is prefixed with "W0". That probably doesn't matter if the value is between 0 and 1, but if that hole is at the bottom of a 1 inch deep pocket, then you would get output of W0-.9 for a retract 0.1 inch above the bottom of that pocket, and I don't think your control will accept that. I think you will need to depete that 0 in the fmt line so it reads

 

fmt W 2 refht_a

 

instead.

 

A piece of general advice when editing drilling cycles in the post processor which many people forget is to also test it for holes where the top of the hole isn't at Z0. Most holes might be at Z0, but not all holes are at Z0, and you don't want to have incorrect output when you think the post processor is working OK.

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...