Skip to content
Browse files

Experimental z-motor-mounts

  • Loading branch information...
1 parent b83c70d commit b1dd22accaefbf49b79b48276fe234e9a131a37e @colah colah committed Jan 23, 2011
Showing with 141 additions and 0 deletions.
  1. +92 −0 new-z-motor-mount.scad
  2. +49 −0 new2-z-motor-mount.scad
View
92 new-z-motor-mount.scad
@@ -0,0 +1,92 @@
+include <configuration.scad>
+include <common.scad>
+
+
+//Slow code is slow!
+
+
+module roundedBox(size, radius, center=false, sidesonly=false)
+{
+ //By Marius Kintel, BSD licensed; some minor mods by colah
+ rot = [ [0,0,0], [90,0,90], [90,90,0] ];
+ if (sidesonly) {
+ cube(size - [2*radius,0,0], true);
+ cube(size - [0,2*radius,0], true);
+ for (x = [radius-size[0]/2, -radius+size[0]/2],
+ y = [radius-size[1]/2, -radius+size[1]/2]) {
+ translate([x,y,0]) cylinder(r=radius, h=size[2], center=true);
+ }
+ }
+ else {
+ cube([size[0], size[1]-radius*2, size[2]-radius*2], center=true);
+ cube([size[0]-radius*2, size[1], size[2]-radius*2], center=true);
+ cube([size[0]-radius*2, size[1]-radius*2, size[2]], center=true);
+
+ for (axis = [0:2]) {
+ for (x = [radius-size[axis]/2, -radius+size[axis]/2],
+ y = [radius-size[(axis+1)%3]/2, -radius+size[(axis+1)%3]/2]) {
+ rotate(rot[axis])
+ translate([x,y,0])
+ cylinder(h=size[(axis+2)%3]-2*radius, r=radius, center=true);
+ }
+ }
+ for (x = [radius-size[0]/2, -radius+size[0]/2],
+ y = [radius-size[1]/2, -radius+size[1]/2],
+ z = [radius-size[2]/2, -radius+size[2]/2]) {
+ translate([x,y,z]) sphere(radius);
+ }
+ }
+}
+
+module torus(r1,r2,strech=[1,1,1]){
+ //By Christopher Olah, based on example from wikibooks. BSD.
+ rotate_extrude()
+ translate([r1, 0, 0])
+ scale(strech)
+ circle(r2);
+}
+module roundedCylinder(h,r,r2){
+ //By Christopher Olah. BSD.
+ cylinder(r=r-r2,h=h);
+ translate([0,0,r2]){
+ cylinder(r=r,h=h-r2*2);
+ for (z=[0,2]) translate([0,0,z*(h/2-r2)])
+ rotate_extrude() translate([r-r2,0,0]) circle(r2);
+ }
+}
+
+
+module diagonal_rod(grip = true) {
+ if (grip) for (y=[-1,1]) translate([0,15*y,0]) rotate([(90-vert_angle)*y,0,0]) translate([0,0,-50]) cylinder (h=100,r=4.0);
+ if (!grip) for (y=[-1,1]) translate([0,15*y,0]) rotate([(90-vert_angle)*y,0,0]) translate([0,0,-50]) cylinder (h=100,r=4.2);
+}
+
+module diagonal_rod_cube (slide = 0, size = [16,16,10]) {
+ for (y=[-1,1]) translate([0,15*y,0]) rotate([(90-vert_angle)*y,0,0]) translate([0,0,slide]) cube(size=size,center=true);
+}
+
+module diagonal_rod_round_cube (slide = 0, size = [16,16,10]) {
+ for (y=[-1,1]) translate([0,15*y,0]) rotate([(90-vert_angle)*y,0,0]) translate([0,0,slide]) roundedBox(size=size,radius=2,center=true);
+}
+
+vert_angle=60;
+
+difference(){
+ union(){
+ translate([-20,0,0]) roundedBox(size = [40,64,16], radius=2, center = true);
+ translate([-20,0,-3]) roundedBox(size = [40,76,10], radius=2, center = true);
+ translate([-9,0,-4.5]) roundedBox(size = [62,43,7], radius=2, center = true);
+ for (y=[-1,1]) translate ([-40,30*y,0]) rotate([0,90,0]) roundedCylinder(h =40, r=8, r2=2);
+ //translate ([26.5,0,-8]) roundedCylinder(h=16,r=8,r2=2);
+ translate ([-32,0,0]) diagonal_rod_round_cube(slide=7);
+ }
+ // Motor sits in this
+ translate([-2.1,0,3.1]) motor();
+ //The vertical rod goes through here
+ translate([-2,0,0]) rotate([0,0,-180]) translate ([0,0,-50]) vertical_rods();
+
+ //Diagonal rod and nut space
+ translate ([-32,0,0]) diagonal_rod();
+ for (y=[-1,1]) translate([-50,30*y,0]) rotate([0,90,0]) cylinder(h = 100, r=4.5);
+
+}
View
49 new2-z-motor-mount.scad
@@ -0,0 +1,49 @@
+include <configuration.scad>
+include <common.scad>
+
+module motor() {
+ //This is (essentially) what ever was being used in z-motor-mount orriginaly.
+ // Should be rewriten for NEMA compliance, to match the NEMA_version var.
+ // Motor sits in this
+ cube(size = [43,43,10], center = true);
+ // And goes through this
+ translate([0,0,-8]) cylinder(h = 10, r=12);
+ translate([0,0,-25]) cylinder(h = 30, r=5);
+ translate([0,0,-25]) cylinder(h = 10, r=14.5);
+ //And the screws go through here
+ for (y=[-1,1],x=[-1,1]) translate([15*x,15*y,-5]){
+ cylinder(r=1.7,h=10,center=true);
+ translate([0,0,-8.2])cylinder(r=2.6,h=12,center=true);
+ }
+}
+
+module diagonal_rod(grip = true) {
+ for (y=[-1,1]) translate([0,28*y,0]) rotate([(90-vert_angle)*y,0,0]) translate([0,0,-50]) cylinder (h=100,r=4.2);
+}
+
+module diagonal_rod_cyl (r=8,slide = 0, h=10) {
+ for (y=[-1,1]) translate([0,28*y,0]) rotate([(90-vert_angle)*y,0,0]) translate([0,0,slide]) cylinder(r=r,h=h,center=true);
+}
+
+
+vert_angle=60;
+
+difference() {
+ union(){
+ for (y=[-1,1]) translate ([0,17.5*y,-6.2]) rotate([0,90,0]) {
+ cylinder(h =43, r=7,center=true);
+ translate([-5,0,0]) cube([5,11,43],center=true);
+
+ }
+ translate([-15.5,0,0]) cube([12,40,3],center=true);
+ translate([-18.6,0,-10]) cylinder(r=7,h=10);
+ translate ([-17.5,0,0]) diagonal_rod_cyl(slide=-5.5);
+ translate ([-17.5,0,0]) for (y=[-1,1]) translate([0,24*y,-8]) cube([9,3,8],center=true);
+ }
+ translate([0,0,6]) motor();
+ for (y=[-1,1]) translate ([0,17.5*y,-6.2]) rotate([0,90,0]) cylinder(h =60, r=4.7,center=true);
+ translate([-18.6,0,-21]) cylinder(r=4.5,h=20);
+ translate ([-17.5,0,0]) diagonal_rod();
+ translate([0,0,3.5]) cube([100,100,5],center=true);
+ translate ([-17.5,0,0]) diagonal_rod_cyl(slide=0,h=5);
+}

0 comments on commit b1dd22a

Please sign in to comment.
Something went wrong with that request. Please try again.