( Cone cycle ) ( Copyright 2010 LUDA Mechatronik GmbH ) ( alle Rechte vorbehalten ) ( Benutzung auf eigene Gefahr ) (generates roughing and finish paths for turning a cone) (the line from X1/Z1 to X2/Z2 defines the cone) ( o call [X1][Z1][X2][Z2][step][feed][EngageZ][ClearAxial][ClearRadial][feedF][outflag]) O sub (Startpoint) # = [#1] # = [#2] (Endpoint) # = [#3] # = [#4] # = [#5] (Radial stepdown) # = [#6] (Roughing feed rate) # = [#7] (Clearance to stock) # = [#8] (Axial rest material for finishing) # = [#9] (Radial rest material for finishing) # = [#10] (Finishing feed rate) # = [#11] (Lead out move) # = [#3] (Start position in X) #=[1/ABS[[#-#]/[#-#]]] (Cone ratio) (set axial step direction) O if [[# LT 0] AND [# LT 0]] #=-ABS[#] O endif (initial move to start point) G90 G0 X[#] Z[#+#] G64 (Roughing cycle) O while [[ABS[#-#] - [ABS[#]+#]] GE 0] #=[# - #] G0 X[#] #=ABS[[[#]-[#]]] G1 Z[#-[#*#]+#] F[#] O if [# EQ 1] (45° lead out) O if [# LT 0] G0 X[# + [#]/2] Z[#-#*#+# - #/2] F[#] O else G0 X[# + [#]/2] Z[#-#*#+# + #/2] F[#] O endif G0 Z[#+#] O else (or 90° lead out) G1 X[# + [#]] F[#] G0 Z[#+#] O endif O endwhile (last roughing step) O if [# NE [#+#]] #=[#+#] G0 X[#] #=ABS[[[#]-[#]]] G1 Z[#-[#*#]+#] F[#] O if [# EQ 1] O if [# LT 0] G0 X[# + [#]/2] Z[#-#*#+# - #/2] F[#] G0 Z[#+#] O else G0 X[# + [#]/2] Z[#-#*#+# + #/2] F[#] G0 Z[#+#] O endif O else O if [# LT 0] G1 X[# - [#]] F[#] G0 Z[#+#] O else G1 X[# + [#]] F[#] G0 Z[#+#] O endif O endif G0 Z[#+#] O endif (finish cycle if finish feedrate is set) O if [# GT 0] G0 Z[#+#] G61 G0 X[#] G1 Z[#] G1 X[#] Z[#] F[#] G0 Z[#] G64 O else G0 X[#] Z[#] O endif o endsub M2