Wed, 12 Sep 2018 12:48:28 +0200
initial commit of FluidSwitch prototype
// fluid 1-to-N-way rotation Valve // 1 Inlet, N Outlets // Variables: oring_outer = 5.0; oring_inner = 3.0; tube_dia = 2; hole_inner = 1.0; axis_dia = 5; // for color mixer we need 3 base colors + black + white + additional 1 waste and 1 clean water and one output = 8 connectors // cycle will be: // 1) select color 1-5, load syringe, select output, unload syringe, repeat for each other color // 2) select water, load syringe, select waste, unload syringe outlets = 8; // just fiddle around with the following variables: outlet_circle_dia = 13; base_dia = 20; // roundness faces fn = 10; // calculations: oring_dia = (oring_outer - oring_inner) / 2; outlet_angle = 360/outlets; base_height = 6; base_outer_dia = base_dia + 6; outer_thread_height = 10; outer_height = 15; thread_pitch = 2; // START PROGRAM use <../libs/Threading/Threading.scad> valve_lower(); //rotate([180,0,0]) translate([30,0,0]) //valve_inlay(); //rotate([180,0,0]) translate([0,0,-60]) // valve_cap(); // MODULES module valve_inlay() union() { inlay_height = 5; difference() { translate([0,0,0.0001]) cylinder(d=base_dia, h = inlay_height); // cut out the connector tube rotate([90,0,0]) translate([outlet_circle_dia/4,0,0]) rotate_extrude(convexity=10) translate([outlet_circle_dia/4, 0]) circle(d=oring_inner, $fn=fn); // cylinder(d=oring_inner, h=inlay_height / 2, $fn=fn); // translate([outlet_circle_dia/2,0]) // cylinder(d=oring_inner, h=inlay_height / 2, $fn=fn); } // hex drive rod translate([0,0,inlay_height]) cylinder(d=axis_dia, h=20, $fn=6); } module valve_cap() { cap_sides = 50; difference() { union() { translate([0,0,2]) 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); cylinder(d=base_outer_dia + 6, h=2, $fn=cap_sides); } cylinder(d=axis_dia + 2, h=2 + 0.001, $fn=fn); } } module valve_lower() difference() { union() { valve_base(); valve_casing(); // bottom translate([0,0,-1.5]) cylinder(d=base_outer_dia, h=1.5); } // cut out the OUTLET ring on the side for(i = [1:outlets]) { a = outlet_angle * i; rotate([90,0,a]) { translate([outlet_circle_dia/2 - hole_inner/2,tube_dia/2,0]) rotate([0,90,0]) cylinder(d=tube_dia, h=base_outer_dia, $fn=fn); } } } // TODO: cut out the syringe hole (needs to be conical to fit) module valve_casing() { difference() { union() { translate([0,0,0.001]) cylinder(d=base_outer_dia, h=outer_height - outer_thread_height); translate([0,0,outer_height - outer_thread_height]) threading(pitch = thread_pitch, d=base_outer_dia, windings = (outer_thread_height/thread_pitch)-1, angle = 55, full = true, $fn=fn); } cylinder(d=base_dia, h = outer_height + 0.001); } } module valve_base() difference() { cylinder(d=base_dia, h=base_height); // inlet hole cylinder(d=hole_inner, h=base_height, $fn=fn); translate([0,0,base_height]) oring(); // cut Outlet holes and oring carves for(i = [1:outlets]) { a = outlet_angle * i; rotate([0,0,a]) { translate([outlet_circle_dia/2,0,base_height]) oring(); translate([outlet_circle_dia/2,0]) cylinder(d=hole_inner, h=base_height, $fn=fn); } } } module oring() { rotate_extrude(convexity=10, $fn=fn) translate([oring_inner/2 , 0, 0]) circle(d=oring_dia, $fn=fn); }