My self designed awesome 3D printer
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

xyRepRap.scad 17KB

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