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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  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 = 10;
  195. module y_rails() {
  196. // y smooth rail on blue side
  197. color("cyan")
  198. translate([rail_dia / 2 + rail_y_off_1, 18, -30])
  199. rotate([-90, 0, 0])
  200. cylinder(d = rail_dia, h = outer_length - (2 * slot) - nema17_size - rail_mount_dist);
  201. // some lm8uu bearings on red side
  202. color("yellow")
  203. for (i = [0 : 30 : 60]) {
  204. translate([rail_dia / 2 + rail_y_off_1, 60 + i, -30])
  205. rotate([-90, 0, 0])
  206. lm8uu();
  207. }
  208. // rail mounts for blue side
  209. color("green")
  210. translate([0, 2 * rail_mount_dist, -2 * slot])
  211. rail_mount(slot);
  212. color("green")
  213. translate([0, outer_length - (2 * slot) - nema17_size - rail_mount_dist + 5, -2 * slot])
  214. rail_mount(slot);
  215. // y smooth rail on red side
  216. color("cyan")
  217. translate([outer_width - (2 * slot) - rail_dia / 2 - rail_y_off_1, 18, -30])
  218. rotate([-90, 0, 0])
  219. cylinder(d = rail_dia, h = outer_length - (2 * slot) - nema17_size - rail_mount_dist);
  220. // some lm8uu bearings on red side
  221. color("yellow")
  222. for (i = [0 : 30 : 60]) {
  223. translate([outer_width - (2 * slot) - rail_dia / 2 - rail_y_off_1, 60 + i, -30])
  224. rotate([-90, 0, 0])
  225. lm8uu();
  226. }
  227. // rail mounts for red side
  228. color("green")
  229. translate([outer_width - (2 * slot), 2 * rail_mount_dist + rail_mount_len, -2 * slot])
  230. rotate([0, 0, 180])
  231. rail_mount(slot);
  232. color("green")
  233. translate([outer_width - (2 * slot), outer_length - (2 * slot) - nema17_size - rail_mount_dist + 5 + rail_mount_len, -2 * slot])
  234. rotate([0, 0, 180])
  235. rail_mount(slot);
  236. }
  237. x_rail_dist = 50;
  238. module x_rails() {
  239. translate([30, 200, 15])
  240. rotate([0, 90, 0])
  241. cylinder(d = rail_dia, h = outer_length - (4 * slot));
  242. translate([30, 200 + x_rail_dist, 15])
  243. rotate([0, 90, 0])
  244. cylinder(d = rail_dia, h = outer_length - (4 * slot));
  245. }
  246. module motion_xy() {
  247. translate([slot, slot, outer_height])
  248. y_rails();
  249. //color("cyan")
  250. //translate([slot, slot, outer_height - (1.5 * slot)])
  251. // x_rails();
  252. // left ("blue") motor
  253. translate([slot, outer_length - slot - nema17_size - nema17_mount_wall, outer_height + nema17_mount_wall])
  254. rotate([180, 0, 90]) {
  255. color("blue")
  256. translate([0, 0, -65])
  257. nema17(65);
  258. color("green")
  259. nema17_mount(slot);
  260. // blue motor pulley
  261. color("magenta")
  262. translate([nema17_size / 2, nema17_size / 2, 22.4])
  263. rotate([180, 0, 0])
  264. gt2_pulley();
  265. // blue gt2 belt at motor
  266. color("blue")
  267. translate([nema17_size / 2, nema17_size / 2 + 6.5, nema17_mount_wall + 1])
  268. rotate([0, 0, 180])
  269. gt2_belt(200);
  270. color("blue")
  271. translate([-outer_length + (3 * slot) + 10 + nema17_size / 2, nema17_size / 2 - 6.5, nema17_mount_wall + 1])
  272. gt2_belt(outer_length - (3 * slot) - 10);
  273. }
  274. // right ("red") motor
  275. translate([outer_width - slot - nema17_size, outer_length - slot - nema17_size - nema17_mount_wall, outer_height + nema17_mount_wall])
  276. rotate([180, 0, 90]) {
  277. color("red")
  278. translate([0, 0, -65])
  279. nema17(65);
  280. color("green")
  281. nema17_mount(slot);
  282. // red motor pulley
  283. color("cyan")
  284. translate([nema17_size / 2, nema17_size / 2, 8.2])
  285. gt2_pulley();
  286. // red gt2 belt at motor
  287. color("red")
  288. translate([nema17_size / 2, nema17_size / 2 + 6.5, nema17_mount_wall + 8])
  289. rotate([0, 0, 180])
  290. gt2_belt(outer_length - (3 * slot) - 10);
  291. color("red")
  292. translate([-200 + nema17_size / 2, nema17_size / 2 - 6.5, nema17_mount_wall + 8])
  293. gt2_belt(200);
  294. }
  295. // long back belts
  296. color("blue")
  297. translate([slot + 15, slot + 10, outer_height - 7])
  298. gt2_belt(outer_width - nema17_size - (2 * slot) + 13);
  299. color("red")
  300. translate([slot + 15, slot + 10, outer_height - 14])
  301. gt2_belt(outer_width - nema17_size - (2 * slot) + 13);
  302. // blue belt on red side
  303. color("blue")
  304. translate([outer_width - slot - 15, slot + 10, outer_height - 7])
  305. rotate([0, 0, 90])
  306. gt2_belt(200);
  307. // red belt on blue side
  308. color("red")
  309. translate([slot + 15, slot + 209, outer_height - 14])
  310. rotate([0, 0, -90])
  311. gt2_belt(200);
  312. // idler on blue side
  313. translate([slot + bearing_mount_width + 15, 0, outer_height - slot])
  314. rotate([0, 0, 90])
  315. slot_mount_bracket(slot, true);
  316. // idler on red side
  317. translate([outer_width - slot - 15, 0, outer_height - slot])
  318. rotate([0, 0, 90])
  319. slot_mount_bracket(slot, true);
  320. }
  321. // #######################################################
  322. // ####################### Heatbed #######################
  323. // #######################################################
  324. module heatbed() {
  325. color("yellow")
  326. translate([slot + frame_off_x, slot + frame_off_y, bed_draw_height])
  327. cube([heatbed_width, heatbed_length, heatbed_height]);
  328. }
  329. // ########################################################
  330. // ####################### Assembly #######################
  331. // ########################################################
  332. frame();
  333. motion_xy();
  334. heatbed();