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

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