subd.ngc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. %
  2. ( *************************************************************************** )
  3. ( * Cut a hole for a D-SUB connector * )
  4. ( * Metrical RS274/NGC program * )
  5. ( * Copyright 2009 Michael Buesch <mb@bu3sch.de> * )
  6. ( * Licensed under the GNU/GPL version 3 * )
  7. ( *************************************************************************** )
  8. #<_cutter_dia> = 6 ( Cutter diameter )
  9. #<_speed> = 1000 ( min^-1 )
  10. #<_feed> = 100 ( mm/min )
  11. #<_zfeed> = 50 ( mm/min in Z axis )
  12. #<_depth> = 3 ( Cutting depth )
  13. #<_depth_step> = 0.5 ( Step for cutting in depth)
  14. ( 25 pin D-SUB )
  15. #<_width_top> = 42
  16. #<_width_bot> = 39.5
  17. #<_height> = 12
  18. G17 G40 G49 G80 G90 G94 G61 G21 ( Initial modes )
  19. (G53 G0 X0 Y0 Z0)
  20. G54 S#<_speed> F#<_feed> M3
  21. #<_h> = [[#<_height> / 2] - [#<_cutter_dia> / 2]]
  22. #<_wtop> = [[#<_width_top> / 2] - [#<_cutter_dia> / 2]]
  23. #<_wbot> = [[#<_width_bot> / 2] - [#<_cutter_dia> / 2]]
  24. #<z> = 0
  25. G0 X0 Y#<_h> Z1
  26. G1 Z0
  27. O901 while [#<z> lt #<_depth>]
  28. #<z> = [#<z> + #<_depth_step>]
  29. O902 if [#<z> gt #<_depth> ]
  30. #<z> = #<_depth>
  31. O902 endif
  32. G1 Z[#<z> * -1] F#<_zfeed>
  33. G1 X#<_wtop> F#<_feed>
  34. G1 X#<_wbot> Y[-1 * #<_h>]
  35. G1 X[-1 * #<_wbot>]
  36. G1 X[-1 * #<_wtop>] Y#<_h>
  37. G1 X0
  38. O901 endwhile
  39. G1 X1
  40. G0 Z30
  41. G53 G0 X0 Y0 M5
  42. M30
  43. %
  44. vim: syntax=rs274ngc ts=4