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_bearing.scad 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. include <bearing_idler.scad>
  2. include <e3d_v6_all_metall_hotend.scad>
  3. // #######################################################
  4. // ################### Linear Bearings ###################
  5. // #######################################################
  6. lm8uu_outer = 15;
  7. lm8uu_inner = 8;
  8. lm8uu_height = 24;
  9. x_rail_dist = 70;
  10. lm8uu_dia_add = 0.5;
  11. lm8uu_len_add = 1.0;
  12. rail_dia_add = 3.0;
  13. y_carriage_wall = 10; // z-axis
  14. y_carriage_len_add = 15; // y-axis
  15. y_carriage_width = 25; // x-axis
  16. y_carriage_block_width = 10; // x-axis
  17. y_carriage_block_height = 10; // z-axis
  18. y_carriage_rail_support = 2; // dist between rail and edge
  19. y_carriage_length = x_rail_dist + (2 * y_carriage_len_add);
  20. rail_mount_dia_add = 0.4;
  21. x_rail_mount_width = 10;
  22. x_rail_cutout_z = 0.5; // in x-axis
  23. x_rail_cutout_x = 0.5; // in z-axis
  24. x_rail_cutout_y = x_rail_dist - (2 * y_carriage_len_add);
  25. x_rail_hole_off = 5;
  26. x_rail_block_len = (y_carriage_length - x_rail_cutout_y) / 2;
  27. x_carriage_width = 80;
  28. x_carriage_len_add = 10;
  29. x_carriage_wall = 10;
  30. x_carriage_bearing_off = 3;
  31. x_carriage_belt_off = 19;
  32. x_carriage_belt_block_width = 8;
  33. x_carriage_belt_block_length = 8;
  34. x_carriage_belt_block_height = 25;
  35. x_carriage_belt_block_height_b = x_carriage_belt_block_height - 7;
  36. x_carriage_block_hole_off = 6.0;
  37. x_carriage_block_length = 4;
  38. x_carriage_block_off = 2.5;
  39. x_carriage_block_add = 4.4;
  40. x_carriage_length = x_rail_dist + (2 * x_carriage_len_add);
  41. x_carriage_block_height = 2 * (x_carriage_block_hole_off + x_carriage_block_add);
  42. x_cutout_width = x_carriage_width - (2 * x_carriage_belt_block_width) - 5;
  43. x_cutout_length = x_rail_dist - 25;
  44. draw_x_carriage = false;
  45. draw_y_carriage = false;
  46. draw_y_carriage_idlers = true;
  47. draw_rail_len = 200;
  48. // y-carriage belt idlers
  49. idler_a_blue = [ 19, 15, 5.5];
  50. idler_a_red = [ 19, x_rail_dist + 15, 12.5];
  51. idler_b_blue = [30.3, x_rail_dist + 15, 12.5];
  52. idler_b_red = [30.3, 15, 5.5];
  53. module lm8uu() {
  54. $fn = 15;
  55. difference() {
  56. cylinder(d = lm8uu_outer, h = lm8uu_height);
  57. translate([0, 0, -1])
  58. cylinder(d = lm8uu_inner, h = lm8uu_height + 2);
  59. }
  60. }
  61. // TODO add cable tie canal for lm8uu mounting
  62. // TODO get ready to actually print these
  63. module generate_spacer(pos) {
  64. color("green")
  65. translate([pos[0], pos[1], -0.5])
  66. bearing_spacer(pos[2] + 0.5 + ((idler_outer_height - bearing_height) / 2), 2, 1, true, 3);
  67. }
  68. module y_carriage(idler_a = [0, 0, 0], idler_b = [0, 0, 0]) {
  69. $fn = 20;
  70. // attaching to x-rails
  71. color("green")
  72. translate([y_carriage_width, 0, -y_carriage_block_height])
  73. difference() {
  74. cube([x_rail_mount_width, y_carriage_length, y_carriage_block_height + y_carriage_wall]);
  75. translate([0, -1, y_carriage_block_height])
  76. cube([x_rail_cutout_z, y_carriage_length + 2, y_carriage_wall + 1]);
  77. translate([0, -1, y_carriage_block_height - (x_rail_cutout_x / 2)])
  78. cube([y_carriage_block_width + 1, y_carriage_length + 2, x_rail_cutout_x]);
  79. translate([0, (y_carriage_length - x_rail_cutout_y) / 2, y_carriage_block_height])
  80. cube([y_carriage_block_width + 1, x_rail_cutout_y, y_carriage_wall + 1]);
  81. for (i = [y_carriage_len_add : x_rail_dist : x_rail_dist + y_carriage_len_add]) {
  82. translate([0, i, y_carriage_block_height])
  83. rotate([0, 90, 0])
  84. cylinder(d = lm8uu_inner + rail_mount_dia_add, h = y_carriage_block_width + 1);
  85. }
  86. for (i = [0 : x_rail_block_len + x_rail_cutout_y : x_rail_block_len + x_rail_cutout_y]) {
  87. translate([y_carriage_block_width / 2, x_rail_hole_off + i, -1]) {
  88. cylinder(d = 3.2, h = y_carriage_wall + 2 + y_carriage_block_height);
  89. cylinder(d = 6.1, h = 3.8, $fn = 6);
  90. translate([0, 0, y_carriage_wall + y_carriage_block_height - 2.5])
  91. cylinder(d = 6.1, h = 3.8);
  92. }
  93. translate([y_carriage_block_width / 2, x_rail_block_len - x_rail_hole_off + i, -1]) {
  94. cylinder(d = 3.2, h = y_carriage_wall + 2 + y_carriage_block_height);
  95. cylinder(d = 6.1, h = 3.8, $fn = 6);
  96. translate([0, 0, y_carriage_wall + y_carriage_block_height - 2.5])
  97. cylinder(d = 6.1, h = 3.8);
  98. }
  99. }
  100. }
  101. // attaching to y-rail
  102. color("green")
  103. difference() {
  104. union() {
  105. cube([y_carriage_width, y_carriage_length, y_carriage_wall]);
  106. translate([y_carriage_width - y_carriage_block_width, 0, -y_carriage_block_height])
  107. cube([y_carriage_block_width, y_carriage_length, y_carriage_block_height]);
  108. }
  109. translate([(lm8uu_outer + lm8uu_dia_add) / 2 + y_carriage_rail_support, 0, 0])
  110. rotate([-90, 0, 0]) {
  111. translate([0, 0, -1])
  112. cylinder(d = lm8uu_inner + rail_dia_add, h = y_carriage_length + 2);
  113. translate([0, 0, y_carriage_rail_support - lm8uu_len_add / 2])
  114. cylinder(d = lm8uu_outer + lm8uu_dia_add, h = lm8uu_height + lm8uu_len_add);
  115. translate([0, 0, y_carriage_length - lm8uu_height - y_carriage_rail_support - lm8uu_len_add / 2])
  116. cylinder(d = lm8uu_outer + lm8uu_dia_add, h = lm8uu_height + lm8uu_len_add);
  117. }
  118. }
  119. color("magenta")
  120. translate([(lm8uu_outer + lm8uu_dia_add) / 2 + y_carriage_rail_support, 0, 0])
  121. rotate([-90, 0, 0]) {
  122. // y-bearings
  123. %translate([0, 0, y_carriage_rail_support])
  124. lm8uu();
  125. %translate([0, 0, y_carriage_length - lm8uu_height - y_carriage_rail_support])
  126. lm8uu();
  127. }
  128. // idlers for the corexy belts
  129. translate([0, 0, y_carriage_wall]) {
  130. if (draw_y_carriage_idlers) {
  131. translate(idler_a)
  132. bearing_idler();
  133. translate(idler_b)
  134. bearing_idler();
  135. }
  136. generate_spacer(idler_a);
  137. generate_spacer(idler_b);
  138. }
  139. }
  140. module belt_fix() {
  141. difference() {
  142. color("green")
  143. cube([x_carriage_belt_block_width, x_carriage_block_length, x_carriage_block_height]);
  144. translate([x_carriage_belt_block_width / 2, -1, x_carriage_block_hole_off - 0.2])
  145. rotate([-90, 0, 0]) {
  146. cylinder(d = 3.2, h = x_carriage_belt_block_length + 2);
  147. cylinder(d = 6.1, h = 3.8, $fn = 6);
  148. }
  149. translate([x_carriage_belt_block_width / 2, -1, x_carriage_block_height - -x_carriage_block_hole_off - 9])
  150. rotate([-90, 0, 0]) {
  151. cylinder(d = 3.2, h = x_carriage_belt_block_length + 2);
  152. cylinder(d = 6.1, h = 3.8, $fn = 6);
  153. }
  154. }
  155. }
  156. module belt_mount(top, up) {
  157. $fn = 15;
  158. difference() {
  159. color("green")
  160. if (top) {
  161. cube([x_carriage_belt_block_width, x_carriage_belt_block_length, x_carriage_belt_block_height]);
  162. } else {
  163. cube([x_carriage_belt_block_width, x_carriage_belt_block_length, x_carriage_belt_block_height_b]);
  164. }
  165. if (top) {
  166. translate([-1, x_carriage_belt_block_length / 2, 16])
  167. rotate([0, 90, 0])
  168. cylinder(d = 2.6, h = x_carriage_belt_block_width + 2);
  169. translate([x_carriage_belt_block_width / 2, -1, 16 + x_carriage_block_hole_off])
  170. rotate([-90, 0, 0])
  171. cylinder(d = 3.2, h = x_carriage_belt_block_length + 2);
  172. translate([x_carriage_belt_block_width / 2, -1, 16 - x_carriage_block_hole_off])
  173. rotate([-90, 0, 0])
  174. cylinder(d = 3.2, h = x_carriage_belt_block_length + 2);
  175. } else {
  176. translate([-1, x_carriage_belt_block_length / 2, 9])
  177. rotate([0, 90, 0])
  178. cylinder(d = 2.7, h = x_carriage_belt_block_width + 2);
  179. translate([x_carriage_belt_block_width / 2, -1, 9 + x_carriage_block_hole_off])
  180. rotate([-90, 0, 0])
  181. cylinder(d = 3.2, h = x_carriage_belt_block_length + 2);
  182. translate([x_carriage_belt_block_width / 2, -1, 9 - x_carriage_block_hole_off])
  183. rotate([-90, 0, 0])
  184. cylinder(d = 3.2, h = x_carriage_belt_block_length + 2);
  185. }
  186. }
  187. if (up) {
  188. if (top) {
  189. translate([0, x_carriage_belt_block_length + x_carriage_block_off, x_carriage_belt_block_height - x_carriage_block_height])
  190. belt_fix();
  191. } else {
  192. translate([0, x_carriage_belt_block_length + x_carriage_block_off, x_carriage_belt_block_height_b - x_carriage_block_height])
  193. belt_fix();
  194. }
  195. } else {
  196. if (top) {
  197. translate([0, -x_carriage_block_length - x_carriage_block_off, x_carriage_belt_block_height - x_carriage_block_height])
  198. belt_fix();
  199. } else {
  200. translate([0, -x_carriage_block_length - x_carriage_block_off, x_carriage_belt_block_height_b - x_carriage_block_height])
  201. belt_fix();
  202. }
  203. }
  204. }
  205. module belt_mounts() {
  206. translate([0, x_carriage_belt_off, 0])
  207. belt_mount(false, true);
  208. translate([0, x_carriage_length - x_carriage_belt_off - x_carriage_belt_block_length, 0])
  209. belt_mount(true, false);
  210. translate([x_carriage_width - x_carriage_belt_block_width, x_carriage_belt_off, 0])
  211. belt_mount(true, true);
  212. translate([x_carriage_width - x_carriage_belt_block_width, x_carriage_length - x_carriage_belt_off - x_carriage_belt_block_length, 0])
  213. belt_mount(false, false);
  214. }
  215. module x_carriage() {
  216. $fn = 20;
  217. //color("green")
  218. difference() {
  219. union() {
  220. color("green")
  221. cube([x_carriage_width, x_rail_dist + (2 * x_carriage_len_add), x_carriage_wall]);
  222. translate([0, 0, x_carriage_wall])
  223. belt_mounts();
  224. }
  225. // big center cutout
  226. translate([x_carriage_width / 2, x_carriage_length / 2, x_carriage_wall / 2])
  227. cube([x_cutout_width, x_cutout_length, x_carriage_wall + 2], center=true);
  228. for (i = [0 : 1 : 1]) {
  229. translate([lm8uu_height + x_carriage_bearing_off + (i * (x_carriage_width - (2 * x_carriage_bearing_off) - lm8uu_height)), 0, ])
  230. rotate([0, -90, 0]) {
  231. // x-bearings
  232. color("magenta")
  233. %translate([0, x_carriage_len_add, 0])
  234. lm8uu();
  235. color("magenta")
  236. %translate([0, x_rail_dist + x_carriage_len_add, 0])
  237. lm8uu();
  238. color("green")
  239. translate([0, x_carriage_len_add, 0])
  240. cylinder(d = lm8uu_outer + lm8uu_dia_add, h = lm8uu_height + lm8uu_len_add);
  241. color("green")
  242. translate([0, x_rail_dist + x_carriage_len_add, 0])
  243. cylinder(d = lm8uu_outer + lm8uu_dia_add, h = lm8uu_height + lm8uu_len_add);
  244. color("green")
  245. translate([0, x_carriage_len_add, -x_carriage_width])
  246. cylinder(d = lm8uu_inner + rail_dia_add, h = x_carriage_width * 2);
  247. color("green")
  248. translate([0, x_rail_dist + x_carriage_len_add, -x_carriage_width])
  249. cylinder(d = lm8uu_inner + rail_dia_add, h = x_carriage_width * 2);
  250. }
  251. }
  252. // left mounting screw
  253. translate([5.5, x_carriage_length / 2, -1])
  254. cylinder(d = e3d_hole_dia, h = x_carriage_wall + 12);
  255. // right mounting screw
  256. translate([x_carriage_width - 5.5, x_carriage_length / 2, -1])
  257. cylinder(d = e3d_hole_dia, h = x_carriage_wall + 12);
  258. // bottom mounting screw
  259. translate([x_carriage_width / 2, 19, -1])
  260. cylinder(d = e3d_hole_dia, h = x_carriage_wall + 12);
  261. // top mounting screw
  262. translate([x_carriage_width / 2, x_carriage_length - 19, -1])
  263. cylinder(d = e3d_hole_dia, h = x_carriage_wall + 12);
  264. }
  265. e3d_v6_dist_x = 23 + 5;
  266. e3d_v6_dist_y = 18 + 1;
  267. e3d_v6_z_off = 13;
  268. translate([x_carriage_width / 2, x_carriage_length / 2, -e3d_v6_height + x_carriage_wall + e3d_v6_z_off]) {
  269. color("red")
  270. %translate([-e3d_v6_dist_x / 2, e3d_v6_dist_y / 2, 0])
  271. e3d_v6();
  272. color("yellow")
  273. %translate([e3d_v6_dist_x / 2, e3d_v6_dist_y / 2, 0])
  274. e3d_v6();
  275. color("blue")
  276. %translate([0, (e3d_v6_dist_y / 2) - e3d_v6_dist_y, 0])
  277. rotate([0, 0, 180])
  278. e3d_v6();
  279. }
  280. e3d_clamp_width = x_cutout_width;
  281. e3d_clamp_width_add = 10;
  282. e3d_clamp_length = e3d_v6_dist_y;
  283. e3d_clamp_b_length = ((x_cutout_length - e3d_clamp_length) / 2) + 7;
  284. e3d_clamp_height = e3d_upper_small_height;
  285. e3d_clamp_dia_add = 0.2;
  286. e3d_clamp_cut = 0.2; // x2
  287. e3d_clamp_hole_off = 4;
  288. e3d_hole_dia = 3.2;
  289. echo(m3_screw_len=e3d_clamp_length + (2 * e3d_clamp_b_length));
  290. // hotend clamp center piece
  291. translate([(x_carriage_width - e3d_clamp_width) / 2, (x_carriage_length - e3d_clamp_length) / 2, x_carriage_wall])
  292. difference() {
  293. union() {
  294. // center clamp part
  295. color("magenta")
  296. translate([-e3d_clamp_width_add, e3d_clamp_cut, 0])
  297. cube([e3d_clamp_width + (2 * e3d_clamp_width_add), e3d_clamp_length - (2 * e3d_clamp_cut), e3d_clamp_height]);
  298. // blue clamp
  299. color("cyan")
  300. translate([0, -e3d_clamp_b_length, 0])
  301. cube([e3d_clamp_width, e3d_clamp_b_length - e3d_clamp_cut, e3d_clamp_height]);
  302. // red & yellow clamp
  303. color("cyan")
  304. translate([0, e3d_clamp_length + e3d_clamp_cut, 0])
  305. cube([e3d_clamp_width, e3d_clamp_b_length - e3d_clamp_cut, e3d_clamp_height]);
  306. }
  307. // left clamping screw
  308. translate([e3d_clamp_hole_off, -e3d_clamp_b_length - 1, e3d_clamp_height / 2])
  309. rotate([-90, 0, 0])
  310. cylinder(d = e3d_hole_dia, h = x_cutout_width + 2);
  311. // right clamping screw
  312. translate([x_cutout_width - e3d_clamp_hole_off, -e3d_clamp_b_length - 1, e3d_clamp_height / 2])
  313. rotate([-90, 0, 0])
  314. cylinder(d = e3d_hole_dia, h = x_cutout_width + 2);
  315. // left mounting screw
  316. translate([-5, e3d_clamp_length / 2, -1])
  317. cylinder(d = e3d_hole_dia, h = e3d_clamp_height + 2);
  318. // right mounting screw
  319. translate([e3d_clamp_width + e3d_clamp_width_add - 5, e3d_clamp_length / 2, -1])
  320. cylinder(d = e3d_hole_dia, h = e3d_clamp_height + 2);
  321. // bottom mounting screw
  322. translate([e3d_clamp_width / 2, -e3d_clamp_b_length + 3.5, -1])
  323. cylinder(d = e3d_hole_dia, h = e3d_clamp_height + 2);
  324. // top mounting screw
  325. translate([e3d_clamp_width / 2, e3d_clamp_length + e3d_clamp_b_length - 3.5, -1])
  326. cylinder(d = e3d_hole_dia, h = e3d_clamp_height + 2);
  327. // red e3d clamp cutout
  328. translate([(e3d_clamp_width - e3d_v6_dist_x) / 2, e3d_clamp_length, -1])
  329. cylinder(d = e3d_upper_small_dia + e3d_clamp_dia_add, h = e3d_clamp_height + 2);
  330. // yellow e3d clamp cutout
  331. translate([(e3d_clamp_width + e3d_v6_dist_x) / 2, e3d_clamp_length, -1])
  332. cylinder(d = e3d_upper_small_dia + e3d_clamp_dia_add, h = e3d_clamp_height + 2);
  333. // blue e3d clamp cutout
  334. translate([e3d_clamp_width / 2, 0, -1])
  335. cylinder(d = e3d_upper_small_dia + e3d_clamp_dia_add, h = e3d_clamp_height + 2);
  336. }
  337. // hotend cooling fan
  338. color("grey")
  339. %translate([x_carriage_width + 5, (x_carriage_length - 40) / 2, -40])
  340. difference() {
  341. cube([20, 40, 40]);
  342. translate([-1, 20, 20])
  343. rotate([0, 90, 0])
  344. cylinder(d = 35, h = 22);
  345. }
  346. }
  347. if (draw_y_carriage) {
  348. translate([(lm8uu_outer + lm8uu_dia_add) / 2 + y_carriage_rail_support, 0, 0])
  349. rotate([-90, 0, 0]) {
  350. // y-bearings
  351. %translate([0, 0, y_carriage_rail_support])
  352. lm8uu();
  353. %translate([0, 0, y_carriage_length - lm8uu_height - y_carriage_rail_support])
  354. lm8uu();
  355. }
  356. // x-rails
  357. for (i = [y_carriage_len_add : x_rail_dist : x_rail_dist + y_carriage_len_add]) {
  358. %translate([y_carriage_width + 1, i, 0])
  359. rotate([0, 90, 0])
  360. cylinder(d = lm8uu_inner, h = draw_rail_len);
  361. }
  362. y_carriage(idler_a_blue, idler_b_blue);
  363. translate([(2 * y_carriage_width + y_carriage_block_width) + draw_rail_len -5, y_carriage_length, 0])
  364. rotate([0, 0, 180])
  365. y_carriage(idler_a_red, idler_b_red);
  366. if (draw_x_carriage) {
  367. translate([y_carriage_width + y_carriage_block_width + ((draw_rail_len - x_carriage_width) / 2), y_carriage_len_add - x_carriage_len_add, 0])
  368. x_carriage();
  369. }
  370. } else if (draw_x_carriage) {
  371. x_carriage();
  372. }