Hi all,
I have written a macro to put an oil groove on a part using the G32 cycle. It works OK, but I am having a slight issue. The macro is as follows:
(OIL GROOVE MACRO)
(SET USER INPUTS BELOW)
(REQUIRES PROVE)
(USER INPUTS)
#100=1.(ABSOLUTE Z START POSITION)
#101=-26.(ABSOLUTE Z END POSITION)
#102=25.(SPINDLE SPEED)
#103=48.0(START DIA)
#104=49.25(END DIA)
#105=0.025(DEPTH OF CUT - ON RADIUS)
(CALCULATIONS)
#105=ABS[#105]*2(DEPTH OF CUT ALWAYS POSITIVE AND ON DIA)
#106=ABS[#100]+ABS[#101](TOTAL CUT LENGTH PER PASS)
#107=#106*4(CALCULATE FEED/REV)
#108=ABS[#103-#104](CALULATE AMOUNT TO CUT)
T0707M08(CALL TOOL AND OFFSET)
G00G97G99S#102M03(R/MIN - FEED/REV - SET SPINDLE SPD C/W)
X#103Z[#100+20.](RAPID TO INITIAL POSITION)
Z#100
WHILE[#108GT#105]DO1(SET LOOP)
G0U#105(FIRST DEPTH OF CUT)
G32Z#101F#107(Z PASS 1 - IN)
Z#100(Z PASS 2 - OUT)
Z#101(Z PASS 3 - IN)
Z#100(Z PASS 4 - OUT)
#108=#108-ABS[#105](UPDATE COUNTER)
END1
(REMAINDER)
N1111G0U#108(LAST PASS)
G32Z#101F#107(Z PASS 1 - IN)
Z#100(Z PASS 2 - OUT)
Z#101(Z PASS 3 - IN)
Z#100(Z PASS 4 - OUT)
G0Z20.
X250.Z200.(SAFE POS)
T0700(CANCEL TOOL OFFSETS)
M05
M01
So basically for every revolution of the spindle, the tool moves in and out twice. The problem i'm having is on the final pass (the REMAINDER section of my macro). I don't know if it is a control issue (Fanuc series O-T), but when #108 becomes equal to #105, it should skip to the REMAINDER section of my macro (as #108 is not greater than #105). However, it does one more loop of the WHILE loop, then goes to the remainder. (It may be worth adding that after this 'extra' pass on the WHILE loop, when the counter is updated, the value returned on the control is '*********', not zero??).
I hope this is explained well enough as this is incredibly difficult to put into words!
Thanks in advance,
Alex.