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 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  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 = 20;
  12. frame_off_y = 20;
  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 = 20;
  22. bed_y_off = 20;
  23. bed_z_dist = 30;
  24. // display heatbed centered in print volume
  25. bed_draw_height = (outer_height - heatbed_height) / 2;
  26. echo(print_x=heatbed_width, print_y=heatbed_length);
  27. echo(frame_x=outer_width, frame_y=outer_length, frame_z=outer_height);
  28. // #######################################################
  29. // ###################### Libraries ######################
  30. // #######################################################
  31. include <lib/tslot_xy.scad>
  32. include <lib/nema.scad>
  33. include <lib/Belt_Generator.scad>
  34. include <lib/Pulley_T-MXL-XL-HTD-GT2_N-tooth.scad>
  35. include <lib/bearing_idler.scad>
  36. include <lib/rail_mount.scad>
  37. include <lib/linear_bearing.scad>
  38. module gt2_belt(length) {
  39. difference() {
  40. belting("straight", "GT2_2mm", belt_length = length);
  41. translate([-5, -5, 6])
  42. cube([length + 10, 10, 10]);
  43. }
  44. }
  45. // #######################################################
  46. // ######################## Frame ########################
  47. // #######################################################
  48. module slot_angle_connector() {
  49. color("gray")
  50. translate([slot, 0, 0])
  51. rotate([0, -90, 0])
  52. difference() {
  53. cube([slot, slot, slot]);
  54. translate([0, -5, 0])
  55. rotate([0, 45, 0])
  56. cube([2 * slot, 2 * slot, 2 * slot]);
  57. }
  58. }
  59. module foot() {
  60. color("yellow")
  61. translate([0, 0, 10])
  62. cylinder(d = 6, h = 20);
  63. color("yellow")
  64. difference() {
  65. sphere(d = 20);
  66. translate([-15, -15, -30])
  67. cube([30, 30, 30]);
  68. }
  69. }
  70. module lower_frame(double) {
  71. // bottom frame
  72. translate([slot + slot_off, 0, 0])
  73. tslot_x(slot, outer_width - (2 * (slot + slot_off)));
  74. if (double) {
  75. translate([slot + slot_off, outer_length - slot, slot])
  76. rotate([-90, 0, 0])
  77. tslot_2_x(slot, outer_width - (2 * (slot + slot_off)));
  78. translate([0, slot + slot_off, 0])
  79. tslot_2_y(slot, outer_length - (2 * (slot + slot_off)));
  80. translate([outer_width - slot, slot + slot_off, 0])
  81. tslot_2_y(slot, outer_length - (2 * (slot + slot_off)));
  82. } else {
  83. translate([slot + slot_off, outer_length - slot, 0])
  84. tslot_x(slot, outer_width - (2 * (slot + slot_off)));
  85. translate([0, slot + slot_off, 0])
  86. tslot_y(slot, outer_length - (2 * (slot + slot_off)));
  87. translate([outer_width - slot, slot + slot_off, 0])
  88. tslot_y(slot, outer_length - (2 * (slot + slot_off)));
  89. }
  90. }
  91. module frame() {
  92. // outer corner pillars
  93. tslot_z(slot, outer_height);
  94. translate([outer_width - slot, 0, 0])
  95. tslot_z(slot, outer_height);
  96. translate([0, outer_length - slot, 0])
  97. tslot_z(slot, outer_height);
  98. translate([outer_width - slot, outer_length - slot, 0])
  99. tslot_z(slot, outer_height);
  100. lower_frame(false);
  101. // top frame
  102. translate([0, 0, outer_height - slot])
  103. lower_frame(true);
  104. // end caps
  105. color("black")
  106. translate([0, 0, outer_height]) {
  107. cube([slot, slot, 2]);
  108. translate([outer_width - slot, 0, 0])
  109. cube([slot, slot, 2]);
  110. translate([0, outer_length - slot, 0])
  111. cube([slot, slot, 2]);
  112. translate([outer_width - slot, outer_length - slot, 0])
  113. cube([slot, slot, 2]);
  114. }
  115. // feet
  116. translate([slot / 2, slot / 2, -30])
  117. foot();
  118. translate([outer_width - slot / 2, slot / 2, -30])
  119. foot();
  120. translate([slot / 2, outer_length - slot / 2, -30])
  121. foot();
  122. translate([outer_width - slot / 2, outer_length - slot / 2, -30])
  123. foot();
  124. // connecting elements
  125. translate([slot + slot_off, 0, slot + slot_off])
  126. slot_angle_connector();
  127. translate([slot + slot_off, outer_length - slot, slot + slot_off])
  128. slot_angle_connector();
  129. translate([slot + slot_off, 0, outer_height - slot - slot_off])
  130. rotate([0, 90, 0])
  131. slot_angle_connector();
  132. translate([slot + slot_off, outer_length - slot, outer_height - slot - slot_off - slot])
  133. rotate([0, 90, 0])
  134. slot_angle_connector();
  135. translate([outer_width - slot - slot_off, 0, slot + slot_off])
  136. rotate([0, -90, 0])
  137. slot_angle_connector();
  138. translate([outer_width - slot - slot_off, outer_length - slot, slot + slot_off])
  139. rotate([0, -90, 0])
  140. slot_angle_connector();
  141. translate([outer_width - slot - slot_off, 0, outer_height - slot - slot_off])
  142. rotate([0, 180, 0])
  143. slot_angle_connector();
  144. translate([outer_width - slot - slot_off, outer_length - slot, outer_height - slot - slot_off - slot])
  145. rotate([0, 180, 0])
  146. slot_angle_connector();
  147. translate([slot, slot + slot_off, slot + slot_off])
  148. rotate([0, 0, 90])
  149. slot_angle_connector();
  150. translate([slot, slot + slot_off, outer_height - slot - slot_off - slot])
  151. rotate([0, 90, 90])
  152. slot_angle_connector();
  153. translate([0, outer_length - slot - slot_off, slot + slot_off])
  154. rotate([0, 0, -90])
  155. slot_angle_connector();
  156. translate([0, outer_length - slot - slot_off, outer_height - slot - slot_off - slot])
  157. rotate([0, 90, -90])
  158. slot_angle_connector();
  159. translate([outer_width, slot + slot_off, slot + slot_off])
  160. rotate([0, 0, 90])
  161. slot_angle_connector();
  162. translate([outer_width, slot + slot_off, outer_height - slot - slot_off - slot])
  163. rotate([0, 90, 90])
  164. slot_angle_connector();
  165. translate([outer_width - slot, outer_length - slot - slot_off, slot + slot_off])
  166. rotate([0, 0, -90])
  167. slot_angle_connector();
  168. translate([outer_width - slot, outer_length - slot - slot_off, outer_height - slot - slot_off - slot])
  169. rotate([0, 90, -90])
  170. slot_angle_connector();
  171. translate([slot + slot_off, slot + slot_off, slot])
  172. rotate([-90, 0, 0])
  173. slot_angle_connector();
  174. translate([outer_width - slot - slot_off, slot + slot_off, slot])
  175. rotate([-90, 0, 90])
  176. slot_angle_connector();
  177. translate([slot + slot_off, outer_length - slot - slot_off, 0])
  178. rotate([90, 0, 0])
  179. slot_angle_connector();
  180. translate([outer_width - slot - slot_off, outer_length - slot - slot_off, 0])
  181. rotate([90, 0, -90])
  182. slot_angle_connector();
  183. /*
  184. translate([slot + slot_off, slot + slot_off, outer_height])
  185. rotate([-90, 0, 0])
  186. slot_angle_connector();
  187. translate([outer_width - slot - slot_off, slot + slot_off, outer_height])
  188. rotate([-90, 0, 90])
  189. slot_angle_connector();
  190. translate([slot + slot_off, outer_length - slot - slot_off, outer_height - slot])
  191. rotate([90, 0, 0])
  192. slot_angle_connector();
  193. translate([outer_width - slot - slot_off, outer_length - slot - slot_off, outer_height - slot])
  194. rotate([90, 0, -90])
  195. slot_angle_connector();
  196. */
  197. }
  198. // #######################################################
  199. // ###################### Mechanics ######################
  200. // #######################################################
  201. module rail(length) {
  202. cylinder(d = rail_dia, h = length);
  203. echo(rail_dia=rail_dia, rail_len=length);
  204. }
  205. module y_rails() {
  206. // y smooth rail on blue side
  207. color("cyan")
  208. translate([rail_dia / 2 + rail_y_off_1, 18, -30])
  209. rotate([-90, 0, 0])
  210. rail(outer_length - slot - nema17_size - (2 * rail_mount_dist));
  211. // y carriage on blue side
  212. translate([rail_y_off_1 - (lm8uu_outer + lm8uu_dia_add) / 2 + y_carriage_rail_support, y_carriage_pos, -slot])
  213. y_carriage(idler_a_blue, idler_b_blue);
  214. // rail mounts for blue side
  215. color("green")
  216. translate([0, 2 * rail_mount_dist, -2 * slot])
  217. rail_mount(slot);
  218. color("green")
  219. translate([0, outer_length - (2 * slot) - nema17_size - rail_mount_dist + 5, -2 * slot])
  220. rail_mount(slot);
  221. // y smooth rail on red side
  222. color("cyan")
  223. translate([outer_width - (2 * slot) - rail_dia / 2 - rail_y_off_1, 18, -30])
  224. rotate([-90, 0, 0])
  225. rail(outer_length - slot - nema17_size - (2 * rail_mount_dist));
  226. // y carriage on red side
  227. translate([outer_width - slot - y_carriage_width - y_carriage_block_width, y_carriage_pos + y_carriage_length, -slot])
  228. rotate([0, 0, 180])
  229. y_carriage(idler_a_red, idler_b_red);
  230. // rail mounts for red side
  231. color("green")
  232. translate([outer_width - (2 * slot), 2 * rail_mount_dist + rail_mount_len, -2 * slot])
  233. rotate([0, 0, 180])
  234. rail_mount(slot);
  235. color("green")
  236. translate([outer_width - (2 * slot), outer_length - (2 * slot) - nema17_size - rail_mount_dist + 5 + rail_mount_len, -2 * slot])
  237. rotate([0, 0, 180])
  238. rail_mount(slot);
  239. }
  240. module x_rails() {
  241. // TODO length calculate properly!
  242. color("cyan")
  243. translate([30, y_carriage_pos, 15])
  244. rotate([0, 90, 0])
  245. rail(outer_width - (4 * slot));
  246. color("cyan")
  247. translate([30, y_carriage_pos + x_rail_dist, 15])
  248. rotate([0, 90, 0])
  249. rail(outer_width - (4 * slot));
  250. translate([x_carriage_pos, y_carriage_pos - x_carriage_len_add, slot / 2])
  251. x_carriage();
  252. }
  253. module motion_xy() {
  254. translate([slot, slot, outer_height])
  255. y_rails();
  256. translate([slot, slot + y_carriage_len_add, outer_height - (1.5 * slot)])
  257. x_rails();
  258. // left ("blue") motor
  259. translate([slot, outer_length - slot - nema17_size - nema17_mount_wall, outer_height + nema17_mount_wall])
  260. rotate([180, 0, 90]) {
  261. color("blue")
  262. translate([0, 0, -65])
  263. nema17(65);
  264. color("green")
  265. nema17_mount(slot);
  266. // blue motor pulley
  267. color("magenta")
  268. translate([nema17_size / 2, nema17_size / 2, 22.4])
  269. rotate([180, 0, 0])
  270. gt2_pulley();
  271. // blue gt2 belt at motor
  272. color("blue")
  273. translate([nema17_size / 2, nema17_size / 2 + 6.5, nema17_mount_wall + 1])
  274. rotate([0, 0, 180])
  275. gt2_belt(outer_length - (2 * slot) - nema17_size / 2 - x_rail_dist - y_carriage_pos - 15);
  276. color("blue")
  277. translate([-outer_length + (3 * slot) + 10 + nema17_size / 2, nema17_size / 2 - 6.5, nema17_mount_wall + 1])
  278. gt2_belt(outer_length - (3 * slot) - 10);
  279. }
  280. // right ("red") motor
  281. translate([outer_width - slot - nema17_size, outer_length - slot - nema17_size - nema17_mount_wall, outer_height + nema17_mount_wall])
  282. rotate([180, 0, 90]) {
  283. color("red")
  284. translate([0, 0, -65])
  285. nema17(65);
  286. color("green")
  287. nema17_mount(slot);
  288. // red motor pulley
  289. color("cyan")
  290. translate([nema17_size / 2, nema17_size / 2, 8.2])
  291. gt2_pulley();
  292. // red gt2 belt at motor
  293. color("red")
  294. translate([nema17_size / 2, nema17_size / 2 + 6.5, nema17_mount_wall + 8])
  295. rotate([0, 0, 180])
  296. gt2_belt(outer_length - (3 * slot) - 10);
  297. color("red")
  298. 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])
  299. gt2_belt(outer_length - (2 * slot) - nema17_size / 2 - x_rail_dist - y_carriage_pos - 15);
  300. }
  301. // x carriage belts on blue side
  302. color("blue")
  303. translate([slot + 29, slot + x_rail_dist + 7 + y_carriage_pos, outer_height - 1])
  304. rotate([180, 0, 0])
  305. gt2_belt(x_carriage_pos - 20);
  306. color("red")
  307. translate([slot + 15, slot + 23 + y_carriage_pos, outer_height - 8])
  308. rotate([180, 0, 0])
  309. gt2_belt(x_carriage_pos - 6);
  310. // x carriage belts on red side
  311. color("red")
  312. translate([slot + x_carriage_width + x_carriage_pos - 7, slot + x_rail_dist + 7 + y_carriage_pos, outer_height - 8])
  313. rotate([180, 0, 0])
  314. gt2_belt(outer_width - x_carriage_pos - (2 * slot) - x_carriage_width - 20);
  315. color("blue")
  316. translate([slot + x_carriage_width + x_carriage_pos - 7, slot + 23 + y_carriage_pos, outer_height - 1])
  317. rotate([180, 0, 0])
  318. gt2_belt(outer_width - x_carriage_pos - (2 * slot) - x_carriage_width - 10);
  319. // long back belts
  320. color("blue")
  321. translate([slot + 15, slot + 10, outer_height - 7])
  322. gt2_belt(outer_width - nema17_size - (2 * slot) + 13);
  323. color("red")
  324. translate([slot + 15, slot + 10, outer_height - 14])
  325. gt2_belt(outer_width - nema17_size - (2 * slot) + 13);
  326. // blue belt on red side
  327. color("blue")
  328. translate([outer_width - slot - 15, slot + 10, outer_height - 7])
  329. rotate([0, 0, 90])
  330. gt2_belt(y_carriage_pos + 10);
  331. // red belt on blue side
  332. color("red")
  333. translate([slot + 15, slot + 19 + y_carriage_pos, outer_height - 14])
  334. rotate([0, 0, -90])
  335. gt2_belt(y_carriage_pos + 10);
  336. // idler on blue side
  337. translate([slot + bearing_mount_width + 15, 0, outer_height - slot])
  338. rotate([0, 0, 90])
  339. slot_mount_bracket(slot, true);
  340. // idler on red side
  341. translate([outer_width - slot - 15, 0, outer_height - slot])
  342. rotate([0, 0, 90])
  343. slot_mount_bracket(slot, true);
  344. }
  345. // #######################################################
  346. // ####################### Heatbed #######################
  347. // #######################################################
  348. module heatbed_plate() {
  349. difference() {
  350. color("yellow")
  351. cube([heatbed_width, heatbed_length, heatbed_height]);
  352. #translate([bed_x_off + (slot / 2), bed_y_off + (slot / 2), -bed_z_dist - slot - 1])
  353. cylinder(d = 4.2, h = bed_z_dist + slot + heatbed_height + 2);
  354. #translate([heatbed_width - bed_x_off - (slot / 2), bed_y_off + (slot / 2), -bed_z_dist - slot - 1])
  355. cylinder(d = 4.2, h = bed_z_dist + slot + heatbed_height + 2);
  356. #translate([bed_x_off + (slot / 2), heatbed_length - bed_y_off - (slot / 2), -bed_z_dist - slot - 1])
  357. cylinder(d = 4.2, h = bed_z_dist + slot + heatbed_height + 2);
  358. #translate([heatbed_width - bed_x_off - (slot / 2), heatbed_length - bed_y_off - (slot / 2), -bed_z_dist - slot - 1])
  359. cylinder(d = 4.2, h = bed_z_dist + slot + heatbed_height + 2);
  360. }
  361. echo(max_bed_heater_width=heatbed_width - (2 * bed_x_off) - slot - 5);
  362. echo(max_bed_heater_length=heatbed_length - (2 * bed_y_off) - slot - 5);
  363. }
  364. module heatbed() {
  365. translate([slot + frame_off_x, slot + frame_off_y, bed_draw_height]) {
  366. heatbed_plate();
  367. // t-slots as heatbed frame
  368. translate([bed_x_off, bed_y_off, -slot - bed_z_dist])
  369. tslot_y(slot, heatbed_length - (2 * bed_y_off));
  370. translate([heatbed_width - slot - bed_x_off, bed_y_off, -slot - bed_z_dist])
  371. tslot_y(slot, heatbed_length - (2 * bed_y_off));
  372. translate([slot + bed_x_off + slot_off, bed_y_off, -slot - bed_z_dist])
  373. tslot_x(slot, heatbed_width - 2 * (bed_x_off + slot + slot_off));
  374. translate([slot + bed_x_off + slot_off, heatbed_length - slot - bed_y_off, -slot - bed_z_dist])
  375. tslot_x(slot, heatbed_width - 2 * (bed_x_off + slot + slot_off));
  376. translate([bed_x_off + slot, bed_y_off + slot, -slot - bed_z_dist])
  377. rotate([90, 0, 90])
  378. slot_angle_connector();
  379. translate([bed_x_off + slot, heatbed_length - slot - bed_y_off, -slot - bed_z_dist])
  380. rotate([90, 0, 0])
  381. slot_angle_connector();
  382. translate([heatbed_width - slot - bed_x_off, heatbed_length - slot - bed_y_off, -slot - bed_z_dist])
  383. rotate([90, 0, -90])
  384. slot_angle_connector();
  385. translate([heatbed_width - slot - bed_x_off, bed_y_off + slot, -slot - bed_z_dist])
  386. rotate([90, 0, 180])
  387. slot_angle_connector();
  388. }
  389. }
  390. // ########################################################
  391. // ####################### Assembly #######################
  392. // ########################################################
  393. frame();
  394. motion_xy();
  395. heatbed();