Parametric Program for Finishing Pulley Grooves

Sample Parametric Program to Finish Pulley Grooves:

O0123 (MAIN PROGRAM)

(WRITTEN BY ADVANCED CNC SOLUTIONS)
( A CONTRACT CNC PROGRAMMING SERVICES PROVIDER)

(PARAMETRIC PROGRAM TO FINISH PULLEY GROOVES)
(USED ON 2 AXIS OR 4 AXIS CNC LATHE WITH MOST ANY FANUC CNC CONTROL)

(Copyright © 2012 AdvancedCNCSolutions.com)

(PROGRAM DESIGNED TO FINISH GROOVE ANY ONE OF AN INFINITE)

(  NUMBER OF PULLEY GROOVE CONFIGURATIONS)

(EDIT PARAMETRIC VARIABLES IN MACRO CALL STATEMENTS)

(  TO YOUR SPECIFIC PART DIMENSIONS AND TOOL SPECS)

(SEE INCLUDED STANDARD PULLEY GROOVE DIMENSIONING SCHEME)

(9 PARAMETERS CONTROL ALL DIMENSIONS OF PULLEY GROOVE FEATURE)

(  ALONG WITH 3 PARAMETERS TO CONTROL GROOVE TOOL SPECIFICATIONS)

(TOOL TIP X&Z ZERO IS PROGRAMMED FROM END OF AND LEFT EDGE OF TOOL)

(TOOL NOSE RADIUS CUTTER COMPENSATION IS FACTORED INTO CALCULATIONS)

(THIS PROGRAM WILL ALSO FUNCTION WITH A FULL NOSE RADIUS TOOL TIP)

(FOR FULL NOSE RADIUS TOOL SIMPLY SET Y TO EQUAL W/2)

(NOTE: THIS IS CURRENTLY AN UNPROVEN EXAMPLE PROGRAM!)
(NOTE: PULLEY GROOVE WILL NEED TO BE ROUGHED OUT BEFORE FINISHING)

 

Pulley(==== MACRO VARIABLE DEFINITIONS ====)
(X = OUTSIDE DIAMETER)
(Z = OVERALL LENGTH)
(A = AXIAL DISTANCE TO GROOVE CENTER)
(D = GROOVE DEPTH)
(I = INCLUDED ANGLE OF GROOVE)
(U = DIAMETER ACROSS PINS)
(V = PIN DIAMETER)
(C = RADIAL TOOL APPROACH CLEARANCE)
(R = PART GROOVE RADIUS)
(W = TOOL WIDTH)
(Y = TOOL RADII)
(F = FEEDRATE)

 

 

 

 

 

(SAMPLE OF MAIN PROGRAM STUB TO CALL FANUC CUSTOM MACRO B SUB-PROGRAM)

(MACRO CALL TO CUT 1ST GROOVE AT 1.0" FROM FRONT OF PART)
N0060 G65 P1001 X6. Z4. A1. D1. I34. U6.5 V.875 C.1 R.031 W.125 Y.008 F.006

(MACRO CALL TO CUT 2ND GROOVE AT 2.0" FROM FRONT OF PART)
N0070 G65 P1001 X6. Z4. A2. D1. I34. U6.5 V.875 C.1 R.031 W.125 Y.008 F.006

M30
%

O1001 (CNC PARAMETRIC PROGRAM)

(===== INPUT ERROR CHECKING =====)
IF [#24 EQ #0] GOTO 9001
IF [#26 EQ #0] GOTO 9001
IF [#1 EQ #0] GOTO 9001
IF [#7 EQ #0] GOTO 9001
IF [#4 EQ #0] GOTO 9001
IF [#21 EQ #0] GOTO 9001
IF [#22 EQ #0] GOTO 9001
IF [#3 EQ #0] GOTO 9001
IF [#18 EQ #0] GOTO 9001
IF [#23 EQ #0] GOTO 9001
IF [#25 EQ #0] GOTO 9001
IF [#9 EQ #0] GOTO 9001

IF [#24 LT 0] GOTO 9002
IF [#26 LT 0] GOTO 9002
IF [#1 LT 0] GOTO 9002
IF [#7 LT 0] GOTO 9002
IF [#4 LT 0] GOTO 9002
IF [#21 LT 0] GOTO 9002
IF [#22 LT 0] GOTO 9002
IF [#3 LT 0] GOTO 9002
IF [#18 LT 0] GOTO 9002
IF [#23 LT 0] GOTO 9002
IF [#25 LT 0] GOTO 9002
IF [#9 LT 0] GOTO 9002

 

(===== VARIABLE ASSIGNMENTS =====)

#101 = #24

#102 = #26

#103 = #1

#104 = #7

#105 = #4

#106 = #21

#107 = #22

#108 = #3

#109 = #18

#110 = #23

#111 = #25

#112 = #9

(X = OUTSIDE DIAMETER)

(Z = OVERALL LENGTH)

(A = AXIAL DISTANCE TO GROOVE CENTER)

(D = GROOVE DEPTH)

(I = INCLUDED ANGLE OF GROOVE)

(U = DIAMETER ACROSS PINS)

(V = PIN DIAMETER)

(C = RADIAL TOOL APPROACH CLEARANCE)

(R = PART GROOVE RADIUS)

(W = TOOL WIDTH)

(Y = TOOL RADII)

(F = FEEDRATE



(===== CALCULATIONS =====)

#121 = [#106-#107]/2

#122 = #102-#103

#123 = #101/2

#124 = #107/2

#125 = #105/2

#126 = 90-#125

#127 = #121-#124*SIN[#125]

#128 = #122-#124*COS[#125]

#129 = SIN[#126]

#130 = COS[#126]

#131 = TAN[#126]

#132 = #111*[1-TAN[45-#126/2]]

#133 = #111*[1-TAN[#126/2]]

#134 = #109-#111

#135 = #134*[1/#129-1/#131]

(X VALUE CENTER OF PIN)

(Z VALUE CENTER OF PIN)

(X RADIUS VALUE)

(PIN RADIUS)

(HALF INCLUDED ANGLE)

(COMPLEMENT OF ANGLE)

(X PIN TANGENT)

(Z PIN TANGENT)

(SINE OF ANGLE)

(COSINE OF ANGLE)

(TANGENT OF ANGLE)

(X TOOL NOSE RADIUS CUTTER COMP)

(Z TOOL NOSE RADIUS CUTTER COMP)

(PROGRAM RADIUS = PART-TOOL RAD)

(ARC CALCULATION)


(===== ASSIGN VARIABLES FOR PARAMETRIC CUTTER PATHS =====)

#141 = #101+2*#108

#151 = #128-[#123-#127+#108]/#131-#133

#161 = 2*#122-#151-#110

#142 = #101-2*#104+2*#134*[1-#130]

#152 = #151+[#141-#142]/[2*#131]

#162 = 2*#122-#152-#110

#143 = #101-2*#104

#153 = #128-[#123-#127-#104]/#131-#133+#135

#163 = 2*#122-#153-#110

#144 = #143

#154 = #153+[#163-#153]/2

#164 = 2*#122-#154-#110

(X ---- 1ST)

(Z L -- 1ST)

(Z R -- 1ST)

(X ---- 2ND)

(Z L -- 2ND)

(Z R -- 2ND)

(X ---- 3RD)

(Z L -- 3RD)

(Z R -- 3RD)

(X ---- 4TH)

(Z L -- 4TH)

(Z R -- 4TH)


(===== TOOL WIDTH CALCS =====)
#136 = #110-2*#111+[#163-#153]          (MAX FLAT BOTTOM TOOL WIDTH)
#137 = #136+2*#111                               (MAXIMUM TOOL WIDTH)
(========================)


(===== ERROR CHECKING =====)
IF [#153 LE #163] GOTO 11
M00 (TOOL WIDTH #110 IS TOO WIDE FOR CURRENT GROOVE SPECS)
M00 (SEE #137 FOR MAX TOOL WIDTH FOR CURRENT GROOVE SPECS)
GOTO 9003
N11

IF [#134 GE 0] GOTO 12
M00 (TOOL RADIUS #111 MUST BE <= PART RADIUS #109)
GOTO 9004
N12
(======================)


(======= START OF PARAMETRIC GROOVING OPERATION =======)

G00 X#141 Z#151

G01 X#142 Z#152 F#112

IF [#134 LE 0] GOTO 20

G03 X#143 Z#153 R#134

N20

IF [#154 LE #153] GOTO 30

G01           Z#154

N30

G00 X#141

                 Z#161

G01 X#142 Z#162 F#112

IF [#134 LE 0] GOTO 40

G02 X#143 Z#163 R#134

N40

IF [#164 GE #163] GOTO 50

G01          Z#164

N50

G00 X#141

(POSITION X & Z)

(CUT LEFT FLANK)

(IF NO RAD THEN SKIP ARC MOVE)

(CUT RADIUS)

 

(IF NO GROOVE FLAT THEN SKIP)

(CUT FLAT AT GROOVE BOTTOM)

 

(RETRACT X)

(POSITION Z)

(CUT RIGHT FLANK)

(IF NO RAD THEN SKIP ARC MOVE)

(CUT RADIUS)

 

(IF NO GROOVE FLAT THEN SKIP)

(CUT FLAT AT GROOVE BOTTOM)

 

(RETRACT X)

(===========================================)


GOTO 9999
N9001 #3000=101 (MISSING PARAMETER IN MACRO CALL)
N9002 #3000=102 (VALUE MUST BE POSITIVE)
N9003 #3000=103 (TOOL WIDTH IS TOO WIDE)
N9004 #3000=104 (TOOL RADIUS TOO LARGE)
N9999


M99
%

Return to News