% O9009 (Broach Test) (This program was written for a 2009) (Hurco VM10) (Your machine may not have the same) (g code syntax) (always run a test piece first) (always run Z high first) (No.14 machine shop is not liable) (for machine crashes) (This program is for educational) (purposes only) () () () (This program uses G55) (Broach tool is Tool#19) (G55 X zero is center of bore) (G55 y zero is center of bore) (G55 Z zero is top of part) (Must indicate insert square to X travel of machine) (Using G0 which travels along dogleg path.) (T19 - broach tool) () () (Variables) #901 = 0.1243 (Finished Keyway width) #902 = 0.055 (Depth of keyway) #903 = 0.096 (Insert Width) #904 = -0.001 (Amount of stock removed per stroke) #905 = 1.3 (Z stroke length) #906 = 30.0 (Stroke Feedrate) #907 = [#902/#904] (number of advances) #908 = #904 (908 is the y advance accumulator) #909 = [#901-#903]/2 (X side step) #910 = -0.358 (Y start point from broach calc file) #911 = 0.055 (maximum depth of cut allowed by insert) () () (logical checks) IF[#903GT#901]GOTO 30 IF[#902GT#911]GOTO 50 GOTO 51 N30 #3000=100 (Keyway width cannot be less than insert width) N50 #3000=100 (Insert can't cut that deep) () () N51 G90 G17 G94 G20 G05.3 P5 T19 M6 M19 G17 G90 G94 G55 M8 G00 X0 Y0 Z0.2 H19 N100 Y#910 () () (start of broaching) () () G00 G91 Y#908 G90 G01 Z-#905 F#906 G00 Y#910 Z0.2 #908=[#908+#904] IF[#908 EQ -#902] GOTO 200 GOTO100 () () N200 IF[#909EQ0]GOTO 600 () () #908=#904 () () (Side Step #1) N300 G90 G00 X#909 Y#910 G00 G91 Y#908 G90 G01 Z-#905 F#906 G00 Y#910 Z0.2 #908=[#908+#904] IF[#908 EQ -#902] GOTO 400 GOTO300 () () N400 () () #908=#904 () () (Side Step #2) N500 G90 G00 X-#909 Y#910 G00 G91 Y#908 G90 G01 Z-#905 F#906 G00 Y#910 Z0.2 #908=[#908+#904] IF[#908 EQ -#902] GOTO 600 GOTO500 () () N600 () () M9 M5 G53 G0 Z0. G53 X13. G53 Y15.99 M2