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:

Recommended Posts

i need one for drilling with carbide drills to change rpm  and feed on entry and feed and rpm  on the push threw my 600 variables are free it would be nice to just replace the g81 line with all inputs in that line and use all position in absolute (i looked threw all drilling cycles i can change feeds but cant change rpm but i might of missed it mazack ?)

O5001(GUN DRILL MACRO)

(ABSOLUTE MACRO)

(FEEDRATE WILL BE CALCULATED)

(BASED ON CHIP LOAD AND RPM)

(WORKS)

 

(FORMAT G65/G66 SICQRZE)

(S = #19 - INITIAL RPM)

(I = #4 - INCREMENTAL RPM)

(C = #3 - DRILL CHIP LOAD)

(Q = #17 - STEPOVER IN Z/ DOC)

(R = #18 - R PLANE)

(Z = #26 - Z START ZERO)

(E = #8 - END OF DRILL IN Z)

 

(*********************************)

(CALCULATE Z INCREMENTS)

#100=ABS[#26]-ABS[#8]

#100=ABS[#100]

IF[[#26*#8]GE0]GOTO1

#100=ABS[#26]+ABS[#8]

N1#101=ROUND[#100/#17]

#102=#100/#101

#103=#5001

#105=#5002

(GOTO CENTER OF HOLE)

G0G90X#103Y#105

Z#18

M03S050

G1Z#26F5.

#106=#5003

(SET INITIAL RPM, FEED)

#107=#19-#4

#108=#107*#3

(EXECUTE MACRO)

WHILE[#101GE0]DO1

IF[#101LT0]GOTO10

#101=#101-1.

M03S#107

G1Z#106F#108

(RECALCULATE Z, RPM, FEED)

#106=#106-#102

#107=#107+#4

#108=#107*#3

END1

N10M03S1000

G90G1Z#26F50.

M03S050

Z#18F5.

M5

X#103Y#105

M99

 

I'm not sure if this will work for you. I think you are looking for something much more simple. If you can tell me what your variable inputs are and what outcome you want I can write the macro for you. Thanks.

Link to comment
Share on other sites
Guest MTB Technical Services

Convert this to a custom G-code and add the logic to run it as a modal drill cycle call.

 

Then you can simply make it a custom cycle in Mastercam and modify the post.

 

I'd also change the M03 S50 to and M04 S50 for the initial hole entry/exit.

I've seen gun-drills mounted in HBMs go into launch mode because they bit on swarf during entry/exit of the starter hole.

Reversing for entry/exit is a good safeguard against it.

Link to comment
Share on other sites
Guest MTB Technical Services

Here's a FANUC Lathe G83 Deep Hole Peck Drilling Macro I wrote about 8 years ago.

Back then it was common to have a slant bed lathe without G83 type drilling.

 

%
O9013 (CUSTOM G83 DEEP HOLE CYCLE)
(ASSIGN G-CODE G83)
(SET PARAMETER #6053 = 83)
(CALL MACRO DRILLING CYCLE)
(G83 X0.0 Z0.0 W1.0 R0.1 Q0.1 K0.01 F0.008)

(X0. -HOLE LOCATION IN X)
(Z0. -HOLE LOCATION IN Z)
(W1.0 -INCREMENTAL HOLE DEPTH - ALWAYS POSITIVE)
(R0.1 -INCREMENTAL CLEARANCE PLANE AMOUNT - ALWAYS POSITIVE)
(Q0.1 -INCREMENTAL PECK DEPTH - ALWAYS POSITIVE)
(K0.01 -INCREMENTAL RETURN FROM RETRACT CLEARANCE - ALWAYS POSITIVE)
(F0.008 -FEEDRATE)

 

#6=ABS[#6]                  (FORCE K TO ABSOLUTE VALUE)
#9=ABS[#9]                  (FORCE F TO ABSOLUTE VALUE)
#17=ABS[#17]                (FORCE Q TO ABSOLUTE VALUE)
#18=ABS[#18]                (FORCE R TO ABSOLUTE VALUE)
#23=ABS[#23]                (FORCE W TO ABSOLUTE VALUE)
#1=[#26+#18]                (ASSIGN START POINT W/ R-PLANE TO VARIABLE)
#3=[#26-#23]                (ESTABLISH FINAL Z POSITION)

 

(ALARM LOGIC)
IF [#23 EQ 0.0] GOTO 9991   (INVALID W)
IF [#18 EQ 0.0] GOTO 9992   (INVALID R)
IF [#17 EQ 0.0] GOTO 9993   (INVALID Q)
IF [#17 GT #23] GOTO 9993   (INVALID Q)
IF [#6 EQ 0.0] GOTO 9994    (INVALID K)
IF [#6 GT #17] GOTO 9994    (INVALID K)
IF [#9 EQ 0.0] GOTO 9995    (INVALID FEED)

 

G00 Z[#1]                   (RAPID TO Z START W/ R-PLANE)
G00 X[#24]                  (RAPID TO X START)

 

N1000
#4=[#5002-#17]              (CHECK IF PECK IS FARTHER THAN FINAL DEPTH)
IF [#4 LE #3] GOTO 2000     (IF PECK IS FARTHER THAN FINAL DEPTH, GOTO N2000)
G01 W-[#17] F[#9]           (PECK DRILL)
#2=#5002                    (STORE CURRENT Z DEPTH)
G00 Z[#1]                   (RETRACT TO START POINT)
G00 Z[#2+#6]                (RETURN FROM RETRACT WITH CLEARANCE K)
GOTO 1000
N2000

 

#4=#3
G01 Z[#4] F[#9]             (DRILL TO FINAL DEPTH)
G00 Z[#1]                   (RETRACT TO START POINT)

M99

 

(ALARMS)
N9991
#3000=1(INVALID W-DEPTH!)

 

N9992
#3000=2(INVALID R-PLANE!)

 

N9993
#3000=3(INVALID Q-PECK!)

 

N9994
#3000=4(INVALID K-RETRACT!)

 

N9995
#3000=5(FEED F NOT SPECIFIED!)

 

M30
%

Link to comment
Share on other sites

i need one for drilling with carbide drills to change rpm  and feed on entry and feed and rpm  on the push threw my 600 variables are free it would be nice to just replace the g81 line with all inputs in that line and use all position in absolute (i looked threw all drilling cycles i can change feeds but cant change rpm but i might of missed it mazack ?)

O6000

(CARBIDE DRILL MACRO)

(FORMAT G65/G66 STRZQWFE)

(S = #19 - INITIAL TOOL RPM)

(T = #20 - BREAKTHROUGH TOOL RPM)

(R = #18 - R PLANE)

(Z = #26 - Z START ZERO)

(Q = #17 - Z START OF RPM & FEERATE CHANGE)

(W = #23 - END OF BREAKTHROUGH IN Z)

(F = #9 - INITIAL FEEDRATE)

(E = #8 - BREAKTHROUGH EXIT FEEDRATE)

 

(*********************************)

M03S#19

#600=#5001

#601=#5002

G0G90X#600Y#601

Z#26+.1

G1Z#17F#9

M03S#20

G1Z#23F#8

G0Z#18

X#600Y#601

M99

 

I think this is more of what you were looking for. Sorry about any confusion.

Link to comment
Share on other sites

Convert this to a custom G-code and add the logic to run it as a modal drill cycle call.

 

Then you can simply make it a custom cycle in Mastercam and modify the post.

 

I'd also change the M03 S50 to and M04 S50 for the initial hole entry/exit.

I've seen gun-drills mounted in HBMs go into launch mode because they bit on swarf during entry/exit of the starter hole.

Reversing for entry/exit is a good safeguard against it.

I do not know how to to do any of that. Is there a website that explains in further detail?

Link to comment
Share on other sites
Guest MTB Technical Services

Here's the post mods needed for the custom G83 lathe drilling macro posted above.

You can do the same thing with custom cycles.

You just need the post variables for the custom fields.

 

# --------------------------------------------------------------------------
# G83 PECK Drill output
# --------------------------------------------------------------------------

fmt  X  2   hole_x          #Hole Location X
fmt  Z  2   hole_z          #Hole Location Z
fmt  W  2   hole_depth_w    #Hole Depth W
fmt  R  2   hole_plane_r    #R-Plane
fmt  Q  2   hole_peck_q     #Peck Q
fmt  K  2   hole_retract_k  #Retract K

 

 

lpeck$           #Canned peck drill cycle, lathe

 

      gcode$ = zero
      prv_dwell$ = zero
      @dwell$
      comment$
      pcan
      hole_x = xabs
      hole_z = zdrl$
      hole_depth_w = abs(depth_z)
      hole_plane_r = abs(peckclr$)
      hole_peck_q = abs(peck1$)
      hole_retract_k = abs(retr$)

 

      n$,"G83", *hole_x, *hole_z, *hole_depth_w, *hole_plane_r, *hole_peck_q, *hole_retract_k, *pffr, e$
      pbld, n$, *sgcode, *pfzout, e$

 

      pcom_movea

Link to comment
Share on other sites
Guest MTB Technical Services

I do not know how to to do any of that. Is there a website that explains in further detail?

 

For the custom G-Code function, consult a FANUC manual.

It's not that difficult.

 

For the post functionality, get the MP post manual from your dealer.

While it's not very complicated, it doesn't lend itself to an easy explanation in a single post here.

 

Ron Branch at 5th Axis Consulting is the guy to talk to for details.

Link to comment
Share on other sites

For Fanuc 16/18/21 formats, macro programs can be called via G or M Code like this:

 

post-7736-0-60726300-1412975449_thumb.jpg

 

(Other controls will also map, but may use different parameters)

 

For example, if you put '101' in p6053, and the above macro in O9013, you could call it with:

 G101 S## T## R## Z## Q##

Mapping is an easier way to keep the macros that you use straight.

 

HTH  :cheers:

Link to comment
Share on other sites
Guest MTB Technical Services

For Fanuc 16/18/21 formats, macro programs can be called via G or M Code like this:

 

attachicon.gifMapping.jpg

 

(Other controls will also map, but may use different parameters)

 

For example, if you put '101' in p6053, and the above macro in O9013, you could call it with:

 G101 S## T## R## Z## Q##

Mapping is an easier way to keep the macros that you use straight.

 

HTH  :cheers:

 

 

The 30i Series as well. :thumbsup:

Link to comment
Share on other sites

mike93, on 09 Oct 2014 - 7:18 PM, said:

    i need one for drilling with carbide drills to change rpm  and feed on entry and feed and rpm  on the push threw my 600 variables are free it would be nice to just replace the g81 line with all inputs in that line and use all position in absolute (i looked threw all drilling cycles i can change feeds but cant change rpm but i might of missed it mazack ?)

O6000
(CARBIDE DRILL MACRO)
(FORMAT G65/G66 STRZQWFE)
(S = #19 - INITIAL TOOL RPM)
(T = #20 - BREAKTHROUGH TOOL RPM)
(R = #18 - R PLANE)
(Z = #26 - Z START ZERO)
(Q = #17 - Z START OF RPM & FEERATE CHANGE)
(W = #23 - END OF BREAKTHROUGH IN Z)
(F = #9 - INITIAL FEEDRATE)
(E = #8 - BREAKTHROUGH EXIT FEEDRATE)

(*********************************)
M03S#19
#600=#5001
#601=#5002
G0G90X#600Y#601
Z#26+.1
G1Z#17F#9
M03S#20
G1Z#23F#8
G0Z#18
X#600Y#601
M99

 

I think this is more of what you were looking for. Sorry about any confusion.

 

 

thank you i will try it next week.

Link to comment
Share on other sites

Hi cncchipmaker, I am retrofitting Kuraki KBH-12 with Mitsubishi M720V. The machine has W axis on Z-axis which moves in the same direction. I wonder if you have macro to compensate tool length when W move.

Or is there anyone who has experience on working on Kuraki Horizontal machine with W and Z axis? Thank you very much.

Link to comment
Share on other sites

i need one for drilling with carbide drills to change rpm  and feed on entry and feed and rpm  on the push threw my 600 variables are free it would be nice to just replace the g81 line with all inputs in that line and use all position in absolute (i looked threw all drilling cycles i can change feeds but cant change rpm but i might of missed it mazack ?)

 

You mean like this;

 

O5510

 (1/8" 15D EXTRA LENGTH COOLANT THROUGH CARBIDE DRILL 270 DEGREE SIDE)

IF[#153EQ#0]GOTO1

N0100 G00 G90 X.695 Y-.425 (B270.)

N0110 G43 H19 Z2.55 S500 M03

N0120 G01 Z1.47 F30.

N0130 S2567

N0140 G99 G81 Z.7773 R1.47 F3.59

N0150 G80

N0160 S500

N0170 G01 Z2.55 F120.

N0180 G80

N0190 G00 Z10.52

N1 M99

 

Edit: reloaded sub. I shoulda backplotted the path first.

Link to comment
Share on other sites

I named this cycle Chip Evacuation because I needed to evacuate chips from deep holes without the drill retracting all the way out of the hole.  The programmer has control of how much drill remains in the hole to avoid 'drill whip'.

 

In my post, this is custom cycle 12.  You can make it anything from 8 to 19 in your post.

 

This is the cycle, put it in the pdrlcst$ and pdrlcst_2$ sections:

     if drillcyc$ = 12,       #CHIP EVACUATION CYCLE
     [
      omitcycend = 1
      zabstemp = refht$ + drl_prm1$ - drl_sel_ref$
      zpecktemp = refht$ + drl_prm1$ - drl_sel_ref$
      zpeckclr = zpecktemp + peckclr$
      z$ = depth$
      zevac = refht$ + drl_prm3$ + drl_sel_tos$ - drl_sel_ref$
      pdrlcommonb
      pcout
      "G00 G90", pfxout, pfyout, e$
      *initht$, e$
      *refht$, e$
      "G01", *zpecktemp, *feed, e$
      "G00", *zevac, e$
      *zpeckclr, e$
      zpecktemp = zpecktemp - drl_prm4$
      zpeckclr = zpecktemp + peckclr$
      while zpecktemp > depth$,
      [
       "G01", *zpecktemp, feed, e$
       "G00", *zevac, e$
       *zpeckclr, e$
       zpecktemp = zpecktemp - drl_prm4$
       zpeckclr = zpecktemp + peckclr$
      ]
      "G01", pfzout, feed, e$
      "G00", *initht$, e$
      pcom_movea
      !x$, !y$
     ]

This cycle uses Custom Drill Parameters:

    #1 -- Initial Peck Size

    #3 -- Evac Depth (Incremental From Top of Hole)

    #4 -- Subsequent Peck Size

 

You will also need to format the variables for output like this:

fmt     4   omitcycend       #Flag for custom drill cycle
fmt  "Z" 2  zabstemp         #Custom calculation variable
fmt  "Z" 2  zpecktemp        #Custom calculation variable
fmt  "Z" 2  zevac            #Custom calculation variable
fmt  "Z" 2  zpeckclr         #Custom calculation variable

You also need to add this logic to pcanceldc$:

      if omitcycend = 0, pcan1, pbld, sg80, strcantext, e$
      omitcycend = 0

This outputs longhand code for each hole.

 

HTH  :cheers:

  • Like 2
Link to comment
Share on other sites

Does anyone have a macro for drilling where you already have a hole say 1" deep and you want to go back in with a longer drill but start at 1" deep and peck but always retract completely out of the hole?

O5000(CUSTOM PECK DRILL MACRO)

(ABSOLUTE MACRO)

(WORKS)

 

(FORMAT G65/G66 QRZEFIH)

(Q = #17 - STEPOVER IN Z/ DOC)

(R = #18 - R PLANE)

(Z = #26 - Z START ZERO)

(E = #8 - END OF DRILL IN Z)

(F = #9 - ENTRANCE FEEDRATE)

(I = #4 - PECK FEEDRATE)

(H = #11 - IN AND OUT FEEDRATE)

(*********************************)

#100=ABS[#26]-ABS[#8]

#100=ABS[#100]

IF[[#26*#8]GE0]GOTO1

#100=ABS[#26]+ABS[#8]

N1#101=ROUND[#100/#17]

#102=#100/#101

#103=#5001

#105=#5002

G0G90X#103Y#105

Z#18

G1Z#26F#9

#106=#5003

WHILE[#101GE0]DO1

IF[#101LT0]GOTO10

#101=#101-1.

G1Z#106F#4

Z#18F#11

Z[#106+.005]

#106=#106-#102

END1

N10G0G90Z#18

X#103Y#105

M99

 

I had one such application a couple of years ago. Here is the macro I came up with.

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

Do you have a macro for  facing a rectangle or square? Something where you can define the size and the tool diameter and it calculate step over. Plus tell it how much to take off and haw much per cut and it calculate it?

 I just started trying to write a macro's and trying to understand it at the same time. I thought it would be nice to have a program in the machine that when we went to prep a block we could just tell it the size of the block and how much to take off and what size facemill and start prepping. Instead of drawing it, then programing it at the computer sending the program to the machine.

Thanks in advance for any help.

Link to comment
Share on other sites

Do you have a macro for  facing a rectangle or square? Something where you can define the size and the tool diameter and it calculate step over. Plus tell it how much to take off and haw much per cut and it calculate it?

 I just started trying to write a macro's and trying to understand it at the same time. I thought it would be nice to have a program in the machine that when we went to prep a block we could just tell it the size of the block and how much to take off and what size facemill and start prepping. Instead of drawing it, then programing it at the computer sending the program to the machine.

Thanks in advance for any help.

This would not be a difficult macro to write, the only other bit of information I would need is what you would want the toolpath to look like. For instance do you want the tool to come off of the stock every pass or do you want it to stay on the part?

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