123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613 |
-
- // #######################################################
- // ################## Config Parameters ##################
- // #######################################################
-
- slot = 30; // or 20
- slot_off = 1; // distance between adjacent slots
-
- // print area / volume
- heatbed_width = 400;
- heatbed_length = 400;
-
- heatbed_height = 6;
-
- // distance between heatbed edge and inner t-slot frame edge
- frame_off_x = 20;
- frame_off_y = 20;
-
- outer_width = heatbed_width + (2 * (slot + frame_off_x));
- outer_length = heatbed_length + (2 * (slot + frame_off_y));
-
- // TODO depend on print area height
- outer_height = 500;
-
- rail_mount_dist = 12;
- y_carriage_pos = 175;
- x_carriage_pos = 180;
-
- // distance between heatbed and z-carriage frame
- bed_x_off = 20;
- bed_y_off = 20;
- bed_z_dist = 30;
-
- // display heatbed centered in print volume
- bed_draw_height = (outer_height - heatbed_height) / 2; // + 175;
-
- show_outer_frame = true;
- show_extruders = false;
- show_z_motion = true;
-
- show_heatbed_frame = true;
- show_heatbed = true;
-
- show_xy_motion = true;
- show_x_carriage = false;
- show_belts = false;
-
- echo(print_x=heatbed_width, print_y=heatbed_length);
- echo(frame_x=outer_width, frame_y=outer_length, frame_z=outer_height);
-
- // #######################################################
- // ###################### Libraries ######################
- // #######################################################
-
- include <lib/tslot_xy.scad>
- include <lib/nema.scad>
- include <lib/Belt_Generator.scad>
- include <lib/Pulley_T-MXL-XL-HTD-GT2_N-tooth.scad>
- include <lib/bearing_idler.scad>
- include <lib/rail_mount.scad>
- include <lib/linear_bearing.scad>
- include <lib/extruder.scad>
-
- module gt2_belt(length) {
- if (show_belts) {
- difference() {
- belting("straight", "GT2_2mm", belt_length = length);
- translate([-5, -5, 6])
- cube([length + 10, 10, 10]);
- }
- }
- }
-
- // #######################################################
- // ######################## Frame ########################
- // #######################################################
-
- module slot_angle_connector() {
- color("gray")
- translate([slot, 0, 0])
- rotate([0, -90, 0])
- difference() {
- cube([slot, slot, slot]);
- translate([0, -5, 0])
- rotate([0, 45, 0])
- cube([2 * slot, 2 * slot, 2 * slot]);
- }
- }
-
- module foot() {
- color("yellow")
- translate([0, 0, 10])
- cylinder(d = 6, h = 20);
-
- color("yellow")
- difference() {
- sphere(d = 20);
- translate([-15, -15, -30])
- cube([30, 30, 30]);
- }
- }
-
- module lower_frame(double) {
- if (double) {
- translate([slot + slot_off, 0, slot])
- rotate([-90, 0, 0])
- tslot_2_x(slot, outer_width - (2 * (slot + slot_off)));
-
- translate([slot + slot_off, outer_length - slot, slot])
- rotate([-90, 0, 0])
- tslot_2_x(slot, outer_width - (2 * (slot + slot_off)));
-
- translate([0, slot + slot_off, 0])
- tslot_2_y(slot, outer_length - (2 * (slot + slot_off)));
- translate([outer_width - slot, slot + slot_off, 0])
- tslot_2_y(slot, outer_length - (2 * (slot + slot_off)));
- } else {
- translate([slot + slot_off, 0, 0])
- tslot_x(slot, outer_width - (2 * (slot + slot_off)));
-
- translate([slot + slot_off, outer_length - slot, 0])
- tslot_x(slot, outer_width - (2 * (slot + slot_off)));
-
- translate([0, slot + slot_off, 0])
- tslot_y(slot, outer_length - (2 * (slot + slot_off)));
- translate([outer_width - slot, slot + slot_off, 0])
- tslot_y(slot, outer_length - (2 * (slot + slot_off)));
- }
- }
-
- module frame() {
- // outer corner pillars
- tslot_z(slot, outer_height);
- translate([outer_width - slot, 0, 0])
- tslot_z(slot, outer_height);
- translate([0, outer_length - slot, 0])
- tslot_z(slot, outer_height);
- translate([outer_width - slot, outer_length - slot, 0])
- tslot_z(slot, outer_height);
-
- lower_frame(false);
-
- // top frame
- translate([0, 0, outer_height - slot])
- lower_frame(true);
-
- // end caps
- color("black")
- translate([0, 0, outer_height]) {
- cube([slot, slot, 2]);
- translate([outer_width - slot, 0, 0])
- cube([slot, slot, 2]);
- translate([0, outer_length - slot, 0])
- cube([slot, slot, 2]);
- translate([outer_width - slot, outer_length - slot, 0])
- cube([slot, slot, 2]);
- }
-
- // feet
- translate([slot / 2, slot / 2, -30])
- foot();
- translate([outer_width - slot / 2, slot / 2, -30])
- foot();
- translate([slot / 2, outer_length - slot / 2, -30])
- foot();
- translate([outer_width - slot / 2, outer_length - slot / 2, -30])
- foot();
-
- // connecting elements
- translate([slot + slot_off, 0, slot + slot_off])
- slot_angle_connector();
- translate([slot + slot_off, outer_length - slot, slot + slot_off])
- slot_angle_connector();
- translate([slot + slot_off, 0, outer_height - slot - slot_off - slot])
- rotate([0, 90, 0])
- slot_angle_connector();
- translate([slot + slot_off, outer_length - slot, outer_height - slot - slot_off - slot])
- rotate([0, 90, 0])
- slot_angle_connector();
- translate([outer_width - slot - slot_off, 0, slot + slot_off])
- rotate([0, -90, 0])
- slot_angle_connector();
- translate([outer_width - slot - slot_off, outer_length - slot, slot + slot_off])
- rotate([0, -90, 0])
- slot_angle_connector();
- translate([outer_width - slot - slot_off, 0, outer_height - slot - slot_off - slot])
- rotate([0, 180, 0])
- slot_angle_connector();
- translate([outer_width - slot - slot_off, outer_length - slot, outer_height - slot - slot_off - slot])
- rotate([0, 180, 0])
- slot_angle_connector();
- translate([slot, slot + slot_off, slot + slot_off])
- rotate([0, 0, 90])
- slot_angle_connector();
- translate([slot, slot + slot_off, outer_height - slot - slot_off - slot])
- rotate([0, 90, 90])
- slot_angle_connector();
- translate([0, outer_length - slot - slot_off, slot + slot_off])
- rotate([0, 0, -90])
- slot_angle_connector();
- translate([0, outer_length - slot - slot_off, outer_height - slot - slot_off - slot])
- rotate([0, 90, -90])
- slot_angle_connector();
- translate([outer_width, slot + slot_off, slot + slot_off])
- rotate([0, 0, 90])
- slot_angle_connector();
- translate([outer_width, slot + slot_off, outer_height - slot - slot_off - slot])
- rotate([0, 90, 90])
- slot_angle_connector();
- translate([outer_width - slot, outer_length - slot - slot_off, slot + slot_off])
- rotate([0, 0, -90])
- slot_angle_connector();
- translate([outer_width - slot, outer_length - slot - slot_off, outer_height - slot - slot_off - slot])
- rotate([0, 90, -90])
- slot_angle_connector();
- translate([slot + slot_off, slot + slot_off, slot])
- rotate([-90, 0, 0])
- slot_angle_connector();
- translate([outer_width - slot - slot_off, slot + slot_off, slot])
- rotate([-90, 0, 90])
- slot_angle_connector();
- translate([slot + slot_off, outer_length - slot - slot_off, 0])
- rotate([90, 0, 0])
- slot_angle_connector();
- translate([outer_width - slot - slot_off, outer_length - slot - slot_off, 0])
- rotate([90, 0, -90])
- slot_angle_connector();
- /*
- translate([slot + slot_off, slot + slot_off, outer_height])
- rotate([-90, 0, 0])
- slot_angle_connector();
- translate([outer_width - slot - slot_off, slot + slot_off, outer_height])
- rotate([-90, 0, 90])
- slot_angle_connector();
- translate([slot + slot_off, outer_length - slot - slot_off, outer_height - slot])
- rotate([90, 0, 0])
- slot_angle_connector();
- translate([outer_width - slot - slot_off, outer_length - slot - slot_off, outer_height - slot])
- rotate([90, 0, -90])
- slot_angle_connector();
- */
- }
-
- // #######################################################
- // ###################### Mechanics ######################
- // #######################################################
-
- module rail(length) {
- cylinder(d = rail_dia, h = length);
- echo(rail_dia=rail_dia, rail_len=length);
- }
-
- module y_rails() {
- // y smooth rail on blue side
- color("cyan")
- translate([rail_dia / 2 + rail_y_off_1, 18, -30])
- rotate([-90, 0, 0])
- rail(outer_length - slot - nema17_size - (2 * rail_mount_dist));
-
- // y carriage on blue side
- translate([rail_y_off_1 - (lm8uu_outer + lm8uu_dia_add) / 2 + y_carriage_rail_support, y_carriage_pos, -slot])
- y_carriage(idler_a_blue, idler_b_blue);
-
- // rail mounts for blue side
- color("green")
- translate([0, 2 * rail_mount_dist, -2 * slot])
- rail_mount(slot);
- color("green")
- translate([0, outer_length - (2 * slot) - nema17_size - rail_mount_dist + 5, -2 * slot])
- rail_mount(slot);
-
- // y smooth rail on red side
- color("cyan")
- translate([outer_width - (2 * slot) - rail_dia / 2 - rail_y_off_1, 18, -30])
- rotate([-90, 0, 0])
- rail(outer_length - slot - nema17_size - (2 * rail_mount_dist));
-
- // y carriage on red side
- translate([outer_width - slot - y_carriage_width - y_carriage_block_width, y_carriage_pos + y_carriage_length, -slot])
- rotate([0, 0, 180])
- y_carriage(idler_a_red, idler_b_red);
-
- // rail mounts for red side
- color("green")
- translate([outer_width - (2 * slot), 2 * rail_mount_dist + rail_mount_len, -2 * slot])
- rotate([0, 0, 180])
- rail_mount(slot);
- color("green")
- translate([outer_width - (2 * slot), outer_length - (2 * slot) - nema17_size - rail_mount_dist + 5 + rail_mount_len, -2 * slot])
- rotate([0, 0, 180])
- rail_mount(slot);
- }
-
- module x_rails() {
- // TODO length calculate properly!
-
- color("cyan")
- translate([30, y_carriage_pos, 15])
- rotate([0, 90, 0])
- rail(outer_width - (4 * slot));
-
- color("cyan")
- translate([30, y_carriage_pos + x_rail_dist, 15])
- rotate([0, 90, 0])
- rail(outer_width - (4 * slot));
-
- if (show_x_carriage) {
- translate([x_carriage_pos, y_carriage_pos - x_carriage_len_add, slot / 2])
- x_carriage();
- }
- }
-
- module motion_xy() {
- translate([slot, slot, outer_height])
- y_rails();
-
- translate([slot, slot + y_carriage_len_add, outer_height - (1.5 * slot)])
- x_rails();
-
- // left ("blue") motor
- translate([slot, outer_length - slot - nema17_size - nema17_mount_wall, outer_height + nema17_mount_wall])
- rotate([180, 0, 90]) {
- color("blue")
- translate([0, 0, -65])
- nema17(65);
-
- color("green")
- nema17_mount(slot);
-
- // blue motor pulley
- color("magenta")
- translate([nema17_size / 2, nema17_size / 2, 22.4])
- rotate([180, 0, 0])
- gt2_pulley();
-
- // blue gt2 belt at motor
- color("blue")
- translate([nema17_size / 2, nema17_size / 2 + 6.5, nema17_mount_wall + 1])
- rotate([0, 0, 180])
- gt2_belt(outer_length - (2 * slot) - nema17_size / 2 - x_rail_dist - y_carriage_pos - 15);
- color("blue")
- translate([-outer_length + (3 * slot) + 10 + nema17_size / 2, nema17_size / 2 - 6.5, nema17_mount_wall + 1])
- gt2_belt(outer_length - (3 * slot) - 10);
- }
-
- // right ("red") motor
- translate([outer_width - slot - nema17_size, outer_length - slot - nema17_size - nema17_mount_wall, outer_height + nema17_mount_wall])
- rotate([180, 0, 90]) {
- color("red")
- translate([0, 0, -65])
- nema17(65);
-
- color("green")
- nema17_mount(slot);
-
- // red motor pulley
- color("cyan")
- translate([nema17_size / 2, nema17_size / 2, 8.2])
- gt2_pulley();
-
- // red gt2 belt at motor
- color("red")
- translate([nema17_size / 2, nema17_size / 2 + 6.5, nema17_mount_wall + 8])
- rotate([0, 0, 180])
- gt2_belt(outer_length - (3 * slot) - 10);
- color("red")
- 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])
- gt2_belt(outer_length - (2 * slot) - nema17_size / 2 - x_rail_dist - y_carriage_pos - 15);
- }
-
- // x carriage belts on blue side
- color("blue")
- translate([slot + 29, slot + x_rail_dist + 7 + y_carriage_pos, outer_height - 1])
- rotate([180, 0, 0])
- gt2_belt(x_carriage_pos - 20);
- color("red")
- translate([slot + 15, slot + 23 + y_carriage_pos, outer_height - 8])
- rotate([180, 0, 0])
- gt2_belt(x_carriage_pos - 6);
-
- // x carriage belts on red side
- color("red")
- translate([slot + x_carriage_width + x_carriage_pos - 7, slot + x_rail_dist + 7 + y_carriage_pos, outer_height - 8])
- rotate([180, 0, 0])
- gt2_belt(outer_width - x_carriage_pos - (2 * slot) - x_carriage_width - 20);
- color("blue")
- translate([slot + x_carriage_width + x_carriage_pos - 7, slot + 23 + y_carriage_pos, outer_height - 1])
- rotate([180, 0, 0])
- gt2_belt(outer_width - x_carriage_pos - (2 * slot) - x_carriage_width - 10);
-
- // long back belts
- color("blue")
- translate([slot + 15, slot + 10, outer_height - 7])
- gt2_belt(outer_width - nema17_size - (2 * slot) + 13);
- color("red")
- translate([slot + 15, slot + 10, outer_height - 14])
- gt2_belt(outer_width - nema17_size - (2 * slot) + 13);
-
- // blue belt on red side
- color("blue")
- translate([outer_width - slot - 15, slot + 10, outer_height - 7])
- rotate([0, 0, 90])
- gt2_belt(y_carriage_pos + 10);
-
- // red belt on blue side
- color("red")
- translate([slot + 15, slot + 19 + y_carriage_pos, outer_height - 14])
- rotate([0, 0, -90])
- gt2_belt(y_carriage_pos + 10);
-
- // idler on blue side
- translate([slot + bearing_mount_width + 15, 0, outer_height - slot])
- rotate([0, 0, 90])
- slot_mount_bracket(slot, true);
-
- // idler on red side
- translate([outer_width - slot - 15, 0, outer_height - slot])
- rotate([0, 0, 90])
- slot_mount_bracket(slot, true);
- }
-
- // #######################################################
- // ####################### Heatbed #######################
- // #######################################################
-
- module heatbed_plate() {
- difference() {
- color("yellow")
- cube([heatbed_width, heatbed_length, heatbed_height]);
-
- #translate([bed_x_off + (slot / 2), bed_y_off + (slot / 2), -bed_z_dist - slot - 1])
- cylinder(d = 4.2, h = bed_z_dist + slot + heatbed_height + 2);
- #translate([heatbed_width - bed_x_off - (slot / 2), bed_y_off + (slot / 2), -bed_z_dist - slot - 1])
- cylinder(d = 4.2, h = bed_z_dist + slot + heatbed_height + 2);
- #translate([bed_x_off + (slot / 2), heatbed_length - bed_y_off - (slot / 2), -bed_z_dist - slot - 1])
- cylinder(d = 4.2, h = bed_z_dist + slot + heatbed_height + 2);
- #translate([heatbed_width - bed_x_off - (slot / 2), heatbed_length - bed_y_off - (slot / 2), -bed_z_dist - slot - 1])
- cylinder(d = 4.2, h = bed_z_dist + slot + heatbed_height + 2);
- }
-
- echo(max_bed_heater_width=heatbed_width - (2 * bed_x_off) - slot - 5);
- echo(max_bed_heater_length=heatbed_length - (2 * bed_y_off) - slot - 5);
- }
-
- module heatbed() {
- translate([slot + frame_off_x, slot + frame_off_y, bed_draw_height]) {
- if (show_heatbed) {
- %heatbed_plate();
- }
-
- // t-slots as heatbed frame
- translate([bed_x_off, bed_y_off, -slot - bed_z_dist])
- tslot_y(slot, heatbed_length - (2 * bed_y_off));
- translate([heatbed_width - slot - bed_x_off, bed_y_off, -slot - bed_z_dist])
- tslot_y(slot, heatbed_length - (2 * bed_y_off));
- translate([slot + bed_x_off + slot_off, bed_y_off, -slot - bed_z_dist])
- tslot_x(slot, heatbed_width - 2 * (bed_x_off + slot + slot_off));
- translate([slot + bed_x_off + slot_off, heatbed_length - slot - bed_y_off, -slot - bed_z_dist])
- tslot_x(slot, heatbed_width - 2 * (bed_x_off + slot + slot_off));
-
- translate([bed_x_off + slot, bed_y_off + slot, -slot - bed_z_dist])
- rotate([90, 0, 90])
- slot_angle_connector();
- translate([bed_x_off + slot, heatbed_length - slot - bed_y_off, -slot - bed_z_dist])
- rotate([90, 0, 0])
- slot_angle_connector();
- translate([heatbed_width - slot - bed_x_off, heatbed_length - slot - bed_y_off, -slot - bed_z_dist])
- rotate([90, 0, -90])
- slot_angle_connector();
- translate([heatbed_width - slot - bed_x_off, bed_y_off + slot, -slot - bed_z_dist])
- rotate([90, 0, 180])
- slot_angle_connector();
- }
- }
-
- z_rail_x_off = 60;
- z_rail_mount_len = 20;
-
- module motion_z_rail() {
- // bottom clamp
- color("green")
- translate([slot, 0, slot / 2 + 5 + (z_rail_mount_len - rail_mount_len) / 2])
- rotate([-90, 0, 90])
- rail_mount(slot, z_rail_mount_len);
-
- // top clamp
- color("green")
- translate([slot, 0, outer_height - slot / 2 + 5 + (z_rail_mount_len - rail_mount_len) / 2 - slot])
- rotate([-90, 0, 90])
- rail_mount(slot, z_rail_mount_len);
-
- // rail
- color("cyan")
- translate([0, rail_y_off, 4])
- rail(outer_height - slot - 8);
- }
-
- z_carriage_wall = 10;
-
- module z_carriage() {
- color("green")
- translate([frame_off_x + bed_x_off - z_rail_x_off, frame_off_y + bed_y_off - rail_y_off, 0]) {
- // bracket on long rail
- translate([-z_carriage_wall, -z_carriage_wall, 0])
- cube([z_carriage_wall, z_carriage_wall + (2 * slot), slot]);
-
- // bracket on short rail
- translate([0, -z_carriage_wall, 0])
- cube([3 * slot, z_carriage_wall, slot]);
- }
-
- // TODO proper long bearings
- color("magenta")
- translate([0, 0, (slot - (2 * lm8uu_height + 1)) / 2]) {
- %lm8uu();
- %translate([0, 0, lm8uu_height + 1])
- lm8uu();
- }
- }
-
- module motion_z() {
- // front left
- translate([slot + z_rail_x_off, slot, 0])
- motion_z_rail();
- // front right
- translate([outer_width - z_rail_x_off - slot, slot, 0])
- motion_z_rail();
- // back left
- translate([slot + z_rail_x_off, outer_length - slot, 0])
- rotate([0, 0, 180])
- motion_z_rail();
- // back right
- translate([outer_width - z_rail_x_off - slot, outer_length - slot, 0])
- rotate([0, 0, 180])
- motion_z_rail();
-
- // front left
- translate([slot + z_rail_x_off, slot + rail_y_off, bed_draw_height - bed_z_dist - slot])
- z_carriage();
- // front right
- translate([outer_width - slot - z_rail_x_off, slot + rail_y_off, bed_draw_height - bed_z_dist - slot])
- scale([-1, 1, 1])
- z_carriage();
- // back left
- translate([slot + z_rail_x_off, outer_length - slot - rail_y_off, bed_draw_height - bed_z_dist - slot])
- scale([1, -1, 1])
- z_carriage();
- // back right
- translate([outer_width - slot - z_rail_x_off, outer_length - slot - rail_y_off, bed_draw_height - bed_z_dist - slot])
- scale([-1, -1, 1])
- z_carriage();
-
- // yellow z-motor on top
- translate([(outer_width - nema17_size) / 2, outer_length - slot - nema17_size - nema17_mount_wall, outer_height + nema17_mount_wall])
- rotate([180, 0, 90]) {
- color("yellow")
- translate([0, 0, -65])
- nema17(65);
-
- color("green")
- nema17_mount(slot);
-
- // blue motor pulley
- color("orange")
- translate([nema17_size / 2, nema17_size / 2, 8.2])
- gt2_pulley();
- }
- }
-
- // #######################################################
- // ###################### Extruders ######################
- // #######################################################
-
- module extruders() {
- w = nema17_size + 25;
- translate([0, -bracket_height, outer_height - slot])
- rotate([0, 0, 90]) {
- translate([0, -(outer_width + w) / 4, 0])
- extruder(slot, "1");
- translate([0, -(outer_width + w) / 2, 0])
- extruder(slot, "2");
- translate([0, -(outer_width + w) * 3 / 4, 0])
- extruder(slot, "3");
- }
- }
-
- // ########################################################
- // ####################### Assembly #######################
- // ########################################################
-
- module assembly() {
- if (show_outer_frame) {
- frame();
- }
-
- if (show_xy_motion) {
- motion_xy();
- }
-
- if (show_extruders) {
- extruders();
- }
-
- if (show_z_motion) {
- motion_z();
- }
-
- if (show_heatbed_frame) {
- heatbed();
- }
- }
-
- assembly();
|