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.

xyRepRap.scad 30KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829
  1. // #######################################################
  2. // ################## Config Parameters ##################
  3. // #######################################################
  4. slot = 30; // or 20
  5. slot_off = 1; // distance between adjacent slots
  6. // print area / volume
  7. heatbed_width = 400;
  8. heatbed_length = 400;
  9. heatbed_height = 6;
  10. // distance between heatbed edge and inner t-slot frame edge
  11. frame_off_x = 30;
  12. frame_off_y = 30;
  13. outer_width = heatbed_width + (2 * (slot + frame_off_x));
  14. outer_length = heatbed_length + (2 * (slot + frame_off_y));
  15. // TODO depend on print area height
  16. outer_height = 500;
  17. rail_mount_dist = 12;
  18. y_carriage_pos = 175;
  19. x_carriage_pos = 180;
  20. // distance between heatbed and z-carriage frame
  21. bed_x_off = 10;
  22. bed_y_off = 10;
  23. bed_z_dist = 30;
  24. // display heatbed centered in print volume
  25. bed_draw_height = (outer_height - heatbed_height) / 2; // + 175;
  26. z_carriage_wall = 10;
  27. z_carriage_bearing_dia_add = 0.4;
  28. z_carriage_cutout_width = 2;
  29. z_carriage_cabletie_cut_off = 5;
  30. z_carriage_use_cable_tie_mount = true;
  31. z_rail_dia = 8;
  32. show_outer_frame = true;
  33. show_extruders = false;
  34. show_z_motion = true;
  35. show_heatbed_frame = true;
  36. show_heatbed = true;
  37. show_xy_motion = true;
  38. show_x_carriage = true;
  39. show_belts = false;
  40. echo(print_x=heatbed_width, print_y=heatbed_length);
  41. echo(frame_x=outer_width, frame_y=outer_length, frame_z=outer_height);
  42. // #######################################################
  43. // ###################### Libraries ######################
  44. // #######################################################
  45. include <lib/tslot_xy.scad>
  46. include <lib/nema.scad>
  47. include <lib/Belt_Generator.scad>
  48. include <lib/Pulley_T-MXL-XL-HTD-GT2_N-tooth.scad>
  49. include <lib/bearing_idler.scad>
  50. include <lib/linear_rail.scad>
  51. include <lib/carriages_xy.scad>
  52. include <lib/extruder.scad>
  53. module gt2_belt(length) {
  54. if (show_belts) {
  55. difference() {
  56. belting("straight", "GT2_2mm", belt_length = length);
  57. translate([-5, -5, 6])
  58. cube([length + 10, 10, 10]);
  59. }
  60. }
  61. }
  62. // #######################################################
  63. // ######################## Frame ########################
  64. // #######################################################
  65. module slot_angle_connector() {
  66. color("gray")
  67. translate([slot, 0, 0])
  68. rotate([0, -90, 0])
  69. difference() {
  70. cube([slot, slot, slot]);
  71. translate([0, -5, 0])
  72. rotate([0, 45, 0])
  73. cube([2 * slot, 2 * slot, 2 * slot]);
  74. }
  75. }
  76. module foot() {
  77. color("yellow")
  78. translate([0, 0, 10])
  79. cylinder(d = 6, h = 20);
  80. color("yellow")
  81. difference() {
  82. sphere(d = 20);
  83. translate([-15, -15, -30])
  84. cube([30, 30, 30]);
  85. }
  86. }
  87. module lower_frame(double) {
  88. if (double) {
  89. translate([slot + slot_off, 0, slot])
  90. rotate([-90, 0, 0])
  91. tslot_2_x(slot, outer_width - (2 * (slot + slot_off)));
  92. translate([slot + slot_off, outer_length - slot, slot])
  93. rotate([-90, 0, 0])
  94. tslot_2_x(slot, outer_width - (2 * (slot + slot_off)));
  95. translate([0, slot + slot_off, 0])
  96. tslot_2_y(slot, outer_length - (2 * (slot + slot_off)));
  97. translate([outer_width - slot, slot + slot_off, 0])
  98. tslot_2_y(slot, outer_length - (2 * (slot + slot_off)));
  99. } else {
  100. translate([slot + slot_off, 0, 0])
  101. tslot_x(slot, outer_width - (2 * (slot + slot_off)));
  102. translate([slot + slot_off, outer_length - slot, 0])
  103. tslot_x(slot, outer_width - (2 * (slot + slot_off)));
  104. translate([0, slot + slot_off, 0])
  105. tslot_y(slot, outer_length - (2 * (slot + slot_off)));
  106. translate([outer_width - slot, slot + slot_off, 0])
  107. tslot_y(slot, outer_length - (2 * (slot + slot_off)));
  108. }
  109. }
  110. module frame() {
  111. // outer corner pillars
  112. tslot_z(slot, outer_height);
  113. translate([outer_width - slot, 0, 0])
  114. tslot_z(slot, outer_height);
  115. translate([0, outer_length - slot, 0])
  116. tslot_z(slot, outer_height);
  117. translate([outer_width - slot, outer_length - slot, 0])
  118. tslot_z(slot, outer_height);
  119. lower_frame(false);
  120. // top frame
  121. translate([0, 0, outer_height - slot])
  122. lower_frame(true);
  123. // end caps
  124. color("black")
  125. translate([0, 0, outer_height]) {
  126. cube([slot, slot, 2]);
  127. translate([outer_width - slot, 0, 0])
  128. cube([slot, slot, 2]);
  129. translate([0, outer_length - slot, 0])
  130. cube([slot, slot, 2]);
  131. translate([outer_width - slot, outer_length - slot, 0])
  132. cube([slot, slot, 2]);
  133. }
  134. // feet
  135. translate([slot / 2, slot / 2, -30])
  136. foot();
  137. translate([outer_width - slot / 2, slot / 2, -30])
  138. foot();
  139. translate([slot / 2, outer_length - slot / 2, -30])
  140. foot();
  141. translate([outer_width - slot / 2, outer_length - slot / 2, -30])
  142. foot();
  143. // connecting elements
  144. translate([slot + slot_off, 0, slot + slot_off])
  145. slot_angle_connector();
  146. translate([slot + slot_off, outer_length - slot, slot + slot_off])
  147. slot_angle_connector();
  148. translate([slot + slot_off, 0, outer_height - slot - slot_off - slot])
  149. rotate([0, 90, 0])
  150. slot_angle_connector();
  151. translate([slot + slot_off, outer_length - slot, outer_height - slot - slot_off - slot])
  152. rotate([0, 90, 0])
  153. slot_angle_connector();
  154. translate([outer_width - slot - slot_off, 0, slot + slot_off])
  155. rotate([0, -90, 0])
  156. slot_angle_connector();
  157. translate([outer_width - slot - slot_off, outer_length - slot, slot + slot_off])
  158. rotate([0, -90, 0])
  159. slot_angle_connector();
  160. translate([outer_width - slot - slot_off, 0, outer_height - slot - slot_off - slot])
  161. rotate([0, 180, 0])
  162. slot_angle_connector();
  163. translate([outer_width - slot - slot_off, outer_length - slot, outer_height - slot - slot_off - slot])
  164. rotate([0, 180, 0])
  165. slot_angle_connector();
  166. translate([slot, slot + slot_off, slot + slot_off])
  167. rotate([0, 0, 90])
  168. slot_angle_connector();
  169. translate([slot, slot + slot_off, outer_height - slot - slot_off - slot])
  170. rotate([0, 90, 90])
  171. slot_angle_connector();
  172. translate([0, outer_length - slot - slot_off, slot + slot_off])
  173. rotate([0, 0, -90])
  174. slot_angle_connector();
  175. translate([0, outer_length - slot - slot_off, outer_height - slot - slot_off - slot])
  176. rotate([0, 90, -90])
  177. slot_angle_connector();
  178. translate([outer_width, slot + slot_off, slot + slot_off])
  179. rotate([0, 0, 90])
  180. slot_angle_connector();
  181. translate([outer_width, slot + slot_off, outer_height - slot - slot_off - slot])
  182. rotate([0, 90, 90])
  183. slot_angle_connector();
  184. translate([outer_width - slot, outer_length - slot - slot_off, slot + slot_off])
  185. rotate([0, 0, -90])
  186. slot_angle_connector();
  187. translate([outer_width - slot, outer_length - slot - slot_off, outer_height - slot - slot_off - slot])
  188. rotate([0, 90, -90])
  189. slot_angle_connector();
  190. translate([slot + slot_off, slot + slot_off, slot])
  191. rotate([-90, 0, 0])
  192. slot_angle_connector();
  193. translate([outer_width - slot - slot_off, slot + slot_off, slot])
  194. rotate([-90, 0, 90])
  195. slot_angle_connector();
  196. translate([slot + slot_off, outer_length - slot - slot_off, 0])
  197. rotate([90, 0, 0])
  198. slot_angle_connector();
  199. translate([outer_width - slot - slot_off, outer_length - slot - slot_off, 0])
  200. rotate([90, 0, -90])
  201. slot_angle_connector();
  202. /*
  203. translate([slot + slot_off, slot + slot_off, outer_height])
  204. rotate([-90, 0, 0])
  205. slot_angle_connector();
  206. translate([outer_width - slot - slot_off, slot + slot_off, outer_height])
  207. rotate([-90, 0, 90])
  208. slot_angle_connector();
  209. translate([slot + slot_off, outer_length - slot - slot_off, outer_height - slot])
  210. rotate([90, 0, 0])
  211. slot_angle_connector();
  212. translate([outer_width - slot - slot_off, outer_length - slot - slot_off, outer_height - slot])
  213. rotate([90, 0, -90])
  214. slot_angle_connector();
  215. */
  216. }
  217. // #######################################################
  218. // ###################### Mechanics ######################
  219. // #######################################################
  220. module rail(length, dia) {
  221. cylinder(d = dia, h = length);
  222. echo(rail_dia=dia, rail_len=length);
  223. }
  224. module y_rails() {
  225. // y smooth rail on blue side
  226. color("cyan")
  227. translate([y_rail_dia / 2 + rail_y_off_1, 18, -30])
  228. rotate([-90, 0, 0])
  229. rail(outer_length - slot - nema17_size - (2 * rail_mount_dist), y_rail_dia);
  230. // y carriage on blue side
  231. translate([rail_y_off_1 - (lmXuu_outer(y_rail_dia) + lmXuu_dia_add) / 2 + y_carriage_rail_support, y_carriage_pos, -slot])
  232. y_carriage(x_rail_dia, y_rail_dia, idler_a_blue, idler_b_blue);
  233. // rail mounts for blue side
  234. color("green")
  235. translate([0, 2 * rail_mount_dist, -2 * slot])
  236. rail_mount(slot, y_rail_dia);
  237. color("green")
  238. translate([0, outer_length - (2 * slot) - nema17_size - rail_mount_dist + 5, -2 * slot])
  239. rail_mount(slot, y_rail_dia);
  240. // y smooth rail on red side
  241. color("cyan")
  242. translate([outer_width - (2 * slot) - y_rail_dia / 2 - rail_y_off_1, 18, -30])
  243. rotate([-90, 0, 0])
  244. rail(outer_length - slot - nema17_size - (2 * rail_mount_dist), y_rail_dia);
  245. // y carriage on red side
  246. translate([outer_width - slot - y_carriage_width - y_carriage_block_width, y_carriage_pos + y_carriage_length, -slot])
  247. rotate([0, 0, 180])
  248. y_carriage(x_rail_dia, y_rail_dia, idler_a_red, idler_b_red);
  249. // rail mounts for red side
  250. color("green")
  251. translate([outer_width - (2 * slot), 2 * rail_mount_dist + rail_mount_len, -2 * slot])
  252. rotate([0, 0, 180])
  253. rail_mount(slot, y_rail_dia);
  254. color("green")
  255. translate([outer_width - (2 * slot), outer_length - (2 * slot) - nema17_size - rail_mount_dist + 5 + rail_mount_len, -2 * slot])
  256. rotate([0, 0, 180])
  257. rail_mount(slot, y_rail_dia);
  258. }
  259. module x_rails() {
  260. // TODO length calculate properly!
  261. color("cyan")
  262. translate([30, y_carriage_pos, 15])
  263. rotate([0, 90, 0])
  264. rail(outer_width - (4 * slot), x_rail_dia);
  265. color("cyan")
  266. translate([30, y_carriage_pos + x_rail_dist, 15])
  267. rotate([0, 90, 0])
  268. rail(outer_width - (4 * slot), x_rail_dia);
  269. if (show_x_carriage) {
  270. translate([x_carriage_pos, y_carriage_pos - x_carriage_len_add, slot / 2])
  271. x_carriage(x_rail_dia);
  272. }
  273. }
  274. module motion_xy() {
  275. translate([slot, slot, outer_height])
  276. y_rails();
  277. translate([slot, slot + y_carriage_len_add, outer_height - (1.5 * slot)])
  278. x_rails();
  279. // left ("blue") motor
  280. translate([slot, outer_length - slot - nema17_size - nema17_mount_wall, outer_height + nema17_mount_wall])
  281. rotate([180, 0, 90]) {
  282. color("blue")
  283. translate([0, 0, -65])
  284. nema17(65);
  285. color("green")
  286. nema17_mount(slot);
  287. // blue motor pulley
  288. color("magenta")
  289. translate([nema17_size / 2, nema17_size / 2, 22.4])
  290. rotate([180, 0, 0])
  291. gt2_pulley();
  292. // blue gt2 belt at motor
  293. color("blue")
  294. translate([nema17_size / 2, nema17_size / 2 + 6.5, nema17_mount_wall + 1])
  295. rotate([0, 0, 180])
  296. gt2_belt(outer_length - (2 * slot) - nema17_size / 2 - x_rail_dist - y_carriage_pos - 15);
  297. color("blue")
  298. translate([-outer_length + (3 * slot) + 10 + nema17_size / 2, nema17_size / 2 - 6.5, nema17_mount_wall + 1])
  299. gt2_belt(outer_length - (3 * slot) - 10);
  300. }
  301. // right ("red") motor
  302. translate([outer_width - slot - nema17_size, outer_length - slot - nema17_size - nema17_mount_wall, outer_height + nema17_mount_wall])
  303. rotate([180, 0, 90]) {
  304. color("red")
  305. translate([0, 0, -65])
  306. nema17(65);
  307. color("green")
  308. nema17_mount(slot);
  309. // red motor pulley
  310. color("cyan")
  311. translate([nema17_size / 2, nema17_size / 2, 8.2])
  312. gt2_pulley();
  313. // red gt2 belt at motor
  314. color("red")
  315. translate([nema17_size / 2, nema17_size / 2 + 6.5, nema17_mount_wall + 8])
  316. rotate([0, 0, 180])
  317. gt2_belt(outer_length - (3 * slot) - 10);
  318. color("red")
  319. translate([nema17_size / 2 - (outer_length - (2 * slot) - nema17_size / 2 - x_rail_dist - y_carriage_pos - 15), nema17_size / 2 - 6.5, nema17_mount_wall + 8])
  320. gt2_belt(outer_length - (2 * slot) - nema17_size / 2 - x_rail_dist - y_carriage_pos - 15);
  321. }
  322. // x carriage belts on blue side
  323. color("blue")
  324. translate([slot + 29, slot + x_rail_dist + 7 + y_carriage_pos, outer_height - 1])
  325. rotate([180, 0, 0])
  326. gt2_belt(x_carriage_pos - 20);
  327. color("red")
  328. translate([slot + 15, slot + 23 + y_carriage_pos, outer_height - 8])
  329. rotate([180, 0, 0])
  330. gt2_belt(x_carriage_pos - 6);
  331. // x carriage belts on red side
  332. color("red")
  333. translate([slot + x_carriage_width + x_carriage_pos - 7, slot + x_rail_dist + 7 + y_carriage_pos, outer_height - 8])
  334. rotate([180, 0, 0])
  335. gt2_belt(outer_width - x_carriage_pos - (2 * slot) - x_carriage_width - 20);
  336. color("blue")
  337. translate([slot + x_carriage_width + x_carriage_pos - 7, slot + 23 + y_carriage_pos, outer_height - 1])
  338. rotate([180, 0, 0])
  339. gt2_belt(outer_width - x_carriage_pos - (2 * slot) - x_carriage_width - 10);
  340. // long back belts
  341. color("blue")
  342. translate([slot + 15, slot + 10, outer_height - 7])
  343. gt2_belt(outer_width - nema17_size - (2 * slot) + 13);
  344. color("red")
  345. translate([slot + 15, slot + 10, outer_height - 14])
  346. gt2_belt(outer_width - nema17_size - (2 * slot) + 13);
  347. // blue belt on red side
  348. color("blue")
  349. translate([outer_width - slot - 15, slot + 10, outer_height - 7])
  350. rotate([0, 0, 90])
  351. gt2_belt(y_carriage_pos + 10);
  352. // red belt on blue side
  353. color("red")
  354. translate([slot + 15, slot + 19 + y_carriage_pos, outer_height - 14])
  355. rotate([0, 0, -90])
  356. gt2_belt(y_carriage_pos + 10);
  357. // idler on blue side
  358. translate([slot + bearing_mount_width + 15, 0, outer_height - slot])
  359. rotate([0, 0, 90])
  360. slot_mount_bracket(slot, true);
  361. // idler on red side
  362. translate([outer_width - slot - 15, 0, outer_height - slot])
  363. rotate([0, 0, 90])
  364. slot_mount_bracket(slot, true);
  365. }
  366. // #######################################################
  367. // ####################### Heatbed #######################
  368. // #######################################################
  369. module heatbed_plate() {
  370. difference() {
  371. color("yellow")
  372. cube([heatbed_width, heatbed_length, heatbed_height]);
  373. #translate([bed_x_off + (slot / 2), bed_y_off + (slot / 2), -bed_z_dist - slot - 1])
  374. cylinder(d = 4.2, h = bed_z_dist + slot + heatbed_height + 2);
  375. #translate([heatbed_width - bed_x_off - (slot / 2), bed_y_off + (slot / 2), -bed_z_dist - slot - 1])
  376. cylinder(d = 4.2, h = bed_z_dist + slot + heatbed_height + 2);
  377. #translate([bed_x_off + (slot / 2), heatbed_length - bed_y_off - (slot / 2), -bed_z_dist - slot - 1])
  378. cylinder(d = 4.2, h = bed_z_dist + slot + heatbed_height + 2);
  379. #translate([heatbed_width - bed_x_off - (slot / 2), heatbed_length - bed_y_off - (slot / 2), -bed_z_dist - slot - 1])
  380. cylinder(d = 4.2, h = bed_z_dist + slot + heatbed_height + 2);
  381. }
  382. echo(max_bed_heater_width=heatbed_width - (2 * bed_x_off) - slot - 5);
  383. echo(max_bed_heater_length=heatbed_length - (2 * bed_y_off) - slot - 5);
  384. }
  385. module heatbed() {
  386. translate([slot + frame_off_x, slot + frame_off_y, bed_draw_height]) {
  387. if (show_heatbed) {
  388. %heatbed_plate();
  389. }
  390. // t-slots as heatbed frame
  391. translate([bed_x_off, bed_y_off, -slot - bed_z_dist])
  392. tslot_y(slot, heatbed_length - (2 * bed_y_off));
  393. translate([heatbed_width - slot - bed_x_off, bed_y_off, -slot - bed_z_dist])
  394. tslot_y(slot, heatbed_length - (2 * bed_y_off));
  395. translate([slot + bed_x_off + slot_off, bed_y_off, -slot - bed_z_dist])
  396. tslot_x(slot, heatbed_width - 2 * (bed_x_off + slot + slot_off));
  397. translate([slot + bed_x_off + slot_off, heatbed_length - slot - bed_y_off, -slot - bed_z_dist])
  398. tslot_x(slot, heatbed_width - 2 * (bed_x_off + slot + slot_off));
  399. translate([bed_x_off + slot, bed_y_off + slot, -slot - bed_z_dist])
  400. rotate([90, 0, 90])
  401. slot_angle_connector();
  402. translate([bed_x_off + slot, heatbed_length - slot - bed_y_off, -slot - bed_z_dist])
  403. rotate([90, 0, 0])
  404. slot_angle_connector();
  405. translate([heatbed_width - slot - bed_x_off, heatbed_length - slot - bed_y_off, -slot - bed_z_dist])
  406. rotate([90, 0, -90])
  407. slot_angle_connector();
  408. translate([heatbed_width - slot - bed_x_off, bed_y_off + slot, -slot - bed_z_dist])
  409. rotate([90, 0, 180])
  410. slot_angle_connector();
  411. }
  412. }
  413. z_rail_x_off = 60;
  414. z_rail_mount_len = 20;
  415. module motion_z_rail() {
  416. // bottom clamp
  417. color("green")
  418. translate([slot, 0, slot / 2 + 5 + (z_rail_mount_len - rail_mount_len) / 2])
  419. rotate([-90, 0, 90])
  420. rail_mount(slot, z_rail_dia, z_rail_mount_len);
  421. // top clamp
  422. color("green")
  423. translate([slot, 0, outer_height - slot / 2 + 5 + (z_rail_mount_len - rail_mount_len) / 2 - slot])
  424. rotate([-90, 0, 90])
  425. rail_mount(slot, z_rail_dia, z_rail_mount_len);
  426. // rail
  427. color("cyan")
  428. translate([0, rail_y_off_1 + z_rail_dia / 2, 4])
  429. rail(outer_height - slot - 8, z_rail_dia);
  430. }
  431. module z_carriage() {
  432. echo(bed_screw_len=slot + z_carriage_wall + bed_z_dist + 10);
  433. // bracket on t-slot bed frame
  434. color("green")
  435. translate([frame_off_x + bed_x_off - z_rail_x_off, frame_off_y + bed_y_off - rail_y_off_1 - z_rail_dia / 2, 0]) {
  436. // short side bracket on long rail
  437. difference() {
  438. translate([-z_carriage_wall, -z_carriage_wall, 0])
  439. cube([z_carriage_wall, z_carriage_wall + (2 * slot), slot]);
  440. translate([-z_carriage_wall - 1, slot * 3 / 2, slot / 2])
  441. rotate([0, 90, 0])
  442. cylinder(d = 4.4, h = z_carriage_wall + 2);
  443. }
  444. // short bottom bracket on long rail
  445. difference() {
  446. translate([-z_carriage_wall, -z_carriage_wall, -z_carriage_wall])
  447. cube([slot + z_carriage_wall, 2 * slot + z_carriage_wall, z_carriage_wall]);
  448. translate([slot / 2, slot * 3 / 2, -z_carriage_wall - 1])
  449. cylinder(d = 4.4, h = z_carriage_wall + 2);
  450. translate([slot / 2, slot / 2, -z_carriage_wall - 1])
  451. cylinder(d = 4.4, h = z_carriage_wall + 2);
  452. }
  453. // long side bracket on short rail
  454. difference() {
  455. translate([0, -z_carriage_wall, 0])
  456. cube([3 * slot, z_carriage_wall, slot]);
  457. translate([slot * 5 / 2, -z_carriage_wall - 1, slot / 2])
  458. rotate([-90, 0, 0])
  459. cylinder(d = 4.4, h = z_carriage_wall + 2);
  460. }
  461. // long bottom bracket on short rail
  462. difference() {
  463. translate([slot, -z_carriage_wall, -z_carriage_wall])
  464. cube([2 * slot, slot + z_carriage_wall, z_carriage_wall]);
  465. translate([slot * 5 / 2, slot / 2, -z_carriage_wall - 1])
  466. cylinder(d = 4.4, h = z_carriage_wall + 2);
  467. }
  468. }
  469. // part around bearing
  470. color("green")
  471. translate([0, 0, -z_carriage_wall])
  472. difference() {
  473. hull() {
  474. cylinder(d = lm8uu_outer + 10, h = slot + z_carriage_wall);
  475. translate([frame_off_x + bed_x_off - z_rail_x_off - z_carriage_wall, frame_off_y + bed_y_off - rail_y_off_1 - z_rail_dia / 2 - z_carriage_wall, 0])
  476. cube([slot + (2 * z_carriage_wall) + 20, 1, slot + z_carriage_wall]);
  477. }
  478. // bearing cut out
  479. translate([0, 0, -1])
  480. cylinder(d = lm8uu_outer + z_carriage_bearing_dia_add, h = slot + z_carriage_wall + 2);
  481. if (z_carriage_use_cable_tie_mount) {
  482. // cable-tie bearing mounts
  483. for (i = [1 : 3])
  484. translate([0, 0, ((z_carriage_wall + slot) * i / 4) - (cable_tie_width / 2)])
  485. rotate([0, 0, 180])
  486. lm8uu_cable_tie();
  487. // place for cable-tie to hold on to bearing
  488. translate([-20, -40 - z_carriage_cabletie_cut_off, -1])
  489. cube([40, 40, z_carriage_wall + slot + 2]);
  490. } else {
  491. // cut out to slide bearing in
  492. translate([-z_carriage_cutout_width / 2, -20, -1])
  493. cube([z_carriage_cutout_width, 20, slot + z_carriage_wall + 2]);
  494. }
  495. }
  496. // linear bearing (long)
  497. color("magenta")
  498. translate([0, 0, (slot - z_carriage_wall - lm8luu_height) / 2])
  499. %lm8luu();
  500. }
  501. module motion_z() {
  502. // front left
  503. translate([slot + z_rail_x_off, slot, 0])
  504. motion_z_rail();
  505. // front right
  506. translate([outer_width - z_rail_x_off - slot, slot, 0])
  507. motion_z_rail();
  508. // back left
  509. translate([slot + z_rail_x_off, outer_length - slot, 0])
  510. rotate([0, 0, 180])
  511. motion_z_rail();
  512. // back right
  513. translate([outer_width - z_rail_x_off - slot, outer_length - slot, 0])
  514. rotate([0, 0, 180])
  515. motion_z_rail();
  516. // front left
  517. translate([slot + z_rail_x_off, slot + rail_y_off_1 + z_rail_dia / 2, bed_draw_height - bed_z_dist - slot])
  518. z_carriage();
  519. // front right
  520. translate([outer_width - slot - z_rail_x_off, slot + rail_y_off_1 + z_rail_dia / 2, bed_draw_height - bed_z_dist - slot])
  521. scale([-1, 1, 1])
  522. z_carriage();
  523. // back left
  524. translate([slot + z_rail_x_off, outer_length - slot - rail_y_off_1 - z_rail_dia / 2, bed_draw_height - bed_z_dist - slot])
  525. scale([1, -1, 1])
  526. z_carriage();
  527. // back right
  528. translate([outer_width - slot - z_rail_x_off, outer_length - slot - rail_y_off_1 - z_rail_dia / 2, bed_draw_height - bed_z_dist - slot])
  529. scale([-1, -1, 1])
  530. z_carriage();
  531. // yellow z-motor on top
  532. translate([(outer_width - nema17_size) / 2 - 80, outer_length - slot - nema17_size - nema17_mount_wall, outer_height + nema17_mount_wall])
  533. rotate([180, 0, 90]) {
  534. color("yellow")
  535. translate([0, 0, -65])
  536. nema17(65);
  537. color("green")
  538. nema17_mount(slot);
  539. // motor pulley
  540. color("orange")
  541. translate([nema17_size / 2, nema17_size / 2, 10])
  542. gt2_pulley();
  543. }
  544. // front left
  545. translate([front_z_rail_off, slot, 0])
  546. z_motion_rail_bearing_mount();
  547. // front right
  548. translate([outer_width - (rail_bearing_mount_width + (2 * rail_bearing_mount_screw)) - front_z_rail_off, slot, 0])
  549. z_motion_rail_bearing_mount();
  550. // back center
  551. translate([(outer_width + (rail_bearing_mount_width + (2 * rail_bearing_mount_screw))) / 2, outer_length - slot, 0])
  552. rotate([0, 0, 180])
  553. z_motion_rail_bearing_mount(slot);
  554. // top pulley on back rail
  555. color("orange")
  556. translate([(outer_width + (rail_bearing_mount_width + (2 * rail_bearing_mount_screw))) / 2 - rail_bearing_mount_off_x, outer_length - slot - rail_bearing_mount_off_y, outer_height - 25])
  557. gt2_pulley();
  558. // belts TODO
  559. // front left
  560. translate([front_z_rail_off + rail_bearing_mount_off_x, slot + frame_off_y + bed_y_off, bed_draw_height - bed_z_dist - slot])
  561. z_motion_carriage();
  562. // front right
  563. translate([outer_width - (rail_bearing_mount_width + (2 * rail_bearing_mount_screw)) - front_z_rail_off + rail_bearing_mount_off_x, slot + frame_off_y + bed_y_off, bed_draw_height - bed_z_dist - slot])
  564. z_motion_carriage();
  565. // back center
  566. translate([(outer_width + (rail_bearing_mount_width + (2 * rail_bearing_mount_screw))) / 2 - rail_bearing_mount_off_x, outer_length - slot - frame_off_y - bed_y_off, bed_draw_height - bed_z_dist - slot])
  567. rotate([0, 0, 180])
  568. z_motion_carriage();
  569. }
  570. front_z_rail_off = 160;
  571. // 608 bearing
  572. rail_bearing_dia = 22;
  573. rail_bearing_height = 7 * 2;
  574. rail_bearing_mount_screw = 10;
  575. rail_bearing_mount_height = 20;
  576. rail_bearing_mount_dia = rail_bearing_dia + 0.2;
  577. rail_bearing_mount_dia_add = 5;
  578. rail_bearing_mount_base = 5;
  579. rail_bearing_mount_lip_height = 1;
  580. rail_bearing_mount_lip_remove = 4;
  581. rail_bearing_mount_width_add = 10;
  582. rail_bearing_mount_width = rail_bearing_mount_dia + (2 * rail_bearing_mount_width_add);
  583. rail_bearing_mount_off_x = rail_bearing_mount_screw + (rail_bearing_mount_width / 2);
  584. rail_bearing_mount_off_y = rail_bearing_mount_base + (rail_bearing_mount_dia / 2);
  585. z_motion_carriage_width = 45;
  586. z_motion_carriage_length = 10;
  587. z_motion_carriage_hole_off = 7;
  588. z_motion_carriage_block_width = 18;
  589. z_motion_carriage_block_length = frame_off_y + bed_y_off - rail_bearing_mount_off_y;
  590. module z_motion_carriage() {
  591. color("green")
  592. translate([-z_motion_carriage_width / 2, -z_motion_carriage_length, 0])
  593. difference() {
  594. cube([z_motion_carriage_width, z_motion_carriage_length, slot]);
  595. translate([z_motion_carriage_hole_off, -1, slot / 2])
  596. rotate([-90, 0, 0])
  597. cylinder(d = 4.2, h = z_motion_carriage_length + 2);
  598. translate([z_motion_carriage_width - z_motion_carriage_hole_off, -1, slot / 2])
  599. rotate([-90, 0, 0])
  600. cylinder(d = 4.2, h = z_motion_carriage_length + 2);
  601. }
  602. color("red") // TODO!
  603. translate([-z_motion_carriage_block_width / 2, -z_motion_carriage_length - z_motion_carriage_block_length, 0])
  604. difference() {
  605. cube([z_motion_carriage_block_width, z_motion_carriage_block_length, slot]);
  606. // TODO proper m8 / t8 "nut"
  607. }
  608. }
  609. z_motion_rail_off = -5;
  610. module z_motion_rail_bearing_mount(off = 0) {
  611. // z motion rail
  612. color("magenta")
  613. translate([rail_bearing_mount_off_x, rail_bearing_mount_off_y, -z_motion_rail_off / 2])
  614. rail(outer_height + z_motion_rail_off, z_rail_dia);
  615. // bottom z bearing
  616. translate([0, 0, (slot - rail_bearing_mount_height) / 2])
  617. rail_bearing_mount();
  618. // top z bearing
  619. translate([0, 0, outer_height - ((slot / 2) + rail_bearing_mount_height / 2 + off)])
  620. rail_bearing_mount();
  621. }
  622. module rail_bearing_mount() {
  623. $fn = 20;
  624. color("green")
  625. for(i = [0 : 1])
  626. translate([-rail_bearing_mount_screw + i * (rail_bearing_mount_width + rail_bearing_mount_screw) + rail_bearing_mount_screw, 0, 0])
  627. difference() {
  628. cube([rail_bearing_mount_screw, rail_bearing_mount_base, rail_bearing_mount_height]);
  629. translate([rail_bearing_mount_screw / 2, -1, rail_bearing_mount_height / 2])
  630. rotate([-90, 0, 0])
  631. cylinder(d = 4.2, h = rail_bearing_mount_base + 2);
  632. }
  633. color("green")
  634. translate([rail_bearing_mount_screw, 0, (rail_bearing_mount_height - rail_bearing_height) / 2])
  635. difference() {
  636. hull() {
  637. cube([rail_bearing_mount_width, rail_bearing_mount_base, rail_bearing_height]);
  638. translate([rail_bearing_mount_width / 2, rail_bearing_mount_base + ((rail_bearing_mount_dia + rail_bearing_mount_dia_add) / 2), 0])
  639. cylinder(d = rail_bearing_mount_dia, h = rail_bearing_height);
  640. }
  641. translate([rail_bearing_mount_width / 2, rail_bearing_mount_base + rail_bearing_mount_dia / 2, -1])
  642. cylinder(d = rail_bearing_mount_dia, h = rail_bearing_height + 2);
  643. }
  644. // bottom lip
  645. color("blue")
  646. translate([rail_bearing_mount_screw, 0, (rail_bearing_mount_height - rail_bearing_height) / 2 - rail_bearing_mount_lip_height])
  647. difference() {
  648. hull() {
  649. cube([rail_bearing_mount_width, rail_bearing_mount_base, rail_bearing_mount_lip_height]);
  650. translate([rail_bearing_mount_width / 2, rail_bearing_mount_base + ((rail_bearing_mount_dia + rail_bearing_mount_dia_add) / 2), 0])
  651. cylinder(d = rail_bearing_mount_dia, h = rail_bearing_mount_lip_height);
  652. }
  653. translate([rail_bearing_mount_width / 2, rail_bearing_mount_base + rail_bearing_mount_dia / 2, -1])
  654. cylinder(d = rail_bearing_mount_dia - rail_bearing_mount_lip_remove, h = rail_bearing_height + 2);
  655. }
  656. %translate([rail_bearing_mount_width / 2 + rail_bearing_mount_screw, rail_bearing_mount_base + rail_bearing_mount_dia / 2, (rail_bearing_mount_height - rail_bearing_height) / 2])
  657. difference() {
  658. cylinder(d = rail_bearing_dia, h = rail_bearing_height);
  659. translate([0, 0, -1])
  660. cylinder(d = z_rail_dia, h = rail_bearing_height + 2);
  661. }
  662. }
  663. // #######################################################
  664. // ###################### Extruders ######################
  665. // #######################################################
  666. module extruders() {
  667. w = nema17_size + 25;
  668. translate([0, -bracket_height, outer_height - slot])
  669. rotate([0, 0, 90]) {
  670. translate([0, -(outer_width + w) / 4, 0])
  671. extruder(slot, "1");
  672. translate([0, -(outer_width + w) / 2, 0])
  673. extruder(slot, "2");
  674. translate([0, -(outer_width + w) * 3 / 4, 0])
  675. extruder(slot, "3");
  676. }
  677. }
  678. // ########################################################
  679. // ####################### Assembly #######################
  680. // ########################################################
  681. module assembly() {
  682. if (show_outer_frame) {
  683. frame();
  684. }
  685. if (show_xy_motion) {
  686. motion_xy();
  687. }
  688. if (show_extruders) {
  689. extruders();
  690. }
  691. if (show_z_motion) {
  692. motion_z();
  693. }
  694. if (show_heatbed_frame) {
  695. heatbed();
  696. }
  697. }
  698. assembly();