Last active
March 2, 2022 15:50
-
-
Save truckershitch/795b00f6c6c265ab82773d9deba02a9a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
ADXL345 Mounts for Ender-3v2 X and Y Axes | |
Inspired by: | |
https://www.thingiverse.com/thing:4882714 | |
This version mounts on the small space | |
to the left of the extruder. | |
To Use: | |
* Check your printer measurements with calipers. | |
My values are below. | |
* Download OpenSCAD and open this file. | |
* Make sure your ADXL345 measurments | |
match the ones below. | |
* Render the model with <F6> | |
or Design -> Render from the menu | |
(should only take a second or two). | |
* Export the file as STL with <F7> | |
or File -> Export -> Export as STL | |
* Send to your slicer. | |
* Drink at least one beer (mandatory). | |
* The print is tiny so if you get it wrong, | |
try it again. | |
Created June 23, 2021 | |
Modified March 2, 2022 | |
*/ | |
err = 0.2; // error allowance | |
// HILETGO VALS | |
hi_sensor_w = 20.5; // adxl345 pcb width -- HILETGO | |
hi_sensor_l = 15; // adxl345 pcb height -- HILETGO | |
hi_sensor_flat_l = 12.5; // length of flat area (pcb width - header width) -- HILETGO | |
hi_sensor_raw_hole_d = 3.2; // raw mounting hole diameter -- HILETGO | |
hi_sensor_hole_dist = 15; // distance between centers of the two screw holves -- HILETGO | |
// ADAFRUIT VALS -- EXPERIMENTAL | |
ada_sensor_w = 25; // adxl345 pcb width -- ADAFRUIT | |
ada_sensor_l = 19; // adxl345 pcb height -- ADAFRUIT | |
ada_sensor_flat_l = 12.5; // length of flat area (pcb width - header width) -- ADAFRUIT | |
ada_sensor_raw_hole_d = 2.5; // raw mounting hole diameter -- ADAFRUIT | |
ada_sensor_hole_dist = ada_sensor_w * 0.8; // distance between centers of the two screw holes -- ADAFRUIT | |
pcb_t = 1.1; // sensor pcb thickness | |
// x axis (attaches to x gantry) | |
// ender_frame_t = 2.3 + err; // thickness of ender3v2 x gantry | |
ender_frame_t = 2.25 + err; // thickness of ender3v2 x gantry | |
ender_frame_w = 15; // width of free space on ender frame left of extruder | |
ender_frame_l = 5; // free space on frame above screws | |
// y axis (heated printing bed + glass) | |
bed_and_glass_t = 4.1; | |
// y axis (thickness of heated printing bed + powdered PEI sheet) | |
bed_and_pei_t = 6.55 + err; | |
bed_mount_t = bed_and_pei_t; | |
bed_mount_l = 8.0; // slightly longer | |
bracket_wall_t = 1.5; // bracket wall thickness (printed object) | |
$fs =0.2; // precision of curved parts | |
module bracket(clamp_gap_w, clamp_l, board_type="HILETGO", have_screws=true) { | |
dims = (board_type == "HILETGO") ? | |
[hi_sensor_w, hi_sensor_l, hi_sensor_flat_l, hi_sensor_raw_hole_d, hi_sensor_hole_dist] : | |
[ada_sensor_w, ada_sensor_l, ada_sensor_flat_l, ada_sensor_raw_hole_d, ada_sensor_hole_dist]; | |
sensor_w = dims[0]; | |
sensor_l = dims[1]; | |
sensor_flat_l = dims[2]; | |
sensor_hole_d = dims[3] + err; | |
sensor_cyl_d = dims[3]; | |
sensor_cyl_h = 3; // cylinder peg height | |
sensor_hole_dist = dims[4]; | |
bracket_w = sensor_w; | |
bracket_l = clamp_l + bracket_wall_t; | |
bracket_total_t = clamp_gap_w + 2 * bracket_wall_t; | |
left_hole_x_offset = (sensor_w - sensor_hole_dist) / 2; | |
right_hole_x_offset = left_hole_x_offset + sensor_hole_dist; | |
hole_z_offset = sensor_hole_d/2 + 0.8; | |
translate([0, 0, bracket_l]) { | |
rotate([-90, 0, 0]) { // orient flat on bed | |
difference() { | |
union() { | |
// total bracket block | |
color("red") | |
cube([bracket_w, bracket_l, bracket_total_t]); | |
// flat rect. against sensor back | |
color("brown") | |
translate([0, clamp_l, bracket_total_t]) | |
cube([bracket_w, bracket_wall_t, sensor_flat_l]); | |
if (have_screws == false) { | |
// we have no screws -- extruding mounting pegs | |
color("blue") { | |
translate([left_hole_x_offset, clamp_l + bracket_wall_t, bracket_total_t + hole_z_offset]) | |
rotate([90, 0, 0]) | |
cylinder(d=sensor_cyl_d, h=bracket_wall_t + sensor_cyl_h); | |
translate([right_hole_x_offset, clamp_l + bracket_wall_t, bracket_total_t + hole_z_offset]) | |
rotate([90, 0, 0]) | |
cylinder(d=sensor_cyl_d, h=bracket_wall_t + sensor_cyl_h); | |
} | |
} | |
} | |
// space for ender frame | |
color("green") | |
translate([0, 0, bracket_wall_t]) | |
cube([bracket_w, clamp_l, clamp_gap_w]); | |
if (have_screws == true) { | |
// screw holes | |
color("blue") { | |
translate([left_hole_x_offset, clamp_l + bracket_wall_t, bracket_total_t + hole_z_offset]) | |
rotate([90, 0, 0]) | |
cylinder(d=sensor_hole_d, h=bracket_wall_t); | |
translate([right_hole_x_offset, clamp_l + bracket_wall_t, bracket_total_t + hole_z_offset]) | |
rotate([90, 0, 0]) | |
cylinder(d=sensor_hole_d, h=bracket_wall_t); | |
} | |
} | |
} | |
} | |
} | |
} | |
module render_brackets(bt="HILETGO", hs=true, draw_x_bracket=true, draw_y_bracket=true) { | |
// x axis | |
if (draw_x_bracket) { | |
bracket(ender_frame_t, ender_frame_l, board_type=bt, have_screws=hs); | |
} | |
// y axis | |
if (draw_y_bracket) { | |
x_off = (bt == "HILETGO") ? hi_sensor_w + 5 : ada_sensor_w + 5; | |
translate([x_off, 0, 0]) { | |
bracket(bed_mount_t, bed_mount_l, board_type=bt, have_screws=hs); | |
} | |
} | |
} | |
render_brackets(bt="HILETGO", hs=true, draw_x_bracket=true, draw_y_bracket=true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment