acondit

LTurnEXT.ngc

Oct 22nd, 2020 (edited)
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.64 KB | None | 0 0
  1. ( Variable List for GCodeCnv Lathe)
  2. #<_mat_length>=4.0000 ( Length of Material )
  3. #<_mat_Diameter>=0.7500 ( Diameter of Material )
  4. #<_mat_Radius>=[#<_mat_Diameter>/2] ( Radius of Material )
  5. #<_mat_surf>=0.000 ( Top of Material )
  6. #<_xorigin>=0.0000 ( X axis offset for Coordinate sys 2 )
  7. #<_zorigin>=0.0000 ( Z axis offset for Coordinate sys 2 )
  8. #<_toolnum>= 2 ( Set Tool Number e.g. 2 -- 1/8" diameter )
  9. #<_tooldia>=0.1250 ( Set the tool diameter )
  10. #<_toolrad>=[#<_tooldia>/2] ( Tool radius )
  11. #<_cutoffwidth>=0.0938 ( Cutoff Tool Width )
  12. #<_cutofffeed>=0.001 ( Cut off feed rate )
  13. #<_useFeedPerRev>=1 ( UseFeedPerRev )
  14. #<_xfeed>=5.0 ( XY Feed rate )
  15. #<_zfeed>=5.0 ( Z Feed rate )
  16. #<_finefeed>=2.0 ( Fine Feed rate )
  17. #<_stepin>=0.0100 ( plunge depth )
  18. #<_stepover>=0.0100 ( stepover distance )
  19. #<_spindlespeed>= 500 ( Spindle Speed )
  20. #<_close_X>= 0.050 ( Close to Origin )
  21. #<_close_Z>=0.050 ( Z clear height )
  22. #<_clear_X>=[#<_mat_Radius>+#<_close_X>] ( distance to clear X axis at end )
  23. #<_clear_Z>=[#<_mat_surf>+3.000] ( Distance for final retract )
  24. #<_safe_X>=[#<_mat_Radius>+#<_close_X>] ( X clear height )
  25. #<_safe_Z>=[#<_mat_surf>+#<_close_Z>] ( Z clear height )
  26. #<_sqcorner>=[[SQRT[2]-1]*[#<_toolrad>+0.0001]]( Offset of Tool radius to corner )
  27. #<_referencetool>=#5063
  28. ( End of Variable List )
  29.  
  30. ( Turn Outer Surface )
  31. (o<TurnEXT> call [XStartDia] [XEndDia] [ZStart] [ZEnd])
  32. o<TurnEXT> sub
  33. #<XStart> = [#1/2] ( starting radius )
  34. #<Xend> = [#2/2] ( depth to cut to )
  35. #<ZStart>=[0.0-#3]
  36. #<Zend>=[0.0-#4]
  37. #<localfeed> = #<_xfeed> ( variable feed rate )
  38. #<XCut> = [#<XStart>] ( starting radius )
  39. o<L1> DO
  40. G0 X[#<Xcut>+#<_close_X>] ( move X close to start position )
  41. Z[#<ZStart>+#<_close_Z>] ( move Z close to start position )
  42. o<L2> IF [#<Xend> LT [#<Xcut> - #<_stepover>]] ( set up X cutting position )
  43. #<Xcut> = [#<Xcut>-#<_stepover>]
  44. o<L2> ELSE
  45. #<Xcut> = #<Xend>
  46. #<localfeed> = #<_finefeed> ( change feed rate for finish cut )
  47. o<L2> ENDIF
  48. G01 X#<Xcut> F#<_finefeed> ( Position for X cut )
  49. Z#<Zend> F#<localfeed> ( Make Z cut )
  50. o<L1> WHILE [#<Xend> LT #<Xcut>] ( Loop until we cut to depth )
  51. G0 X[#<Xcut>+#<_close_X>] ( move X close to final cut position )
  52. Z[#<ZStart>+#<_close_Z>] ( move Z close to start position )
  53. G01 X#<Xcut> F#<_finefeed> ( Position for X spring cut )
  54. Z#<Zend> F#<localfeed> ( Make Z spring cut )
  55. G0 X[#<_mat_Radius>+#<_close_X>] ( Retract X to clear )
  56. G0 Z#<_close_Z> ( Retract Z to clear )
  57. o<TurnEXT> endsub
  58.  
  59. (Pre Code)
  60.  
  61. (Main Body Initialization Code)
  62. G20 G18 G40 G80 G92.1 G61
  63. G90
  64. G64 P.0002
  65. G10 L2 P1 X0.0 Z0.0
  66. G10 L2 P2 X#<_xorigin> Z#<_zorigin>
  67. T#<_toolnum>
  68. S#<_spindlespeed> M3
  69. M8
  70. G55
  71.  
  72.  
  73. o<TurnEXT> call [0.7500] [0.6250] [0.7500] [0.5000]
  74.  
  75. (Post Code)
  76. M5 M9
  77. G54
  78. G00 Z0.0
  79. X0.0
  80. M2
  81.  
Advertisement
Add Comment
Please, Sign In to add comment