Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ( Variable List for GCodeCnv Lathe)
- #<_mat_length>=4.0000 ( Length of Material )
- #<_mat_Diameter>=0.7500 ( Diameter of Material )
- #<_mat_Radius>=[#<_mat_Diameter>/2] ( Radius of Material )
- #<_mat_surf>=0.000 ( Top of Material )
- #<_xorigin>=0.0000 ( X axis offset for Coordinate sys 2 )
- #<_zorigin>=0.0000 ( Z axis offset for Coordinate sys 2 )
- #<_toolnum>= 2 ( Set Tool Number e.g. 2 -- 1/8" diameter )
- #<_tooldia>=0.1250 ( Set the tool diameter )
- #<_toolrad>=[#<_tooldia>/2] ( Tool radius )
- #<_cutoffwidth>=0.0938 ( Cutoff Tool Width )
- #<_cutofffeed>=0.001 ( Cut off feed rate )
- #<_useFeedPerRev>=1 ( UseFeedPerRev )
- #<_xfeed>=5.0 ( XY Feed rate )
- #<_zfeed>=5.0 ( Z Feed rate )
- #<_finefeed>=2.0 ( Fine Feed rate )
- #<_stepin>=0.0100 ( plunge depth )
- #<_stepover>=0.0100 ( stepover distance )
- #<_spindlespeed>= 500 ( Spindle Speed )
- #<_close_X>= 0.050 ( Close to Origin )
- #<_close_Z>=0.050 ( Z clear height )
- #<_clear_X>=[#<_mat_Radius>+#<_close_X>] ( distance to clear X axis at end )
- #<_clear_Z>=[#<_mat_surf>+3.000] ( Distance for final retract )
- #<_safe_X>=[#<_mat_Radius>+#<_close_X>] ( X clear height )
- #<_safe_Z>=[#<_mat_surf>+#<_close_Z>] ( Z clear height )
- #<_sqcorner>=[[SQRT[2]-1]*[#<_toolrad>+0.0001]]( Offset of Tool radius to corner )
- #<_referencetool>=#5063
- ( End of Variable List )
- ( Turn Outer Surface )
- (o<TurnEXT> call [XStartDia] [XEndDia] [ZStart] [ZEnd])
- o<TurnEXT> sub
- #<XStart> = [#1/2] ( starting radius )
- #<Xend> = [#2/2] ( depth to cut to )
- #<ZStart>=[0.0-#3]
- #<Zend>=[0.0-#4]
- #<localfeed> = #<_xfeed> ( variable feed rate )
- #<XCut> = [#<XStart>] ( starting radius )
- o<L1> DO
- G0 X[#<Xcut>+#<_close_X>] ( move X close to start position )
- Z[#<ZStart>+#<_close_Z>] ( move Z close to start position )
- o<L2> IF [#<Xend> LT [#<Xcut> - #<_stepover>]] ( set up X cutting position )
- #<Xcut> = [#<Xcut>-#<_stepover>]
- o<L2> ELSE
- #<Xcut> = #<Xend>
- #<localfeed> = #<_finefeed> ( change feed rate for finish cut )
- o<L2> ENDIF
- G01 X#<Xcut> F#<_finefeed> ( Position for X cut )
- Z#<Zend> F#<localfeed> ( Make Z cut )
- o<L1> WHILE [#<Xend> LT #<Xcut>] ( Loop until we cut to depth )
- G0 X[#<Xcut>+#<_close_X>] ( move X close to final cut position )
- Z[#<ZStart>+#<_close_Z>] ( move Z close to start position )
- G01 X#<Xcut> F#<_finefeed> ( Position for X spring cut )
- Z#<Zend> F#<localfeed> ( Make Z spring cut )
- G0 X[#<_mat_Radius>+#<_close_X>] ( Retract X to clear )
- G0 Z#<_close_Z> ( Retract Z to clear )
- o<TurnEXT> endsub
- (Pre Code)
- (Main Body Initialization Code)
- G20 G18 G40 G80 G92.1 G61
- G90
- G64 P.0002
- G10 L2 P1 X0.0 Z0.0
- G10 L2 P2 X#<_xorigin> Z#<_zorigin>
- T#<_toolnum>
- S#<_spindlespeed> M3
- M8
- G55
- o<TurnEXT> call [0.7500] [0.6250] [0.7500] [0.5000]
- (Post Code)
- M5 M9
- G54
- G00 Z0.0
- X0.0
- M2
Advertisement
Add Comment
Please, Sign In to add comment