summaryrefslogtreecommitdiff
path: root/another.scad
Unidiff
Diffstat (limited to 'another.scad') (more/less context) (ignore whitespace changes)
-rw-r--r--another.scad4
1 files changed, 2 insertions, 2 deletions
diff --git a/another.scad b/another.scad
index 116344e..461dc26 100644
--- a/another.scad
+++ b/another.scad
@@ -1,150 +1,150 @@
1draft=true; 1draft=true;
2layer_height=0.2; extrusion_width=0.4; 2layer_height=0.2; extrusion_width=0.4;
3epsilon=0.01; 3epsilon=0.01;
4$fs=0.0125; 4$fs=0.0125;
5 5
6use <pushfittery.scad>; 6use <pushfittery.scad>;
7include <pushfit_data.scad>; 7include <pushfit_data.scad>;
8include <pulley_data.scad>; 8include <pulley_data.scad>;
9 9
10module the_extruder( 10module the_extruder(
11 // motor properties 11 // motor properties
12 gearbox_d = 36, 12 gearbox_d = 36,
13 mount_d = 28, // the distance between opposite mounting holes 13 mount_d = 28, // the distance between opposite mounting holes
14 mounthole_depth = 5, 14 mounthole_depth = 5,
15 mounthole_min_depth = 3, mounthole_max_depth = 4, 15 mounthole_min_depth = 3, mounthole_max_depth = 4,
16 protrusion_d = 22, protrusion_h = 2.2, // the dimensions of the protrusion on top of gearbox 16 protrusion_d = 22, protrusion_h = 2.2, // the dimensions of the protrusion on top of gearbox
17 bore_d = 8, bore_l = 17.6, 17 bore_d = 8, bore_l = 17.6,
18 bore_dd = 7, 18 bore_dd = 7,
19 // pulley properties 19 // pulley properties
20 pulley = pulley_e3d, 20 pulley = pulley_e3d,
21 pulley_elevation = 1, // pulley elevation above the protrusion 21 pulley_elevation = 1, // pulley elevation above the protrusion
22 // idler properties 22 // idler properties
23 idler_d = 9.5, idler_h = 4, idler_id = 3,// idler dimensions: outer and inner diameters and height 23 idler_d = 9.5, idler_h = 4, idler_id = 3,// idler dimensions: outer and inner diameters and height
24 // spring properties 24 // spring properties
25 spring_d = 10, spring_lc = 9.6, // spring diameter and compressed length 25 spring_d = 10, spring_lc = 9.6, // spring diameter and compressed length
26 // filament path properties 26 // filament path properties
27 filament_d = 1.75, 27 filament_d = 1.75,
28 filament_path_d = 2, 28 filament_path_d = 2,
29 filament_guide_d = 4, // PTFE filament guide diameter 29 filament_guide_d = 4, // PTFE filament guide diameter
30 // knob properties 30 // knob properties
31 knob_h = 10, 31 knob_h = 10,
32 knob_bore_l = 4, 32 knob_bore_l = 4,
33 knob_indent_d = 4, 33 knob_indent_d = 4,
34 knob_indents = 12, 34 knob_indents = 12,
35 // spring tensioner 35 // spring tensioner
36 st_nut_d = 9, st_nut_h = 4, 36 st_nut_d = 9, st_nut_h = 4,
37 st_screw_d = 5, 37 st_screw_d = 5,
38 st_thickshell = 8*extrusion_width, st_thinshell = 2*extrusion_width, 38 st_thickshell = 8*extrusion_width, st_thinshell = 2*extrusion_width,
39 st_split_w = 4*extrusion_width, 39 st_split_w = 4*extrusion_width,
40 40
41 // screw it 41 // screw it
42 mount_screw_d = 3.1, mount_screw_l = 20, 42 mount_screw_d = 3.1, mount_screw_l = 20,
43 mount_screwhead_d=6, mount_screwhead_h=3, 43 mount_screwhead_d=6, mount_screwhead_h=3,
44 idler_screw_d = 3, 44 idler_screw_d = 3,
45 idler_screwhead_d=6, idler_screwhead_h=3, 45 idler_screwhead_d=6, idler_screwhead_h=3,
46 46
47 pf = pushfit_metal, 47 pf = pushfit_metal,
48 pf_shell = max(3*layer_height,3*extrusion_width), 48 pf_shell = max(3*layer_height,3*extrusion_width),
49 pf_smooth = true, 49 pf_smooth = true,
50 50
51 // empty spaces 51 // empty spaces
52 idler_travel = 3, // how far should idler travel when pressed 52 idler_travel = 3, // how far should idler travel when pressed
53 idler_clearance=1, 53 idler_clearance=.5,
54 pulley_small_d_clearance=0.5, 54 pulley_small_d_clearance=.5,
55 lever_v_clearance=.7, // vertical clearance for the lever 55 lever_v_clearance=.7, // vertical clearance for the lever
56 spring_d_clearance=1, 56 spring_d_clearance=1,
57 protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion 57 protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion
58 protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion 58 protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion
59 mount_screw_d_tolerance=.4, 59 mount_screw_d_tolerance=.4,
60 idler_v_tolerance=.5, 60 idler_v_tolerance=.5,
61 knob_bore_d_tolerance=.6, 61 knob_bore_d_tolerance=.6,
62 st_nut_h_tolerance=.2, 62 st_nut_h_tolerance=.2,
63 st_nut_d_tolerance=.2,/* TODO: make it st_nut_w_tolerance */ 63 st_nut_d_tolerance=.2,/* TODO: make it st_nut_w_tolerance */
64 st_screw_d_tolerance=.5, 64 st_screw_d_tolerance=.5,
65 st_split_w_tolerance = .3, 65 st_split_w_tolerance = .3,
66 66
67 min_z_shell = 4*layer_height, // the very minimal shell thickness along z-axis. 67 min_z_shell = 4*layer_height, // the very minimal shell thickness along z-axis.
68 min_xy_shell = 2*extrusion_width, 68 min_xy_shell = 2*extrusion_width,
69 69
70 what="lever", // lever|body|knob|springpad|* 70 what="lever", // lever|body|knob|springpad|*
71 left=false, 71 left=false,
72 vitamins = true, 72 vitamins = true,
73 bridges = true, 73 bridges = true,
74 debug = false, 74 debug = false,
75 label = "another" 75 label = "another"
76) { 76) {
77 fnd = 2*PI; fnr = 2*fnd; 77 fnd = 2*PI; fnr = 2*fnd;
78 function lu(m,k) = m[search([k],m)[0]][1]; 78 function lu(m,k) = m[search([k],m)[0]][1];
79 79
80 pulley_d = lu(pulley,"d"); 80 pulley_d = lu(pulley,"d");
81 pulley_h = lu(pulley,"h"); 81 pulley_h = lu(pulley,"h");
82 teeth_elevation = lu(pulley,"fe"); 82 teeth_elevation = lu(pulley,"fe");
83 filament_offset = lu(pulley,"g")+filament_d/2; 83 filament_offset = lu(pulley,"g")+filament_d/2;
84 pulley_d_clearance = lu(pulley,"ssrc")*2; 84 pulley_d_clearance = lu(pulley,"ssrc")*2;
85 85
86 idler_filament_offset = filament_path_d/2; 86 idler_filament_offset = filament_path_d/2;
87 lever_shell = mount_screwhead_h+0.5; 87 lever_shell = mount_screwhead_h+0.5;
88 lever_thickness=max(spring_d+spring_d_clearance+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell); 88 lever_thickness=max(spring_d+spring_d_clearance+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell);
89 lsd = idler_d-idler_clearance*2; // the diameter of lever thingie 89 lsd = idler_d-idler_clearance*2; // the diameter of lever thingie
90 longwing=(mount_d+mount_screw_d+mount_screw_d_tolerance+spring_d+spring_d_clearance)/2+min_xy_shell; 90 longwing=(mount_d+mount_screw_d+mount_screw_d_tolerance+spring_d+spring_d_clearance)/2+min_xy_shell;
91 shortwing = let(a=mount_d/2,c=(pulley_d+idler_d)/2/sqrt(2)) 91 shortwing = let(a=mount_d/2,c=(pulley_d+idler_d)/2/sqrt(2))
92 sqrt(c*c+pow(a-c,2)); 92 sqrt(c*c+pow(a-c,2));
93 longwing_travel = idler_travel*longwing/shortwing; 93 longwing_travel = idler_travel*longwing/shortwing;
94 h_ = (pulley_d+idler_d)/(2*sqrt(2)); 94 h_ = (pulley_d+idler_d)/(2*sqrt(2));
95 ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) ); 95 ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) );
96 spring_dl = idler_travel*longwing/ri; 96 spring_dl = idler_travel*longwing/ri;
97 // finger and spring support 97 // finger and spring support
98 fsw = gearbox_d-(gearbox_d-mount_d)/2-max(spring_lc,longwing_travel+(gearbox_d-mount_d)/2); 98 fsw = gearbox_d-(gearbox_d-mount_d)/2-max(spring_lc,longwing_travel+(gearbox_d-mount_d)/2);
99 99
100 mount_min_depth = mounthole_min_depth ? mounthole_min_depth : mounthole_depth-1; 100 mount_min_depth = mounthole_min_depth ? mounthole_min_depth : mounthole_depth-1;
101 mount_max_depth = mounthole_max_depth ? mounthole_max_depth : mounthole_depth+1; 101 mount_max_depth = mounthole_max_depth ? mounthole_max_depth : mounthole_depth+1;
102 filament_elevation=protrusion_h+pulley_elevation+teeth_elevation; 102 filament_elevation=protrusion_h+pulley_elevation+teeth_elevation;
103 ls_z = filament_elevation; // leverspace mid-z 103 ls_z = filament_elevation; // leverspace mid-z
104 ls_h = lever_thickness+lever_v_clearance; // leverspace height 104 ls_h = lever_thickness+lever_v_clearance; // leverspace height
105 mount_depth = mount_screw_l - (ls_z+ls_h/2+min_z_shell); 105 mount_depth = mount_screw_l - (ls_z+ls_h/2+min_z_shell);
106 body_h = max(protrusion_h+bore_l,mount_screw_l-mount_depth+mount_screwhead_h+min_z_shell,ls_z*2); 106 body_h = max(protrusion_h+bore_l,mount_screw_l-mount_depth+mount_screwhead_h+min_z_shell,ls_z*2);
107 echo("mount depth",mount_depth); 107 echo("mount depth",mount_depth);
108 108
109 module teardrop(r,d,h,center=false,angle=45) { 109 module teardrop(r,d,h,center=false,angle=45) {
110 dd = d ? d : (2*r); 110 dd = d ? d : (2*r);
111 $fn = dd*fnd; 111 $fn = dd*fnd;
112 cylinder(d=dd,h=h,center=center); 112 cylinder(d=dd,h=h,center=center);
113 if(angle>0) translate([0,0,center?-h/2:0]) 113 if(angle>0) translate([0,0,center?-h/2:0])
114 rotate([0,0,angle]) 114 rotate([0,0,angle])
115 cube(size=[d/2,d/2,h]); 115 cube(size=[d/2,d/2,h]);
116 } 116 }
117 117
118 module mirrorleft() { 118 module mirrorleft() {
119 mirror([left?0:1,0,0]) children(); 119 mirror([left?0:1,0,0]) children();
120 } 120 }
121 module place_idler() { 121 module place_idler() {
122 rotate([0,0,45]) 122 rotate([0,0,45])
123 translate([(pulley_d+idler_d)/2,0,0]) 123 translate([(pulley_d+idler_d)/2,0,0])
124 children(); 124 children();
125 } 125 }
126 module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) { 126 module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) {
127 if(depth) { 127 if(depth) {
128 hh = (-4*pow(depth,2)+pow(d,2))/(8*depth); 128 hh = (-4*pow(depth,2)+pow(d,2))/(8*depth);
129 rr = depth+hh; 129 rr = depth+hh;
130 translate([0,0,hh]) sphere(r=rr,$fn=fnr*rr); 130 translate([0,0,hh]) sphere(r=rr,$fn=fnr*rr);
131 }else if(r) { 131 }else if(r) {
132 hh=sqrt(pow(r,2)-pow(d,2)/4); 132 hh=sqrt(pow(r,2)-pow(d,2)/4);
133 translate([0,0,hh]) sphere(r=r,$fn=fnr*r); 133 translate([0,0,hh]) sphere(r=r,$fn=fnr*r);
134 } 134 }
135 } 135 }
136 136
137 % if(vitamins) mirrorleft() { 137 % if(vitamins) mirrorleft() {
138 translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60); 138 translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60);
139 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) 139 for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0])
140 cylinder(d=mount_screw_d,h=20,$fn=30); 140 cylinder(d=mount_screw_d,h=20,$fn=30);
141 translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30); 141 translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30);
142 translate([0,0,protrusion_h]) { 142 translate([0,0,protrusion_h]) {
143 difference() { 143 difference() {
144 cylinder(d=bore_d,h=bore_l,$fn=30); 144 cylinder(d=bore_d,h=bore_l,$fn=30);
145 translate([-bore_d/2-1,bore_dd-bore_d/2,-1]) 145 translate([-bore_d/2-1,bore_dd-bore_d/2,-1])
146 cube([bore_d+2,bore_d/2,bore_l+2]); 146 cube([bore_d+2,bore_d/2,bore_l+2]);
147 } 147 }
148 translate([0,0,pulley_elevation]) { 148 translate([0,0,pulley_elevation]) {
149 cylinder(d=pulley_d,h=pulley_h,$fn=30); 149 cylinder(d=pulley_d,h=pulley_h,$fn=30);
150 translate([0,0,teeth_elevation]) { 150 translate([0,0,teeth_elevation]) {