Originally Posted by
WallaceLau
I am a total newbie as well, but I have done a lot of computer programming in the past so G-code (and sub-routine) is cake.
Given the simplicity of the task, I don't think you need to worry about G54 parts-location. In fact, if the o-ring distance is the same, you can even save more time by this:
##################################################
(Setup Steps)
G90 Absolute coordinate mode
T15 M06 (Tool change to Tool#15)
G00 Z10 (Move to safe Z)
M08 (coolant on)
S3000 M03 (spindle start 3000 rpm)
(Setup your position to start the 6 grooves)
G00 X123 Y456 (Move to first groove. Replace 123/456 with the ACTUAL coordinate of the TOP of your left-most groove)
(Cut those 6 grooves)
M97 P20000 L6 (call Sub routine 20000 and repeat 6 times)
M30 (program ends - should stop spindle and coolant automatically, if not specify M-code prior)
==================================================
N20000 (Main routine)
G00 Z1 (Move tool close to part)
G01 Z0.02 F50 (Move tool to just above part - if your measurement/machine is dead accurate, you can G00/rapid to it)
G91 (specify incremental mode)
(This part is the actual chip making)
M97 P21000 L7 (Call the 2nd sub to loop program 7 times. i.e. Circular interpolate from Z0.02, 0.2mm each time, and repeat 7 times - which should give you final Z height being -1.38 (0.02-(0.2*7)=-1.38). Note, This is assuming the surface of your part is Z0.)
G02 X0 Y0 J-10.32 F125 (run another circle without changing Z, so it bottom of the groove is flat)
G02 X0 Y0 J-10.32 Z1.38 F125 (run yet another circle to ramp out of the groove - optional but it eliminates any chance the cutting tool make a tiny vertical slot in the groove due to tool deflection)
G00 Z10 (Move tool to safe Z)
G00 X30 (Move 30mm to the next groove)
G90 (Go back to absolute mode)
M99
==================================================
N21000 (2nd routine)
G02 X0 Y0 J-10.32 Z-0.2 F125 (circular interpolation, where end-point is the SAME as start point (hence both X/Y = 0 as you are in G91). Center of circle, J, is -10.32 from the starting point. Also Z will ramp down 0.2mm each time.)
M99
##################################################
The only catch with this, is that your tool will move 30mm again after the last groove is cut. If it will ramp into other stuff, or reach your travel limit (I doubt it), then you can't use it this way. Also I am assuming the surface of the part is Z=0, if not obviously make adjustments. Hope this helps!
Wallace