(info: G76 Threading, Specify driveline and offset, use NEGATIVE offset I for External Thread) ; default values: ; external thread example: xi=0.5,k=0.05,i=-0.03 ; for majordiam=0.94,minordiam=0.84,i=-0.03 ; internal thread example: xi=0.39,k=0.05,i=+0.03 ; for majordiam=0.94,minordiam=0.84,i=+0.03 o sub # = #1 (= 10) # = #2 (= 200 Spindle RPM) # = #3 (= 0.5 X: Xi driveline) # = #4 (= -0.5 Z: Zi driveline) ; G76 required items: #

= #5 (= 0.125 P: Pitch, NEG for tpi) # = #6 (= -1.0 Z: Zf final) # = #7 (= -0.03 I: Thread peak offset) # = #8 (= 0.05 K: Full thread depth) # = #9 (= 0.015 J: Initial cut depth) ; G76 optional items: # = #10 (= 1.0 R: Depth degression) # = #11 (= 29.5 Q: Compound slide angle) # = #12 (= 0 H: No. of spring passes) # = #13 (= 0.050 E: Taper dist =K typ) # = #14 (= 2 L: End Taper 0,1,2,3) ; other: # = #15 (=3 Dir: Right=3 Left=4) # = #16 (=8 G7/G8 Radius=8 Diam=7) # = #17 (=0 0:silent, 1:verbose) o if [#

LT 0] #

= ABS[1 / #

] (debug, g76base: Computed pitch = #

from tpi) o endif o if [ [# NE 0] AND [# NE 1] AND [# NE 2] AND [# NE 3] ] (print, q76base: Require: L = 0 or 1 or 2 or 3 - EXITING) (debug, q76base: Require: L = 0 or 1 or 2 or 3 - EXITING) (AXIS,notify, q76base: Require: L = 0 or 1 or 2 or 3 - EXITING) m2 o endif o if [ [# NE 3] AND [# NE 4]] (print, q76base: Dir: 3 for RH 4 for LH - EXITING) (debug, q76base: Dir: 3 for RH 4 for LH - EXITING) (AXIS,notify, q76base: Dir: 3 for RH 4 for LH - EXITING) m2 o endif o if [ [# NE 7] AND [# NE 8] ] (print, q76base: Mode: 7 for D 8 for R - EXITING) (debug, q76base: Mode: 7 for D 8 for R - EXITING) (AXIS,notify, q76base: Mode: 7 for D 8 for R - EXITING) m2 o endif o if [#<_vmajor> lT 2.6] ; no introspection on lathe radius/diameter mode ; so allow only G8 (radius mode) o if [# NE 8] (print, g76base: v2.5 requires G8 - EXITING) (debug, g76base: v2.5 requires G8 - EXITING) (AXIS,notify, g76base: v2.5 requires G8 - EXITING) m2 o endif o else ; >= 2.6 ; use introspection on lathe radius/diameter mode ; to restore mode o if [#<_lathe_diameter_mode> EQ 1] # = 7 ; diam o endif o if [#<_lathe_radius_mode> EQ 1] # = 8 ; radius o endif o if [ [#<_lathe_diameter_mode> EQ 0] AND [ #<_lathe_radius_mode> EQ 0] ] ; not supposed to happen: (print, g76base: unexpected lathe mode - EXITING) (debug, g76base: unexpected lathe mode - EXITING) (AXIS,notify, g76base: unexpected lathe mode - EXITING) m2 o endif o if [ [#<_lathe_diameter_mode> EQ 1] AND [ #<_lathe_radius_mode> EQ 1] ] ; not supposed to happen: (print, g76base: unexpected lathe mode - EXITING) (debug, g76base: unexpected lathe mode - EXITING) (AXIS,notify, g76base: unexpected lathe mode - EXITING) m2 o endif o endif G# o if [# GT 0] o if [# EQ 7] (debug, g76base: set G7 DIAMETER mode) o else (debug, g76base: set G8 RADIUS mode) o endif o endif o call [#] M# S# G0 X# Z# G76 P#

Z# I# J# R# K# Q# H# E# L# o if [[#<_vmajor> GE 2.6] AND [# GT 0]] (debug, g76base restoring mode to G #) o endif o endsub