FluidSwitch/FluidSwitch_Radial.scad

Wed, 12 Sep 2018 12:48:28 +0200

author
mdd
date
Wed, 12 Sep 2018 12:48:28 +0200
changeset 0
15eac37578b7
child 1
a159ad715fe0
permissions
-rw-r--r--

initial commit of FluidSwitch prototype

0
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
1 // fluid 1-to-N-way rotation Valve
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
2 // 1 Inlet, N Outlets
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
3
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
4 // Variables:
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
5 oring_outer = 5.0;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
6 oring_inner = 3.0;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
7
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
8 tube_dia = 2;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
9
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
10 hole_inner = 1.0;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
11 axis_dia = 5;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
12
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
13 // for color mixer we need 3 base colors + black + white + additional 1 waste and 1 clean water and one output = 8 connectors
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
14 // cycle will be:
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
15 // 1) select color 1-5, load syringe, select output, unload syringe, repeat for each other color
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
16 // 2) select water, load syringe, select waste, unload syringe
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
17 outlets = 8;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
18
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
19 // just fiddle around with the following variables:
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
20 outlet_circle_dia = 13;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
21 base_dia = 20;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
22
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
23 // roundness faces
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
24 fn = 10;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
25
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
26 // calculations:
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
27 oring_dia = (oring_outer - oring_inner) / 2;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
28 outlet_angle = 360/outlets;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
29 base_height = 6;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
30 base_outer_dia = base_dia + 6;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
31 outer_thread_height = 10;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
32 outer_height = 15;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
33 thread_pitch = 2;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
34
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
35 // START PROGRAM
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
36 use <../libs/Threading/Threading.scad>
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
37
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
38 valve_lower();
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
39
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
40 //rotate([180,0,0]) translate([30,0,0])
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
41 //valve_inlay();
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
42
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
43 //rotate([180,0,0]) translate([0,0,-60])
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
44 // valve_cap();
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
45
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
46 // MODULES
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
47
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
48 module valve_inlay() union() {
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
49 inlay_height = 5;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
50 difference() {
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
51 translate([0,0,0.0001])
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
52 cylinder(d=base_dia, h = inlay_height);
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
53
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
54 // cut out the connector tube
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
55 rotate([90,0,0])
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
56 translate([outlet_circle_dia/4,0,0])
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
57 rotate_extrude(convexity=10)
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
58 translate([outlet_circle_dia/4, 0]) circle(d=oring_inner, $fn=fn);
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
59
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
60 // cylinder(d=oring_inner, h=inlay_height / 2, $fn=fn);
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
61 // translate([outlet_circle_dia/2,0])
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
62 // cylinder(d=oring_inner, h=inlay_height / 2, $fn=fn);
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
63 }
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
64
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
65 // hex drive rod
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
66 translate([0,0,inlay_height])
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
67 cylinder(d=axis_dia, h=20, $fn=6);
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
68 }
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
69
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
70 module valve_cap() {
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
71 cap_sides = 50;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
72 difference() {
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
73 union() {
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
74 translate([0,0,2])
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
75 Threading(D = base_outer_dia + 6, pitch = thread_pitch, d=base_outer_dia, windings = (outer_thread_height/thread_pitch), angle = 55, full = true, step = 50, $fn=cap_sides);
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
76
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
77 cylinder(d=base_outer_dia + 6, h=2, $fn=cap_sides);
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
78 }
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
79
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
80 cylinder(d=axis_dia + 2, h=2 + 0.001, $fn=fn);
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
81 }
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
82 }
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
83
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
84 module valve_lower()
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
85 difference() {
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
86 union() {
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
87 valve_base();
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
88 valve_casing();
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
89 // bottom
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
90 translate([0,0,-1.5]) cylinder(d=base_outer_dia, h=1.5);
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
91 }
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
92
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
93 // cut out the OUTLET ring on the side
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
94 for(i = [1:outlets]) {
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
95 a = outlet_angle * i;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
96 rotate([90,0,a]) {
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
97 translate([outlet_circle_dia/2 - hole_inner/2,tube_dia/2,0])
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
98 rotate([0,90,0])
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
99 cylinder(d=tube_dia, h=base_outer_dia, $fn=fn);
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
100 }
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
101 }
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
102
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
103 }
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
104 // TODO: cut out the syringe hole (needs to be conical to fit)
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
105
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
106
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
107 module valve_casing() {
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
108 difference() {
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
109 union() {
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
110 translate([0,0,0.001])
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
111 cylinder(d=base_outer_dia, h=outer_height - outer_thread_height);
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
112
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
113 translate([0,0,outer_height - outer_thread_height])
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
114 threading(pitch = thread_pitch, d=base_outer_dia, windings = (outer_thread_height/thread_pitch)-1, angle = 55, full = true, $fn=fn);
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
115 }
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
116
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
117 cylinder(d=base_dia, h = outer_height + 0.001);
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
118 }
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
119 }
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
120
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
121 module valve_base() difference() {
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
122 cylinder(d=base_dia, h=base_height);
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
123
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
124 // inlet hole
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
125 cylinder(d=hole_inner, h=base_height, $fn=fn);
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
126 translate([0,0,base_height])
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
127 oring();
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
128
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
129 // cut Outlet holes and oring carves
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
130 for(i = [1:outlets]) {
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
131 a = outlet_angle * i;
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
132 rotate([0,0,a]) {
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
133 translate([outlet_circle_dia/2,0,base_height])
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
134 oring();
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
135 translate([outlet_circle_dia/2,0])
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
136 cylinder(d=hole_inner, h=base_height, $fn=fn);
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
137 }
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
138 }
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
139
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
140 }
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
141
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
142 module oring() {
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
143 rotate_extrude(convexity=10, $fn=fn)
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
144 translate([oring_inner/2 , 0, 0])
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
145 circle(d=oring_dia, $fn=fn);
15eac37578b7 initial commit of FluidSwitch prototype
mdd
parents:
diff changeset
146 }

mercurial