-rw-r--r-- | another.scad | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/another.scad b/another.scad index 6bb0664..ee7a0ff 100644 --- a/another.scad +++ b/another.scad | |||
@@ -1,147 +1,147 @@ | |||
1 | draft=true; | 1 | draft=true; |
2 | layer_height=0.2; extrusion_width=0.4; | 2 | layer_height=0.2; extrusion_width=0.4; |
3 | epsilon=0.01; | 3 | epsilon=0.01; |
4 | $fs=0.0125; | 4 | $fs=0.0125; |
5 | 5 | ||
6 | use <pushfittery.scad>; | 6 | use <pushfittery.scad>; |
7 | include <pushfit_data.scad>; | 7 | include <pushfit_data.scad>; |
8 | include <pulley_data.scad>; | 8 | include <pulley_data.scad>; |
9 | 9 | ||
10 | module the_extruder( | 10 | module 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 = 10, idler_h = 4, idler_id = 3,// idler dimensions: outer and inner diameters and height | 23 | idler_d = 10, 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_indent_d = 4, | 32 | knob_indent_d = 4, |
33 | knob_indents = 12, | 33 | knob_indents = 12, |
34 | knob_v_clearance = 1, | 34 | knob_v_clearance = 1, |
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, st_screw_l = 16, | 37 | st_screw_d = 5, st_screw_l = 16, |
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 | 49 | ||
50 | // empty spaces | 50 | // empty spaces |
51 | idler_travel = 3, // how far should idler travel when pressed | 51 | idler_travel = 1.75*2, // how far should idler travel when pressed |
52 | idler_clearance=.5, | 52 | idler_clearance=.5, |
53 | pulley_small_d_clearance=.5, | 53 | pulley_small_d_clearance=.5, |
54 | lever_v_clearance=.7, // vertical clearance for the lever | 54 | lever_v_clearance=.7, // vertical clearance for the lever |
55 | spring_d_clearance=1, | 55 | spring_d_clearance=1, |
56 | protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion | 56 | protrusion_tolerance_h=.5, // horizontal tolerance for the motor protrusion |
57 | protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion | 57 | protrusion_tolerance_v=.5, // vertical tolerance for the motor protrusion |
58 | mount_screw_d_tolerance=.4, | 58 | mount_screw_d_tolerance=.4, |
59 | idler_v_tolerance=.5, | 59 | idler_v_tolerance=.5, |
60 | knob_bore_d_tolerance=.8, | 60 | knob_bore_d_tolerance=.8, |
61 | st_nut_h_tolerance=.2, | 61 | st_nut_h_tolerance=.2, |
62 | st_nut_d_tolerance=.2,/* TODO: make it st_nut_w_tolerance */ | 62 | st_nut_d_tolerance=.2,/* TODO: make it st_nut_w_tolerance */ |
63 | st_screw_d_tolerance=.5, | 63 | st_screw_d_tolerance=.5, |
64 | st_split_w_tolerance = .3, | 64 | st_split_w_tolerance = .3, |
65 | 65 | ||
66 | min_z_shell = 4*layer_height, // the very minimal shell thickness along z-axis. | 66 | min_z_shell = 4*layer_height, // the very minimal shell thickness along z-axis. |
67 | min_xy_shell = 2*extrusion_width, | 67 | min_xy_shell = 2*extrusion_width, |
68 | 68 | ||
69 | body_label = "another", body_label_thickness = layer_height, | 69 | body_label = "another", body_label_thickness = layer_height, |
70 | knob_label = "another", knob_label_thickness = 2*layer_height, knob_label_size=undef, | 70 | knob_label = "another", knob_label_thickness = 2*layer_height, knob_label_size=undef, |
71 | 71 | ||
72 | what="lever", // lever|body|knob|springpad|* | 72 | what="lever", // lever|body|knob|springpad|* |
73 | left=false, | 73 | left=false, |
74 | vitamins = true, | 74 | vitamins = true, |
75 | bridges = true, | 75 | bridges = true, |
76 | debug = false, | 76 | debug = false, |
77 | ) { | 77 | ) { |
78 | fnd = 2*PI; fnr = 2*fnd; | 78 | fnd = 2*PI; fnr = 2*fnd; |
79 | function lu(m,k) = m[search([k],m)[0]][1]; | 79 | function lu(m,k) = m[search([k],m)[0]][1]; |
80 | 80 | ||
81 | pulley_d = lu(pulley,"d"); | 81 | pulley_d = lu(pulley,"d"); |
82 | pulley_h = lu(pulley,"h"); | 82 | pulley_h = lu(pulley,"h"); |
83 | teeth_elevation = lu(pulley,"fe"); | 83 | teeth_elevation = lu(pulley,"fe"); |
84 | filament_offset = lu(pulley,"g")+filament_d/2; | 84 | filament_offset = lu(pulley,"g")+filament_d/2; |
85 | pulley_d_clearance = lu(pulley,"ssrc")*2; | 85 | pulley_d_clearance = lu(pulley,"ssrc")*2; |
86 | 86 | ||
87 | sp_ch = st_split_w; | 87 | sp_ch = st_split_w; |
88 | 88 | ||
89 | idler_filament_offset = filament_path_d/2; | 89 | idler_filament_offset = filament_path_d/2; |
90 | lever_shell = mount_screwhead_h+0.5; | 90 | lever_shell = mount_screwhead_h+0.5; |
91 | lever_thickness=max(spring_d+spring_d_clearance+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell); | 91 | lever_thickness=max(spring_d+spring_d_clearance+layer_height*8,idler_h+idler_v_tolerance+2*lever_shell); |
92 | lsd = idler_d-idler_clearance*2; // the diameter of lever thingie | 92 | lsd = idler_d-idler_clearance*2; // the diameter of lever thingie |
93 | longwing=(mount_d+mount_screw_d+mount_screw_d_tolerance+spring_d+spring_d_clearance)/2+min_xy_shell; | 93 | longwing=(mount_d+mount_screw_d+mount_screw_d_tolerance+spring_d+spring_d_clearance)/2+min_xy_shell; |
94 | shortwing = let(a=mount_d/2,c=(pulley_d+idler_d)/2/sqrt(2)) | 94 | shortwing = let(a=mount_d/2,c=(pulley_d+idler_d)/2/sqrt(2)) |
95 | sqrt(c*c+pow(a-c,2)); | 95 | sqrt(c*c+pow(a-c,2)); |
96 | longwing_travel = idler_travel*longwing/shortwing; | 96 | longwing_travel = idler_travel*longwing/shortwing; |
97 | h_ = (pulley_d+idler_d)/(2*sqrt(2)); | 97 | h_ = (pulley_d+idler_d)/(2*sqrt(2)); |
98 | ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) ); | 98 | ri = sqrt( pow(h_,2) + pow(mount_d/2-h_,2) ); |
99 | spring_dl = idler_travel*longwing/ri; | 99 | spring_dl = idler_travel*longwing/ri; |
100 | // finger and spring support width | 100 | // finger and spring support width |
101 | fsw = gearbox_d-(gearbox_d-mount_d)/2-max(spring_lc,longwing_travel+(gearbox_d-mount_d)/2); | 101 | fsw = gearbox_d-(gearbox_d-mount_d)/2-max(spring_lc,longwing_travel+(gearbox_d-mount_d)/2); |
102 | 102 | ||
103 | mount_min_depth = mounthole_min_depth ? mounthole_min_depth : mounthole_depth-1; | 103 | mount_min_depth = mounthole_min_depth ? mounthole_min_depth : mounthole_depth-1; |
104 | mount_max_depth = mounthole_max_depth ? mounthole_max_depth : mounthole_depth+1; | 104 | mount_max_depth = mounthole_max_depth ? mounthole_max_depth : mounthole_depth+1; |
105 | filament_elevation=protrusion_h+pulley_elevation+teeth_elevation; | 105 | filament_elevation=protrusion_h+pulley_elevation+teeth_elevation; |
106 | ls_z = filament_elevation; // leverspace mid-z | 106 | ls_z = filament_elevation; // leverspace mid-z |
107 | ls_h = lever_thickness+lever_v_clearance; // leverspace height | 107 | ls_h = lever_thickness+lever_v_clearance; // leverspace height |
108 | mount_depth = mount_screw_l - (ls_z+ls_h/2+min_z_shell); | 108 | mount_depth = mount_screw_l - (ls_z+ls_h/2+min_z_shell); |
109 | body_h = max(protrusion_h+bore_l,mount_screw_l-mount_depth+mount_screwhead_h+min_z_shell,ls_z*2); | 109 | body_h = max(protrusion_h+bore_l,mount_screw_l-mount_depth+mount_screwhead_h+min_z_shell,ls_z*2); |
110 | echo("mount depth",mount_depth); | 110 | echo("mount depth",mount_depth); |
111 | 111 | ||
112 | pf_offset = mount_d/sqrt(2)/2+mount_screw_d/2+min_xy_shell; | 112 | pf_offset = mount_d/sqrt(2)/2+mount_screw_d/2+min_xy_shell; |
113 | 113 | ||
114 | module teardrop(r,d,h,center=false,angle=45) { | 114 | module teardrop(r,d,h,center=false,angle=45) { |
115 | dd = d ? d : (2*r); | 115 | dd = d ? d : (2*r); |
116 | $fn = dd*fnd; | 116 | $fn = dd*fnd; |
117 | cylinder(d=dd,h=h,center=center); | 117 | cylinder(d=dd,h=h,center=center); |
118 | if(angle>0) translate([0,0,center?-h/2:0]) | 118 | if(angle>0) translate([0,0,center?-h/2:0]) |
119 | rotate([0,0,angle]) | 119 | rotate([0,0,angle]) |
120 | cube(size=[d/2,d/2,h]); | 120 | cube(size=[d/2,d/2,h]); |
121 | } | 121 | } |
122 | 122 | ||
123 | module mirrorleft() { | 123 | module mirrorleft() { |
124 | mirror([left?0:1,0,0]) children(); | 124 | mirror([left?0:1,0,0]) children(); |
125 | } | 125 | } |
126 | module place_idler() { | 126 | module place_idler() { |
127 | rotate([0,0,45]) | 127 | rotate([0,0,45]) |
128 | translate([(pulley_d+idler_d)/2,0,0]) | 128 | translate([(pulley_d+idler_d)/2,0,0]) |
129 | children(); | 129 | children(); |
130 | } | 130 | } |
131 | module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) { | 131 | module finger_indent(d=lever_thickness,depth/*=1*/,r/*=15*/) { |
132 | if(depth) { | 132 | if(depth) { |
133 | hh = (-4*pow(depth,2)+pow(d,2))/(8*depth); | 133 | hh = (-4*pow(depth,2)+pow(d,2))/(8*depth); |
134 | rr = depth+hh; | 134 | rr = depth+hh; |
135 | translate([0,0,hh]) sphere(r=rr,$fn=fnr*rr); | 135 | translate([0,0,hh]) sphere(r=rr,$fn=fnr*rr); |
136 | }else if(r) { | 136 | }else if(r) { |
137 | hh=sqrt(pow(r,2)-pow(d,2)/4); | 137 | hh=sqrt(pow(r,2)-pow(d,2)/4); |
138 | translate([0,0,hh]) sphere(r=r,$fn=fnr*r); | 138 | translate([0,0,hh]) sphere(r=r,$fn=fnr*r); |
139 | } | 139 | } |
140 | } | 140 | } |
141 | 141 | ||
142 | % if(vitamins) mirrorleft() { | 142 | % if(vitamins) mirrorleft() { |
143 | translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60); | 143 | translate([0,0,-epsilon]) mirror([0,0,1]) cylinder(d=gearbox_d,h=1,$fn=60); |
144 | for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) | 144 | for(zr=[0:90:359]) rotate([0,0,zr]) translate([mount_d/2,0,0]) |
145 | cylinder(d=mount_screw_d,h=20,$fn=30); | 145 | cylinder(d=mount_screw_d,h=20,$fn=30); |
146 | translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30); | 146 | translate([0,0,-epsilon]) cylinder(d=protrusion_d,h=protrusion_h,$fn=30); |
147 | translate([0,0,protrusion_h]) { | 147 | translate([0,0,protrusion_h]) { |