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:

Spindle Load Micro


Mct010
 Share

Recommended Posts

I was just wondering if their is a micro program that would let the machine know that if a operator loaded a part wrong, and I put air passes in to prevent a crash, if a micro program could tell on the 1st pass if it cleared and had no load on the spindle (part is in right) it could jump to the correct N# to start cutting the part? or something like that?

 

Just wanted to know if can be done on a 16T fanuc control

 

Mike

Link to comment
Share on other sites

Ok word for word from my notes I do not even know who provided it but I did not make this I copied it:

 

Since many of the other turning guys out there are as frustrated as I am with

the lack of peck drilling provided by most lathes with Fanuc controls,

here's a Fanuc Custom Macro B program I wrote for a custom G-Code cycle.

G74 just doesn't cut it for a deep hole drilling.

 

It will work with any 16T/18T/21T with Custom Macro B.

 

While it doesn't support perecentage peck reduction for extremely deep holes it can easily be modified.

 

code:

  

%

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!)

GOTO 9999

 

N9992

#3000=2(INVALID R-PLANE!)

GOTO 9999

 

N9993

#3000=3(INVALID Q-PECK!)

GOTO 9999

 

N9994

#3000=4(INVALID K-RETRACT!)

GOTO 9999

 

N9995

#3000=5(FEED F NOT SPECIFIED!)

GOTO 9999

 

 

N9999

M30

%


Here are the necessary sections to copy and paste into a Mastercam vX post.

code:

 

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

# 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

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