Advertisement
Guest User

Untitled

a guest
Aug 4th, 2012
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. ( Rectangular Probing )
  2. ( )
  3. ( This program is based on smartProbe, but is a bit different )
  4. ( probed location to the file 'probe-results.ngc' in the same directory )
  5. ( as the .ini file )
  6.  
  7. (Configuration section)
  8. G20 (Inches)
  9. F20 (probe speed)
  10.  
  11. http://www.linuxcnc.org/index.php/english/component/kunena/?func=view&catid=38&id=13940&limit=6
  12. #<xMin> = 0
  13. #<xMax>= 1
  14.  
  15. #<yMin>=-.5
  16. #<ymax>= 0.0
  17. #<yStepDist>=.125
  18.  
  19. #<d>=.1
  20. #<r>=[#<d>/4]
  21.  
  22.  
  23. #<zSaftey>=1.1 (Z safety)
  24. #<zProbeMax>=1 (Z probe)
  25. #<zProbeMin>=-.1
  26. (End configuration section)
  27.  
  28. #5070=0
  29. (LOGOPEN,probe-results.ngc)
  30. #<i>=0
  31. G0Z[#<zSaftey>]
  32. G0 X[#<xMin>] Y[#<yMin>]
  33. o1 while [#<i> lt fix[[#<yMax>-#<yMin>]/#<yStepDist>]]
  34. G0 Y[#<yMin>+#<yStepDist>*#<i>]
  35. o2 if [[[#<i>/2] - fix[#<i>/2]] eq 0]
  36. #<thisDirection>=1
  37. o2 else
  38. #<thisDirection>=-1
  39. o2 endIf
  40. (G38.3 Z[-.1])
  41. o399 if [#5070 NE 0]
  42. (LOG,#5061 #5062 #5063)
  43. #<lastXLocation>=#5061
  44. #<lastYLocation>=#5061
  45. #<lastZLocation>=#5061
  46. o399 else
  47. #<lastXLocation>=#5400
  48. #<lastYLocation>=#5401
  49. #<lastZLocation>=#5402
  50. o399 endIf
  51.  
  52.  
  53.  
  54. #<lastContactDirection>=0 (0 for Z, 1 for x)
  55. o400 while [#<lastXLocation> lt #<xMax>]
  56. o410 if [#lastContactDirection EQ 0]
  57. (code for the case that the last contact was in the z- direction)
  58. o410 endIf
  59.  
  60. o420 if [#lastContactDirection EQ 1]
  61. (code for the case that the last contact was in the x+ direction)
  62. g01 X[-#<r>*#<thisDirection>]
  63. o420 endIf
  64.  
  65. g38.3 Z[#<lastZLocation>+d]
  66. o430 while [#5070 NE 0]
  67. (back off the undercut and try again)
  68. g01 X[-#<r>*#<thisDirection>]
  69. g38.3 Z[#<lastZLocation>+d]
  70. o430 endWhile
  71.  
  72. G38.3 X[#lastXLocation>+[d*#<thisDirection>]]
  73. o440 if [#5070 NE 0]
  74. (LOG,#5061 #5062 #5063)
  75. #<lastXLocation>=#5061
  76. #<lastYLocation>=#5062
  77. #<lastZLocation>=#5063
  78. #<lastContactDirection>=1
  79. o400 continue
  80. o440 endIf
  81. G38.3 Z[#<zProbeMin>]
  82. o440 if [#5070 NE 0]
  83. (LOG,#5061 #5062 #5063)
  84. #<lastXLocation>=#5061
  85. #<lastYLocation>=#5062
  86. #<lastZLocation>=#5063
  87. #<lastContactDirection>=0
  88. o400 continue
  89. o440 endIf
  90. #<lastXLocation>=#5420
  91. #<lastYLocation>=#5421
  92. #<lastZLocation>=#5422
  93. #<lastContactDirection>=0
  94.  
  95.  
  96. o400 endWhile
  97.  
  98. G0Z[#<zSaftey>]
  99. #<i>=[#<i>+1]
  100. O1 endWhile
  101.  
  102. (LOGCLOSE)
  103. G0Z[#<zSaftey>]
  104. G0X[#<xMin>]Y[#<yMin>]
  105. M2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement