// Based on Thing #14742: http://www.thingiverse.com/thing:14742
// By Josiah Ritchie <josiah@josiahritchie.com>
// For mounting a Panucatt X3 controller in holes for an Arduino Mega/RAMPS
// includes extra
// Some basic settings
standoff_inner_radius = 1.75; // How big a hole should be in the middle of the standoff?
standoff_wall_thickness = 3; // How thick should the walls of the radius be?
height_x3 = 15; // How tall should the X3 standoffs be?
height_am = 3; // How tall should the Arduino Mega standoffs be?
x3_standoffs(height_x3,standoff_wall_thickness,standoff_inner_radius);
translate([10,8,0])arduino_mega_standoffs(height_am,standoff_wall_thickness,standoff_inner_radius);
// I'm working on a cable mount, this is a work in progress
translate([-10,-10,0])ctmount(5,2,2);
///////////////
// Functions
///////////////
// Make a cable-tie mount
module ctmount(height,thickness,inner_radius) {
// Inner radius + wall thickness = outer radius of the standoff
outer_radius = inner_radius + thickness;
rotate(a=[0,90,90]) {
difference() {
cylinder(h=height,r1=outer_radius,r2=outer_radius,$fn=20);
cylinder(h=height,r1=inner_radius,r2=inner_radius,$fn=20);
}
}
translate([0,inner_radius,-outer_radius])rotate(a=[0,90,90]) {
difference() {
cube(size = [outer_radius+(outer_radius/2),outer_radius*2,outer_radius], center = true, $fn=20);
cube(size = [inner_radius+(outer_radius/2),inner_radius*2,inner_radius*2], center = true, $fn=20);
}
}
}
// Make a basic standoff
module standoff(height,thickness,inner_radius) {
// Inner radius + wall thickness = outer radius of the standoff
outer_radius = inner_radius + thickness;
// Make the standoff cylinder and remove the hole in the center
difference() {
cylinder(h=height,r1=outer_radius,r2=outer_radius,$fn=20);
cylinder(h=height,r1=inner_radius,r2=inner_radius,$fn=20);
}
}
// Make 4 standoffs and space them appropriately for an Arduino Mega
module arduino_mega_standoffs(up,out,in) {
// Arduino Mega mounting holes are at [0,0],[81.5,0],[1,48],[75,48]
bl = [0,0,0]; //bottomleft
br = [81.5,0,0]; //bottomright
tl = [1,48,0]; //topleft
tr = [75,48,0]; //topright
standoff(up,out,in);
translate(tl)standoff(up,out,in);
translate(br)standoff(up,out,in);
translate(tr)standoff(up,out,in);
// Support structure to connect posts for Arduino
$fn=100;
linear_extrude(height=1.3)barbell([tr[0],tr[1]],[tl[0],tl[1]],6,6,230,230);
linear_extrude(height=1.3)barbell([br[0],br[1]],[bl[0],bl[1]],6,6,240,240);
}
// make 4 standoffs and space them appropriately for a Panucatt X3
module x3_standoffs(up,out,in){
bl = [0,0,0]; //bottomleft
br = [101.6,0,0]; //bottomright
tl = [0,64.3,0]; //topleft
tr = [101.6,64.3,0]; //topright
// X3 holes are in a square 4"x2.53" (101.6mm x 64.3mm) on center
standoff(up,out,in);
translate(br)standoff(up,out,in);
translate(tr)standoff(up,out,in);
translate(tl)standoff(up,out,in);
// Support structure to connect posts
$fn=100;
linear_extrude(height=1.3)barbell([bl[0],bl[1]],[br[0],br[1]],6,6,2000,230);
linear_extrude(height=1.3)barbell([tl[0],tl[1]],[tr[0],tr[1]],6,6,240,1500);
linear_extrude(height=1.3)barbell([br[0],br[1]],[tr[0],tr[1]],6,6,150,150);
linear_extrude(height=1.3)barbell([tl[0],tl[1]],[bl[0],bl[1]],6,6,150,150);
}
module barbell (x1,x2,r1,r2,r3,r4)
{
x3=triangulate (x1,x2,r1+r3,r2+r3);
x4=triangulate (x2,x1,r2+r4,r1+r4);
render()
difference ()
{
union()
{
translate(x1)
circle (r=r1);
translate(x2)
circle(r=r2);
polygon (points=[x1,x3,x2,x4]);
}
translate(x3)
circle(r=r3,$fa=5);
translate(x4)
circle(r=r4,$fa=5);
}
}
function triangulate (point1, point2, length1, length2) =
point1 +
length1*rotated(
atan2(point2[1]-point1[1],point2[0]-point1[0])+
angle(distance(point1,point2),length1,length2));
function distance(point1,point2)=
sqrt((point1[0]-point2[0])*(point1[0]-point2[0])+
(point1[1]-point2[1])*(point1[1]-point2[1]));
function angle(a,b,c) = acos((a*a+b*b-c*c)/(2*a*b));
function rotated(a)=[cos(a),sin(a),0];
#ifdef AZTEEG_X3
#define SDSUPPORT false //turning this off due to an error it causes in compiling see: http://code.google.com/p/sdfatlib/issues/detail?id=39
#define SDCARDDETECTINVERTED false
#define SDCARDDETECT -1
#define FAN_PIN 17 // Originally 4, but changed to use expansion board
#define FAN2_PIN 16 // Originall 5, but changed to use expansion board
#define LIGHT_PIN 6
#define BEEPER_PIN 33 // Activate beeper on extension shield
#define BEEPER_TYPE 1
#endif
#define ENDSTOP_PULLUP_X_MIN true
#define ENDSTOP_PULLUP_Y_MIN true
#define ENDSTOP_PULLUP_Z_MIN true
#define ENDSTOP_X_MIN_INVERTING true
#define ENDSTOP_Y_MIN_INVERTING true
#define ENDSTOP_Z_MIN_INVERTING true
#define X_ENABLE_ON 0
#define Y_ENABLE_ON 0
#define Z_ENABLE_ON 0
#define INVERT_X_DIR false
#define INVERT_Y_DIR false
#define INVERT_Z_DIR false
#define X_HOME_DIR -1
#define Y_HOME_DIR 1
#define Z_HOME_DIR -1
#define ENDSTOP_X_BACK_MOVE 5
#define ENDSTOP_Y_BACK_MOVE 5
#define ENDSTOP_Z_BACK_MOVE 2
#define ENDSTOP_X_RETEST_REDUCTION_FACTOR 2
#define ENDSTOP_Y_RETEST_REDUCTION_FACTOR 2
#define ENDSTOP_Z_RETEST_REDUCTION_FACTOR 2
#define ENDSTOP_X_BACK_ON_HOME 1
#define ENDSTOP_Y_BACK_ON_HOME 14
#define ENDSTOP_Z_BACK_ON_HOME 0
#define X_MIN_POS 0
#define Y_MIN_POS 0
#define Z_MIN_POS 0
#define Z_BACKLASH 0
#define X_BACKLASH 0
#define Y_BACKLASH 0
#ifdef AZTEEG_X3
#define SDSUPPORT false //turning this off due to an error it causes in compiling see: http://code.google.com/p/sdfatlib/issues/detail?id=39
#define SDCARDDETECTINVERTED false
#define SDCARDDETECT -1
#define FAN_PIN 17 // Originally 4, but changed to use expansion board
#define FAN2_PIN 16 // Originall 5, but changed to use expansion board
#define LIGHT_PIN 6
#define BEEPER_PIN 33 // Activate beeper
#define BEEPER_TYPE 1
// I have my min and max pins reversed on the Azteeg X and Z axis so that I could add a connector to my endstops on the back, where I could easily solder the connectors on without desoldering. I don't use the max, just the mins so this provides that option and keeps my cabling clean.
#define X_MIN_PIN 2
#define X_MAX_PIN 3
#define Y_MIN_PIN 14
#define Y_MAX_PIN 15
#define Z_MIN_PIN 19
#define Z_MAX_PIN 18
#endif
Users browsing this forum: No registered users and 28 guests