Centroid G65 Macro Program for Slots of varying Depth and Length


Submit by: cnc programmer

Drawing/Image

Centroid G65 Macro Program for Slots of varying Depth and Length

CNC Program

;The main program would call this macro five times,
;each time specifying the depth and length required.

;macro variables would handle the length in the Y direction
;and depth in the Z direction

Main Program

G90 G0 X1 Y1 Z0.1 ;Move to first notch
G65 P0002 L1 Y1 Z.25 ;Call macro and assign Y=1" and Z=.5"
G90 G0 X2.5 Y1
G65 P0002 L1 Y1.5 Z.5 ;Call macro and assign Y=1.5" and Z=.5"
G90 G0 X4 Y1
G65 P0002 L1 Y2 Z.25 ;Call macro again
G90 G0 X5.5 Y1
G65 P0002 L1 Y1.5 Z.5 ;Call macro again
G90 G0 X7 Y1
G65 P0002 L1 Y1 Z.25 ;Call macro again

Sub Program

O0002
G90 G1 Z0 F30
Z#Z F5 ;Cut to variable depth
G91 Y#Y F10 ;Cut variable length
G90 G0 Z0.1 ;Retract