My self designed awesome 3D printer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

linear_rail.scad 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. // #######################################################
  2. // ################### Linear Bearings ###################
  3. // #######################################################
  4. lm8uu_outer = 15;
  5. lm8uu_inner = 8;
  6. lm8uu_height = 24;
  7. lm8luu_height = 45;
  8. // TODO
  9. lm10uu_outer = 19;
  10. lm10uu_inner = 10;
  11. lm10uu_height = 29;
  12. lm10luu_height = 55;
  13. // TODO
  14. lm12uu_outer = 21;
  15. lm12uu_inner = 12;
  16. lm12uu_height = 30;
  17. lm12luu_height = 57;
  18. cable_tie_width = 3.5;
  19. cable_tie_height = 2.0;
  20. cable_tie_dia_add = 1.0;
  21. rail_mount_wall = 5;
  22. rail_mount_len = 10;
  23. rail_mount_block = 22;
  24. rail_y_off_1 = 10;
  25. cutout_width = 0.5;
  26. draw_rail_mount = false;
  27. draw_bearings = false;
  28. // #######################################################
  29. if (draw_rail_mount) {
  30. rail_mount(30, 8, 10);
  31. translate([20, 20, 0])
  32. rail_mount(30, 10, 20);
  33. translate([40, 0, 0])
  34. rail_mount(30, 12, 10);
  35. }
  36. if (draw_bearings) {
  37. lm8uu();
  38. translate([0, 20, 0])
  39. lm8luu();
  40. translate([0, 20, 30])
  41. lm8uu_cable_tie();
  42. translate([25, 0, 0])
  43. lm10uu();
  44. translate([25, 25, 0])
  45. lm10luu();
  46. translate([25, 25, 30])
  47. lm10uu_cable_tie();
  48. translate([55, 0, 0])
  49. lm12uu();
  50. translate([55, 30, 0])
  51. lm12luu();
  52. translate([55, 30, 30])
  53. lm12uu_cable_tie();
  54. }
  55. // #######################################################
  56. function lmXuu_outer(dia) =
  57. (dia == 8) ? lm8uu_outer :
  58. ((dia == 10) ? lm10uu_outer :
  59. ((dia == 12) ? lm12uu_outer : 0));
  60. function lmXuu_height(dia) =
  61. (dia == 8) ? lm8uu_height :
  62. ((dia == 10) ? lm10uu_height :
  63. ((dia == 12) ? lm12uu_height : 0));
  64. module lmXuu(dia) {
  65. if (dia == 8) {
  66. lm8uu();
  67. } else if (dia == 10) {
  68. lm10uu();
  69. } else if (dia == 12) {
  70. lm12uu();
  71. }
  72. }
  73. module lmXluu(dia) {
  74. if (dia == 8) {
  75. lm8luu();
  76. } else if (dia == 10) {
  77. lm10luu();
  78. } else if (dia == 12) {
  79. lm12luu();
  80. }
  81. }
  82. module lmXuu_cable_tie(dia) {
  83. if (dia == 8) {
  84. lm8uu_cable_tie();
  85. } else if (dia == 10) {
  86. lm10uu_cable_tie();
  87. } else if (dia == 12) {
  88. lm12uu_cable_tie();
  89. }
  90. }
  91. module lm8uu() {
  92. $fn = 15;
  93. difference() {
  94. cylinder(d = lm8uu_outer, h = lm8uu_height);
  95. translate([0, 0, -1])
  96. cylinder(d = lm8uu_inner, h = lm8uu_height + 2);
  97. }
  98. }
  99. module lm8luu() {
  100. $fn = 15;
  101. difference() {
  102. cylinder(d = lm8uu_outer, h = lm8luu_height);
  103. translate([0, 0, -1])
  104. cylinder(d = lm8uu_inner, h = lm8luu_height + 2);
  105. }
  106. }
  107. module lm8uu_cable_tie() {
  108. difference() {
  109. union() {
  110. cylinder(d = lm8uu_outer + (2 * (cable_tie_height + cable_tie_dia_add)), h = cable_tie_width);
  111. translate([-8.5, 6, 0])
  112. cube([17, 10, cable_tie_width]);
  113. }
  114. translate([0, 0, -1])
  115. cylinder(d = lm8uu_outer + (2 * cable_tie_dia_add), h = cable_tie_width + 2);
  116. }
  117. }
  118. module lm10uu() {
  119. $fn = 15;
  120. difference() {
  121. cylinder(d = lm10uu_outer, h = lm10uu_height);
  122. translate([0, 0, -1])
  123. cylinder(d = lm10uu_inner, h = lm10uu_height + 2);
  124. }
  125. }
  126. module lm10luu() {
  127. $fn = 15;
  128. difference() {
  129. cylinder(d = lm10uu_outer, h = lm10luu_height);
  130. translate([0, 0, -1])
  131. cylinder(d = lm10uu_inner, h = lm10luu_height + 2);
  132. }
  133. }
  134. module lm10uu_cable_tie() {
  135. difference() {
  136. union() {
  137. cylinder(d = lm10uu_outer + (2 * (cable_tie_height + cable_tie_dia_add)), h = cable_tie_width);
  138. translate([-8.5, 6, 0])
  139. cube([17, 10, cable_tie_width]);
  140. }
  141. translate([0, 0, -1])
  142. cylinder(d = lm10uu_outer + (2 * cable_tie_dia_add), h = cable_tie_width + 2);
  143. }
  144. }
  145. module lm12uu() {
  146. $fn = 15;
  147. difference() {
  148. cylinder(d = lm12uu_outer, h = lm12uu_height);
  149. translate([0, 0, -1])
  150. cylinder(d = lm12uu_inner, h = lm12uu_height + 2);
  151. }
  152. }
  153. module lm12luu() {
  154. $fn = 15;
  155. difference() {
  156. cylinder(d = lm12uu_outer, h = lm12luu_height);
  157. translate([0, 0, -1])
  158. cylinder(d = lm12uu_inner, h = lm12luu_height + 2);
  159. }
  160. }
  161. module lm12uu_cable_tie() {
  162. difference() {
  163. union() {
  164. cylinder(d = lm12uu_outer + (2 * (cable_tie_height + cable_tie_dia_add)), h = cable_tie_width);
  165. translate([-8.5, 6, 0])
  166. cube([17, 10, cable_tie_width]);
  167. }
  168. translate([0, 0, -1])
  169. cylinder(d = lm12uu_outer + (2 * cable_tie_dia_add), h = cable_tie_width + 2);
  170. }
  171. }
  172. // #######################################################
  173. module rail_mount(slot, dia, rail_mount_len = rail_mount_len) {
  174. $fn = 20;
  175. rail_mount_height = rail_y_off_1 + dia;
  176. echo(rail_mount_len=rail_mount_len, rail_dia=dia);
  177. difference() {
  178. union() {
  179. // main body
  180. cube([rail_mount_wall, rail_mount_len, 2 * slot]);
  181. // rail clamp
  182. translate([rail_mount_wall, 0, ((2 * slot) - rail_mount_block ) / 2])
  183. cube([rail_mount_height, rail_mount_len, rail_mount_block]);
  184. }
  185. // M4 slot mounting holes
  186. translate([-1, rail_mount_len / 2, slot / 2])
  187. rotate([0, 90, 0])
  188. cylinder(d = 4.2, h = rail_mount_wall + 2);
  189. translate([-1, rail_mount_len / 2, slot * 3 / 2])
  190. rotate([0, 90, 0])
  191. cylinder(d = 4.2, h = rail_mount_wall + 2);
  192. translate([dia / 2 + rail_y_off_1, -1, slot])
  193. rotate([-90, 0, 0])
  194. cylinder(d = dia + 0.1, h = rail_mount_len + 2);
  195. // clamping cutout
  196. translate([rail_y_off_1 + (dia - cutout_width) / 2, -1, ((2 * slot) - (rail_mount_block + 2)) / 2])
  197. cube([cutout_width, rail_mount_len + 2, rail_mount_block + 2]);
  198. translate([-1, rail_mount_len / 2, slot + rail_mount_block / 3])
  199. rotate([0, 90, 0]) {
  200. cylinder(d = 3.2, h = rail_mount_height + rail_mount_wall + 2);
  201. cylinder(d = 6.1, h = 3.8, $fn = 6);
  202. translate([0, 0, rail_mount_height + rail_mount_wall -2.5])
  203. cylinder(d = 6.1, h = 3.8);
  204. }
  205. translate([-1, rail_mount_len / 2, slot - rail_mount_block / 3])
  206. rotate([0, 90, 0]) {
  207. cylinder(d = 3.2, h = rail_mount_height + rail_mount_wall + 2);
  208. cylinder(d = 6.1, h = 3.8, $fn = 6);
  209. translate([0, 0, rail_mount_height + rail_mount_wall -2.5])
  210. cylinder(d = 6.1, h = 3.8);
  211. }
  212. translate([-10, -10, -22])
  213. cube([30, rail_mount_len + 20, 30]);
  214. translate([-10, -10, 2 * slot - 8])
  215. cube([30, rail_mount_len + 20, 30]);
  216. }
  217. }