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:

Modifying Long Hand drill code


Recommended Posts

Would it be possible to modify my Peck drilling, set to output in long code, to give me option on feedrates for retract and return?

 

I would like something like this:

 

G1 Z-4.0 F5. (DRILL FEED)

G1 Z0. F50. (FAST FEED OUT)

G1 Z-3.8 F25.(SLOWER FEED BACK IN HOLE)

G1 Z-4.3 F5. (DRILL FEED)

.

Second part of my question, If this can be accomplished. Would this information be posted to the NCI file or only to final NC code?

As I I am using third party posts.

  • Like 1
Link to comment
Share on other sites

This section of code will do what you want. You will need to edit the text for the custom drill cycle name and drill parameters used in the control definition file. Also you will need to define variables used for output in your post.

 

To use this:

 

Select Custom Drill Cycle 9

Type desired entry feedrate in Drill Parameter #1

Type desired exit feedrate in Drill Parameter #2

 

The rest is the same as a normal peck drill cycle, with values for Peck 1, Peck 2, and Retract amount.

 

 if drillcyc$ = 9,	 #MODIFIED FEEDRATES CYCLE
 [
 omitcycend = 1
 zpecktemp = refht$ - peck1$ - drl_sel_ref$
 zpeckclr = zpecktemp + peckclr$
 entryfeed = drl_prm1$
 exitfeed = drl_prm2$
 z$ = depth$
 zevac = refht$ - drl_sel_ref$
 pdrlcommonb
 "G0 G90", pfxout, pfyout, e$
 *initht$, e$
 *refht$, e$
 "G1", *zpecktemp, *feed, e$
 "G1", *zevac, *exitfeed, e$
 "G1", *zpeckclr, *entryfeed, e$
 zpecktemp = zpecktemp - peck2$
 zpeckclr = zpecktemp + peckclr$
 while zpecktemp > depth$,
 [
 "G1", *zpecktemp, *feed, e$
 "G1", *zevac, *exitfeed, e$
 "G1", *zpeckclr, *entryfeed, e$
 zpecktemp = zpecktemp - peck2$
 zpeckclr = zpecktemp + peckclr$
 ]
 "G1", pfzout, *feed, e$
 "G1", *refht$, *exitfeed, e$
 "G0", *initht$, e$
 pcom_movea
 !x$, !y$
 ]

Link to comment
Share on other sites

This section of code will do what you want. You will need to edit the text for the custom drill cycle name and drill parameters used in the control definition file. Also you will need to define variables used for output in your post.

 

To use this:

 

Select Custom Drill Cycle 9

Type desired entry feedrate in Drill Parameter #1

Type desired exit feedrate in Drill Parameter #2

 

The rest is the same as a normal peck drill cycle, with values for Peck 1, Peck 2, and Retract amount.

 

 if drillcyc$ = 9,	 #MODIFIED FEEDRATES CYCLE
 [
 omitcycend = 1
 zpecktemp = refht$ - peck1$ - drl_sel_ref$
 zpeckclr = zpecktemp + peckclr$
 entryfeed = drl_prm1$
 exitfeed = drl_prm2$
 z$ = depth$
 zevac = refht$ - drl_sel_ref$
 pdrlcommonb
 "G0 G90", pfxout, pfyout, e$
 *initht$, e$
 *refht$, e$
 "G1", *zpecktemp, *feed, e$
 "G1", *zevac, *exitfeed, e$
 "G1", *zpeckclr, *entryfeed, e$
 zpecktemp = zpecktemp - peck2$
 zpeckclr = zpecktemp + peckclr$
 while zpecktemp > depth$,
 [
 "G1", *zpecktemp, *feed, e$
 "G1", *zevac, *exitfeed, e$
 "G1", *zpeckclr, *entryfeed, e$
 zpecktemp = zpecktemp - peck2$
 zpeckclr = zpecktemp + peckclr$
 ]
 "G1", pfzout, *feed, e$
 "G1", *refht$, *exitfeed, e$
 "G0", *initht$, e$
 pcom_movea
 !x$, !y$
 ]

 

Where in the .pst file does this custom cycle get inserted?

Link to comment
Share on other sites

Drill cycle does not work on my fanuc lathe control. Can I use the custom drill cycle #9 for peck drilling?

Is there a simpler custom cycle that will do the same thig as a G74? Or preferably G83?

 

clay

 

Custom cycles are tailored to do exactly what the post owner wants to achieve. With a little effort, you can learn how to code your own cycles to do exactly what you desire. Or hire someone to code it for you.

Link to comment
Share on other sites
  • 1 year later...

I love this macro, it opens more possibilities, however I feel the logic will get people in trouble.

There should be testing to ensure no overcut in the hole depths.

Here is update with testing statements to ensure depth wanted.

I found this in my testing & I hope this will help.

 

Testing is a must for your ensured accuracy.

Please do your own as I may have missed something!

------------

if drillcyc$ = 8, #MODIFIED FEEDRATES CYCLE, VER-2

[

omitcycend = 1

zpecktemp = refht$ - peck1$ - drl_sel_ref$

IF zpecktemp < depth$, zpecktemp = depth$

zpeckclr = zpecktemp + peckclr$

entryfeed = drl_prm1$

exitfeed = drl_prm2$

z$ = depth$

zevac = refht$ - drl_sel_ref$

pdrlcommonb

n$, "G0 G90", pfxout, pfzout, e$

n$, "G1", *Initht, e$

n$, "G1", *Refht, e$

n$, "G1", *zpecktemp, *feed, e$

n$, "G1", *zevac, *exitfeed, e$

IF zpecktemp <> depth$,

[

n$, "G1", *zpeckclr, *entryfeed, e$

zpecktemp = zpecktemp - peck2$

IF zpecktemp < depth$, zpecktemp = depth$

zpeckclr = zpecktemp + peckclr$

while zpecktemp > depth$,

[

n$, "G1", *zpecktemp, *feed, e$

n$, "G1", *zevac, *exitfeed, e$

n$, "G1", *zpeckclr, *entryfeed, e$

zpecktemp = zpecktemp - peck2$

if zpecktemp < depth$, zpecktemp = depth$

zpeckclr = zpecktemp + peckclr$

]

n$, "G1", *zpecktemp, *feed, e$

]

n$, "G1", *Refht, *exitfeed, e$

n$, "G0", *Initht, e$

pcom_movea

!x$, !y$

]

Link to comment
Share on other sites

I love this macro, it opens more possibilities, however I feel the logic will get people in trouble.

There should be testing to ensure no overcut in the hole depths.

Here is update with testing statements to ensure depth wanted.

I found this in my testing & I hope this will help.

 

Testing is a must for your ensured accuracy.

Please do your own as I may have missed something!

------------
   if drillcyc$ = 8,		#MODIFIED FEEDRATES CYCLE, VER-2
	[		
	 omitcycend = 1
	 zpecktemp = refht$ - peck1$ - drl_sel_ref$
	  IF zpecktemp < depth$, zpecktemp = depth$
	 zpeckclr = zpecktemp + peckclr$
	 entryfeed = drl_prm1$
	 exitfeed = drl_prm2$
	 z$ = depth$
	 zevac = refht$ - drl_sel_ref$
	 pdrlcommonb
	 n$, "G0 G90", pfxout, pfzout, e$
	 n$, "G1", *Initht, e$
	 n$, "G1", *Refht, e$
	 n$, "G1", *zpecktemp, *feed, e$
	 n$, "G1", *zevac, *exitfeed, e$
	  IF zpecktemp <> depth$,
	   [
		n$, "G1", *zpeckclr, *entryfeed, e$
		zpecktemp = zpecktemp - peck2$
		 IF zpecktemp < depth$, zpecktemp = depth$
		zpeckclr = zpecktemp + peckclr$
		 while zpecktemp > depth$,
		  [
		   n$, "G1", *zpecktemp, *feed, e$
		   n$, "G1", *zevac, *exitfeed, e$
		   n$, "G1", *zpeckclr, *entryfeed, e$
		   zpecktemp = zpecktemp - peck2$
			if zpecktemp < depth$, zpecktemp = depth$
		   zpeckclr = zpecktemp + peckclr$
		  ]
		n$, "G1", *zpecktemp, *feed, e$
	   ]
	 n$, "G1", *Refht, *exitfeed, e$
	 n$, "G0", *Initht, e$
	 pcom_movea
	 !x$, !y$
	]

 

Kind of an unwritten rule around here. Use at your own risk. :turned:

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