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:

CUSTOM DRILL CYCLES


TonyL
 Share

Recommended Posts

Hello,

 

I would like to have one of the custom drill cycles call a macro program. Is this possible? How would I define my variables in mastercam and how do you modify the post to work correctly. This is what I want to see when I post code:

 

X0. Y0.(GO TO LOCATION)

G66 P9098 S-- T-- Z-- R-- C-- M3

X0. Y0.(SAME LOCATION AGAIN)

X1. Y1.(NEXT LOCATION)

G67 G0 Z1.(CANCEL CYCLE)

 

I would also like to use the custom drill cycles for probing which would be very similar.

 

TIA

 

Tony

Link to comment
Share on other sites

Thanks zoober but adding custom drill parameters is what I need some help with. I am very new at editing posts(first time today) so I am having some trouble with the formating etc. How would I modify the post to write to the variables I need? Also I need the X & Y locations before and after the macro call is there a way to force them to be there? Where do enter these values in my parameters screen in mastercam and can I rename them. As you can see I am a novice when it comes to the posts so any help would be great.

 

Thanks,

 

Tony

  • Thanks 1
Link to comment
Share on other sites

Tony,

 

Do a search on custom drill cycles and probing.

 

There is a ton of information about setting up and using custom drill cycles

 

Here's a snippet of how I have set probing up.

 

code:

uptol = mr1$   #UPPER TOLERANCE LIMIT                   #### MISC REALS mr1 and mr2  ARE USED

lowtol = mr2$ #LOWER TOLERANCE LIMIT #### TO SET THE UPPER AND LOWER TOLERANCES

z_retract = mr10$ #Z RETRACT HEIGHT #### IN ALL CUSTOM PROBE CYCLES

 

fmt A 2 drl_prm1$

fmt B 2 drl_prm2$

fmt I 2 drl_prm3$

fmt J 2 drl_prm4$

fmt K 2 drl_prm5$

fmt S 2 drl_prm6$

fmt W 2 drl_prm7$

fmt X 2 drl_prm8$

fmt Y 2 drl_prm9$

fmt Z 2 drl_prm10$

fmt Q 2 nddia

fmt T 2 uptol

fmt U 2 lowtol ###VARIABLE DEFINITIONS FOR CUSTOOM DRILL/PROBING CYCLES - JMP 08/02/05

fmt C 2 z_retract

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

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

#Use this postblock to customize drilling cycles 8 - 19

pdrlcommonb

#if drillcyc = 8, pcan1, pbld, n, *sgdrlref, *sgdrill, pdrlxy, pfzout, pcout,

# prdrlout, dwell, *feed, strcantext, e

if drillcyc$ = 8,

[

sub_prg_call = peck1$

pcan1, pbld, n$, *sg00, *sgabsinc, pfxout, pfyout, strcantext, e$

pbld, n$, "M98", *sub_prg_call, e$

]

#else, "CUSTOMIZABLE DRILL CYCLE ", pfxout, pfyout, pfzout, pfcout, e

pcom_movea

 

pdrlcommonb ####### ID PROBE CYCLE ADDED 08/01/05 - JMP

#~drillcyc, e

if drillcyc$ = 9,

[

"(PROBE ID)", e$

"(AUTO CENTERING CYCLE)", e$

pbld, n$, "G65 P8010", *z_retract, "D0.", *drl_prm6$, *uptol, *lowtol, "V0.", *drl_prm7$, *drl_prm10$, e$

pbld, "G04 P100", e$

pcom_movea

]

 

pdrlcommonb #### OD/BOSS PROBE CYCLE ADDED 08/01/05 - JMP

#~drillcyc, e

if drillcyc$ = 10,

[

"(PROBE OD/BOSS)", e$

"(AUTO CENTERING CYCLE)", e$

pbld, n$, "G65 P8017", *drl_prm1$, *z_retract, "D0.", *drl_prm6$, *uptol, *lowtol, "V0.", *drl_prm7$, *drl_prm10$, e$

pbld, "G04 P100", e$

pcom_movea

]

 

pdrlcommonb ### FIND X CENTER PROBE CYCLE ADDED 08/01/05 - JMP

#~drillcyc, e

if drillcyc$ = 11,

[

"(FIND X CENTER INSIDE)", e$

"(AUTO CENTERING CYCLE)", e$

pbld, n$, "G65 P8006", *z_retract, "D0.", *drl_prm3$, *drl_prm6$, *uptol, *lowtol, "V0.", *drl_prm7$, *drl_prm10$, e$

pbld, "G04 P100", e$

pcom_movea

]

 

pdrlcommonb ### FIND Y CENTER PROBE CYCLE ADDED 08/01/05 - JMP

#~drillcyc, e

if drillcyc$ = 12,

[

"(FIND Y CENTER INSIDE)", e$

"(AUTO CENTERING CYCLE)", e$

pbld, n$, "G65 P8007", *z_retract, "D0.", *drl_prm4$, *drl_prm6$, *uptol, *lowtol, "V0.", *drl_prm7$, *drl_prm10$, e$

pbld, "G04 P100", e$

pcom_movea

]

 

pdrlcommonb ### FIND Y STRAIGHTNESS PROBE CYCLE ADDED 08/01/05 - JMP

#~drillcyc, e

if drillcyc$ = 13,

[

"(FIND Y STRAIGHTNESS)", e$

"(AUTO ROTATION CYCLE)", e$

pbld, n$, "G65 P8015", *z_retract, "D0.", *drl_prm4$, *uptol, *lowtol, *drl_prm8$, *drl_prm9$, *drl_prm10$, e$

pbld, "G04 P100", e$

pbld, sg00, *g_wcs, sg90, "X0.", "Y0.", e$

pbld, strns_rot_on,"R",no_spc$, 35, no_spc$,"107", e$

pcom_movea

]

 

 

pdrlcommonb ###FIND OUTSIDE X CENTER PROBE CYCLE ADDED 08/01/05 - JMP

#~drillcyc, e

if drillcyc$ = 14,

[

"(FIND X CENTER OUTSIDE)", e$

"(AUTO CENTERING CYCLE)", e$

"(ON THE X AXIS)", e$

pbld, n$, "G65 P8006",*drl_prm1$, *drl_prm2$, *z_retract, "D0.", *drl_prm3$, *drl_prm6$, *uptol, *lowtol, "V0.", *drl_prm7$, *drl_prm8$, *drl_prm10$, e$

pbld, "G04 P100", e$

pcom_movea

]

 

 

pdrlcommonb

#~drillcyc, e

if drillcyc$ = 15, ###FIND OUTSIDE Y CENTER PROBE CYCLE ADDED 08/01/05 - JMP

[

"(FIND Y CENTER OUTSIDE)", e$

"(AUTO CENTERING CYCLE)", e$

"(ON THE Y AXIS)", e$

pbld, n$, "G65 P8005",*drl_prm1$, *drl_prm2$, *z_retract, "D0.", *drl_prm4$, *drl_prm6$, *uptol, *lowtol, "V0.", *drl_prm7$, *drl_prm9$, *drl_prm10$, e$

pbld, "G04 P100", e$

pcom_movea

]

 

pdrlcommonb ###AUTOEDGEFIND PROBE CYCLE ADDED 08/01/05 - JMP

#~drillcyc, e

if drillcyc$ = 16,

[

"(FIND A CORNER)", e$

"(AUTO EDGEFIND CYCLE)", e$

"(ON THE XY AXIS)", e$

pbld, n$, "G65 P8013",*drl_prm1$, *drl_prm2$, *z_retract, "V0.", *drl_prm7$, *drl_prm8$, *drl_prm9$, *drl_prm10$, e$

pbld, "G04 P100", e$

pcom_movea

]

 

pdrlcommonb ### FIND X STRAIGHTNESS PROBE CYCLE ADDED 08/15/05 - JMP

#~drillcyc, e

if drillcyc$ = 17,

[

"(FIND X STRAIGHTNESS)", e$

"(AUTO ROTATION CYCLE)", e$

pbld, n$, "G65 P8014", *z_retract, "D0.", *drl_prm3$, *uptol, *lowtol, *drl_prm8$, *drl_prm9$, *drl_prm10$, e$

pbld, "G04 P100", e$

pbld, sg00, *g_wcs, sg90, "X0.", "Y0.", e$

pbld, strns_rot_on,"R",no_spc$, 35, no_spc$,"107", e$

pcom_movea

]

The combinations are nearly endless

Link to comment
Share on other sites
  • 6 years later...

Does this help at all? Just keep in mind these are located in three different areas of the post. The first is near the top where all of your variables are formatted. The second chuck goes where your drill cycles are located, and the third at towards the bottom of the post.

 

 

 

# --------------------------------------------------------------------------
# format thread mill macro 9989 cycles
# --------------------------------------------------------------------------
fmt  "D" 2  P9989_D		  # ( D = TOOL DIAMETER )
fmt  "M" 2  P9989_M		  # ( M = MAJOR DIAMETER )
fmt  "T" 2  P9989_T		  # ( T = THREADS PER INCH )
fmt  "S" 2  P9989_S		  # ( S = SPRING PASS )
fmt  "R" 2  P9989_R		  # ( R = R-PLANE )

*********************************************************
  if drillcyc$ = 14,   # Helical Thread-mill macro 9989
	  [
	    refht_a = refht$
	    P9989_D = tldia$	 #TOOL DIA	  
	    P9989_M = peck1$	 #MAJOR DIA
	    P9989_T = peck2$	 #Threads per Inch
	    P9989_S = peckclr$   #SPRING PASS
	    P9989_R = refht$	 #R-PLANE

	   "(**** CUSTOM MACRO P9989 ****)", e$
	   pdrlcommonb
		 if peckclr$ > 0, pcan1, pbld, n$, "G66", "P9989", pfzout, *P9989_R, *P9989_M, *P9989_T, *P9989_S, *P9989_D, *feed, e$
		 if peckclr$ < 1, pcan1, pbld, n$, "G66", "P9989", pfzout, *P9989_R, *P9989_M, *P9989_T, *P9989_D, *feed, e$
	   pcan1, pbld, n$, pfxout, pfyout, e$
	   pcom_movea
	  ]



pcanceldc$	   #Cancel canned drill cycle

 if drillcyc$ < 8,
 [
  result = newfs (three, zinc)
  z$ = initht$
  if cuttype = one, prv_zia = initht$ + (rotdia$/two)
  else, prv_zia = initht$
  pxyzcout
  !zabs, !zinc
  prv_gcode$ = zero
  pbld, n$, "G80", e$
 ]

   if drillcyc$ > 7 & drillcyc$ <> 15,
   [
    prv_gcode$ = zero
    pbld, n$, "G67", e$
   clear_plane = initht$
   *clear_plane, e$
   ]
   if drillcyc$ = 15,
   [
    prv_gcode$ = zero
 #   pbld, n$, "G67", e$
   clear_plane = initht$
   *clear_plane, e$
   ]





*******************************************************
[drill cycle 15]
1. "Thread Mill MACRO-9989"
3. ""
7. "M = Major Thread Dia"
8. "T = Threads per Inch"
9. "S = Number of Spring"
10. ""
11. ""

Link to comment
Share on other sites
  • 2 weeks later...

I was not aware that any program could generate a custom macro b programs. Usually at our shop someone like me would write the macro or custom drill cycle and cut and paste in all of the hole positions. Probing is the same way but the macros are always stored in the machine. If you still need a macro I would be more than happy to help.

Link to comment
Share on other sites

Hi John, I am implementing the probing cycles you outlined above but I am modifying them to fit my needs, or trying to... Here is what I have for the first cycle:

 

pdrlcommonb ####### ID PROBE CYCLE ADDED 9/3/2013 RWW

#~drillcyc, e

if drillcyc$ = 8,

[

"(PROBE BORE)", e$

pbld, n$, "G65 P9510", pfzout, "F100.", e$ #WDS

pbld, n$, "G65 P9514", *featdia, e$ #BORE PROBE MACRO

pbld, n$, "G65 P9510", "Z1.0", "F100.", e$ #WDS

pcom_movea

]

 

This is for a Renishaw probe and the 9510 macros are protected positioning moves. Here are my questions:

 

1. For the retracting protected positioning move to Z1.0, what variable would I reference to retract to the retract or clearance plane as listed in the operation? The pfzout sets the depth correctly but I couldn't figure out how to retract correctly so I just hard coded Z1.0

2. There are several variables not listed that would be posted with the 9514 macro including those to make it set a work offset (S1 sets G54) or set feature tolerances. Is it possible to have these post out only if there is a non zero value for those variables?

 

This is posting good code right now but I know it can be cleaned up and improved. Once I have this working well I plan to make the edits to the rest of the cycles. Thanks for posting these, they are a huge help.

Link to comment
Share on other sites

Bob,

 

Try the initht$ variable''In your question about posting only if biiger than zero, I do something like this

 

[if inc_i_step > 0, *inc_i_step]

 

Here's the entire line so you can see how it's plugged in...

 

"G65 P9816", *probe_x, *probe_y, [if inc_i_step > 0, *inc_i_step], [if inc_j_step > 0, *inc_j_step], *probe_dpth, *work_set, e$

 

My entire cycle is like this

 

if drillcyc$ = 10,
          [
           probe_x = drl_prm1$
           probe_y = drl_prm2$
           inc_i_step = drl_prm3$
           inc_j_step = drl_prm4$
           work_set = drl_prm6$
           probe_dpth = depth$
           probe_clr = tosz$ + .25
           probe_clr1 = initht$
           "()", e$
           "G65 P9810", *probe_clr, "F100.", e$
           "(O9816 PROBE EXTERNAL CORNER)", e$
           "G65 P9816", *probe_x, *probe_y, [if inc_i_step > 0, *inc_i_step], [if inc_j_step > 0, *inc_j_step], *probe_dpth, *work_set, e$
           "G65 P9810", *probe_clr1, "F100.", e$

Link to comment
Share on other sites

Also, the formatting for the featdia variable is as follows:

 

fmt D 2 featdia

 

When this is posted, how can I make it post without the "D", so it just outputs the actual value? This would allow me to use that misc real for several different probing routines by making it more generic and calling it "featuresize". An example of this is for the bore probing cycle it would be the bore diameter, for a web probing cycle it would be the width of the web.

 

I would try to do something like this:

 

pbld, n$, "G65 P9514", "D", *featsize, e$

Link to comment
Share on other sites

Thank you! I have it mostly working but the Z retract isn't posting. Does that variable (*probe_clr1 or initht$) need to be formatted? Also, I assume the drl_prmX$ are the inputs in the toolpath operation? Is it possible to label these in the operation, similar to labeling misc integers and misc reals? Here is what I have. Also, my post is based on MP 14.0

 

pdrlcommonb										 ####### ID PROBE CYCLE ADDED 9/3/2013 RWW
#~drillcyc, e
if drillcyc$ = 8,
[
probe_x = drl_prm1$
probe_y = drl_prm2$
inc_i_step = drl_prm3$
inc_j_step = drl_prm4$
work_set = drl_prm6$
probe_dpth = depth$
probe_clr = tosz$ + .25
probe_clr1 = initht$
"(PROBE BORE)", e$
pbld, n$, "G65 P9510", pfzout, "F100.", e$ #WDS
pbld, n$, "G65 P9514", "D", *featsize, e$
pbld, n$, "G65 P9510", *probe_clr1, "F100.", e$ #WDS
pcom_movea
]

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