line ending or smth

master
Eggert Jung 5 years ago
parent f5d589e1e6
commit 35986eafff

@ -1,337 +1,337 @@
// parametric hose pump for use with stepper motor // parametric hose pump for use with stepper motor
// ball bearings used as rollers // ball bearings used as rollers
// red holes need thread cutting M4 (hole depth 10mm) // red holes need thread cutting M4 (hole depth 10mm)
// green holes need thread cutting M3 (hole depth 11mm) // green holes need thread cutting M3 (hole depth 11mm)
$fn=100; $fn=100;
show_case = true; show_case = true;
show_disc = true; show_disc = true;
show_lid = true; show_lid = true;
show_motor_flange = true; show_motor_flange = true;
// ##### PARAMETERS TO ADAPT ##### // ##### PARAMETERS TO ADAPT #####
// GENERAL // GENERAL
clearance = 0.25; // clearence for moving parts clearance = 0.25; // clearence for moving parts
// HOSE // HOSE
d_hose_out = 5.0; // outer hose diameter d_hose_out = 5.0; // outer hose diameter
d_hose_in = 3.0; // inner hose diameter d_hose_in = 3.0; // inner hose diameter
r_bending_hose = 19; // outer radius auf bent hose r_bending_hose = 19; // outer radius auf bent hose
l_squeeze = 0.7; // distance the hose is squeezed l_squeeze = 0.7; // distance the hose is squeezed
// BALL BEARINGS // BALL BEARINGS
d_bb_out = 9; // outer diameter of ball bearing d_bb_out = 9; // outer diameter of ball bearing
d_bb_in = 4; // inner diameter of ball bearing d_bb_in = 4; // inner diameter of ball bearing
h_bb = 4; // thickness of ball bearing h_bb = 4; // thickness of ball bearing
number_of_rollers = 6; // number of rollers used number_of_rollers = 6; // number of rollers used
wall_thickness = 6; // thickness of outer case wall wall_thickness = 6; // thickness of outer case wall
hose_angle = 15; // angle of hose outlet, 0=parallel hose_angle = 15; // angle of hose outlet, 0=parallel
lid_thickness = 4; // thickness of lid lid_thickness = 4; // thickness of lid
h_disc = 10; // heigth (thickness) of rotating disc. Change carefully screwholes migth stick out h_disc = 10; // heigth (thickness) of rotating disc. Change carefully screwholes migth stick out
d_lid_screw_borehole = 2.5; // bore hole diameter for lid screw thread cutting d_lid_screw_borehole = 2.5; // bore hole diameter for lid screw thread cutting
d_lid_screw = 3; // diameter of lid screws (must match with bore hole diameter) d_lid_screw = 3; // diameter of lid screws (must match with bore hole diameter)
// MOTOR // MOTOR
motor_width=42; // width of (stepper)motor motor_width=42; // width of (stepper)motor
d_motor_shaft = 5; // diameter of the motors shaft d_motor_shaft = 5; // diameter of the motors shaft
r_shaft_flattening = 0.6; // depth (radius) of flattening of motor shaft r_shaft_flattening = 0.6; // depth (radius) of flattening of motor shaft
d_motor_flange_excess = 22.5; // diameter of circular excess on motors flange d_motor_flange_excess = 22.5; // diameter of circular excess on motors flange
h_motor_flange_excess = 2.5; // thickness of circular excess on motors flange h_motor_flange_excess = 2.5; // thickness of circular excess on motors flange
d_motor_screws = 3; // diameter of screws to fit in motors threads d_motor_screws = 3; // diameter of screws to fit in motors threads
hole_in_lid = true; // puts a hole in the lid for motor shaft (when motors shaft is too long) hole_in_lid = true; // puts a hole in the lid for motor shaft (when motors shaft is too long)
motor_thread_distance=31; // shortest distance between two screw_holes on motor motor_thread_distance=31; // shortest distance between two screw_holes on motor
// ############################ // ############################
// ##### CACULATED VALUES ##### // ##### CACULATED VALUES #####
roller_angle=360/number_of_rollers; // roller offset angle roller_angle=360/number_of_rollers; // roller offset angle
hose_wall_thickness = (d_hose_out-d_hose_in)/2; // wall thickness of hose hose_wall_thickness = (d_hose_out-d_hose_in)/2; // wall thickness of hose
heigth_squeezed_hose = (d_hose_out*PI-hose_wall_thickness*4+hose_wall_thickness*2)/2+l_squeeze; //max width of the sueezed hose, used for caculating the heigth of rollers heigth_squeezed_hose = (d_hose_out*PI-hose_wall_thickness*4+hose_wall_thickness*2)/2+l_squeeze; //max width of the sueezed hose, used for caculating the heigth of rollers
d_hose_squeezed = hose_wall_thickness*2-l_squeeze; // thickness of squeezed hose d_hose_squeezed = hose_wall_thickness*2-l_squeeze; // thickness of squeezed hose
ballbearings_per_roller=ceil(heigth_squeezed_hose/h_bb); // number of ball bearings to stack per roller ballbearings_per_roller=ceil(heigth_squeezed_hose/h_bb); // number of ball bearings to stack per roller
echo("number of ball bearings to stack per roller", ballbearings_per_roller); echo("number of ball bearings to stack per roller", ballbearings_per_roller);
roller_height=h_bb*ballbearings_per_roller; // total heigth of roller roller_height=h_bb*ballbearings_per_roller; // total heigth of roller
d_roller=d_bb_out; // outer diameter of roller d_roller=d_bb_out; // outer diameter of roller
r_roller_shaft_position=r_bending_hose-d_roller/2-d_hose_squeezed; // radius of roller shaft position r_roller_shaft_position=r_bending_hose-d_roller/2-d_hose_squeezed; // radius of roller shaft position
d_motor_flange=motor_width*sqrt(2); // diameter of the motor flange, depends on motor width d_motor_flange=motor_width*sqrt(2); // diameter of the motor flange, depends on motor width
d_case_top=r_bending_hose*2+wall_thickness*2; // diameter of case on top, also lid diameter d_case_top=r_bending_hose*2+wall_thickness*2; // diameter of case on top, also lid diameter
h_case=roller_height+clearance+h_disc; // total heigth of casing h_case=roller_height+clearance+h_disc; // total heigth of casing
d_disc=r_bending_hose*2-clearance*2; // diameter of disc (rotating part) d_disc=r_bending_hose*2-clearance*2; // diameter of disc (rotating part)
r_motor_flange_screws = d_motor_flange/2-4.5; // r_motor_flange_screws = d_motor_flange/2-4.5; //
// DISC // DISC
if(show_disc==true) if(show_disc==true)
difference() difference()
{ {
cylinder(d=d_disc,h=h_disc); cylinder(d=d_disc,h=h_disc);
// motor shaft hole // motor shaft hole
difference() difference()
{ {
translate([0,0,-1]) translate([0,0,-1])
cylinder(d=d_motor_shaft,h=h_disc*2); cylinder(d=d_motor_shaft,h=h_disc*2);
difference() difference()
{ {
translate([d_motor_shaft*1.5-r_shaft_flattening,0,0]) translate([d_motor_shaft*1.5-r_shaft_flattening,0,0])
cylinder(d=d_motor_shaft*2,h=h_disc); cylinder(d=d_motor_shaft*2,h=h_disc);
translate([h_disc/2,-h_disc,0]) translate([h_disc/2,-h_disc,0])
cube([h_disc*2,h_disc*2,h_disc*2]); cube([h_disc*2,h_disc*2,h_disc*2]);
} }
} }
// holes for roller shafts // holes for roller shafts
for(i=[0:1:number_of_rollers-1]) for(i=[0:1:number_of_rollers-1])
{ {
rotate(roller_angle*i,[0,0,1]) rotate(roller_angle*i,[0,0,1])
translate([r_roller_shaft_position,0,-1]) translate([r_roller_shaft_position,0,-1])
cylinder(d=d_bb_in,h=h_disc*2); cylinder(d=d_bb_in,h=h_disc*2);
} }
// rollers // rollers
%for(i=[0:1:number_of_rollers-1]) %for(i=[0:1:number_of_rollers-1])
{ {
rotate(roller_angle*i,[0,0,1]) rotate(roller_angle*i,[0,0,1])
translate([r_roller_shaft_position,0,h_disc]) translate([r_roller_shaft_position,0,h_disc])
cylinder(d=d_roller,h=roller_height); cylinder(d=d_roller,h=roller_height);
} }
} }
// CASE // CASE
if(show_case==true) if(show_case==true)
difference() difference()
{ {
union() union()
{ {
// case // case
translate([0,0,0]) translate([0,0,0])
cylinder(d1=d_motor_flange,d2=d_case_top,h=h_case); cylinder(d1=d_motor_flange,d2=d_case_top,h=h_case);
// hose outlet blocks // hose outlet blocks
rotate(hose_angle,[0,0,1]) rotate(hose_angle,[0,0,1])
hull() hull()
{ {
translate([r_bending_hose-d_hose_out/2,r_bending_hose,h_disc-d_hose_out/4]) translate([r_bending_hose-d_hose_out/2,r_bending_hose,h_disc-d_hose_out/4])
radius_chamfer_cube(d_hose_out+d_hose_out/2,d_hose_out+wall_thickness,d_hose_out+d_hose_out/2,1,1); radius_chamfer_cube(d_hose_out+d_hose_out/2,d_hose_out+wall_thickness,d_hose_out+d_hose_out/2,1,1);
translate([0,0,0]) translate([0,0,0])
translate([r_bending_hose-d_hose_out/2,r_bending_hose,0]) translate([r_bending_hose-d_hose_out/2,r_bending_hose,0])
radius_chamfer_cube(d_hose_out+d_hose_out/2,1,1,0,1); radius_chamfer_cube(d_hose_out+d_hose_out/2,1,1,0,1);
} }
rotate(-hose_angle,[0,0,1]) rotate(-hose_angle,[0,0,1])
hull() hull()
{ {
translate([-(r_bending_hose-d_hose_out/2),r_bending_hose,h_disc-d_hose_out/4]) translate([-(r_bending_hose-d_hose_out/2),r_bending_hose,h_disc-d_hose_out/4])
radius_chamfer_cube(d_hose_out+d_hose_out/2,d_hose_out+wall_thickness,d_hose_out+d_hose_out/2,1,1); radius_chamfer_cube(d_hose_out+d_hose_out/2,d_hose_out+wall_thickness,d_hose_out+d_hose_out/2,1,1);
translate([0,0,0]) translate([0,0,0])
translate([-(r_bending_hose-d_hose_out/2),r_bending_hose,0]) translate([-(r_bending_hose-d_hose_out/2),r_bending_hose,0])
radius_chamfer_cube(d_hose_out+d_hose_out/2,1,1,0,1); radius_chamfer_cube(d_hose_out+d_hose_out/2,1,1,0,1);
} }
} }
// case inside // case inside
translate([0,0,-1]) translate([0,0,-1])
cylinder(d=r_bending_hose*2,h=h_case+2); cylinder(d=r_bending_hose*2,h=h_case+2);
// hose outlet borings // hose outlet borings
rotate(hose_angle,[0,0,1]) rotate(hose_angle,[0,0,1])
translate([r_bending_hose-d_hose_out/2,0,h_disc+d_hose_out/2]) translate([r_bending_hose-d_hose_out/2,0,h_disc+d_hose_out/2])
rotate(-90,[1,0,0]) rotate(-90,[1,0,0])
cylinder(d=d_hose_out,h=d_disc); cylinder(d=d_hose_out,h=d_disc);
rotate(-hose_angle,[0,0,1]) rotate(-hose_angle,[0,0,1])
translate([-r_bending_hose+d_hose_out/2,0,h_disc+d_hose_out/2]) translate([-r_bending_hose+d_hose_out/2,0,h_disc+d_hose_out/2])
rotate(-90,[1,0,0]) rotate(-90,[1,0,0])
cylinder(d=d_hose_out,h=d_disc); cylinder(d=d_hose_out,h=d_disc);
// lid screw borings (for thread cutting) // lid screw borings (for thread cutting)
for(i=[3:1:6]) for(i=[3:1:6])
{ {
rotate((360/6)*i+0,[0,0,1]) rotate((360/6)*i+0,[0,0,1])
translate([r_bending_hose+3,0,h_case-11]) translate([r_bending_hose+3,0,h_case-11])
cylinder(d=d_lid_screw_borehole,h=20); cylinder(d=d_lid_screw_borehole,h=20);
} }
color("red") color("red")
%for(i=[3:1:6]) %for(i=[3:1:6])
{ {
rotate((360/6)*i+0,[0,0,1]) rotate((360/6)*i+0,[0,0,1])
translate([r_bending_hose+3,0,h_case-11]) translate([r_bending_hose+3,0,h_case-11])
cylinder(d=d_lid_screw_borehole,h=11); cylinder(d=d_lid_screw_borehole,h=11);
} }
// motor flange screw borings (for thread cutting) // motor flange screw borings (for thread cutting)
for(i=[0:1:4]) for(i=[0:1:4])
{ {
rotate(90*i,[0,0,1]) rotate(90*i,[0,0,1])
translate([r_motor_flange_screws,0,-2]) translate([r_motor_flange_screws,0,-2])
cylinder(d=3.25,h=10); cylinder(d=3.25,h=10);
} }
color("green") color("green")
%for(i=[0:1:4]) %for(i=[0:1:4])
{ {
rotate(90*i,[0,0,1]) rotate(90*i,[0,0,1])
translate([r_motor_flange_screws,0,-2]) translate([r_motor_flange_screws,0,-2])
cylinder(d=3.25,h=10); cylinder(d=3.25,h=10);
} }
} }
// LID // LID
if(show_lid==true) if(show_lid==true)
translate([0,0,1]) // offset to separate objects translate([0,0,1]) // offset to separate objects
difference() difference()
{ {
// lid // lid
translate([0,0,h_case]) translate([0,0,h_case])
cylinder(d=d_case_top,h=lid_thickness); cylinder(d=d_case_top,h=lid_thickness);
// lid screw holes // lid screw holes
for(i=[3:1:6]) for(i=[3:1:6])
{ {
rotate((360/6)*i+0,[0,0,1]) rotate((360/6)*i+0,[0,0,1])
translate([r_bending_hose+3,0,h_case+lid_thickness]) translate([r_bending_hose+3,0,h_case+lid_thickness])
screw_hole(d_lid_screw,lid_thickness+4,6,2,false); screw_hole(d_lid_screw,lid_thickness+4,6,2,false);
} }
// hole for motor shaft in lid // hole for motor shaft in lid
if(hole_in_lid==true) if(hole_in_lid==true)
{ {
translate([0,0,h_case-1]) translate([0,0,h_case-1])
cylinder(d=d_motor_shaft+clearance,h=lid_thickness*2); cylinder(d=d_motor_shaft+clearance,h=lid_thickness*2);
} }
} }
// MOTOR FLANGE // MOTOR FLANGE
if(show_motor_flange==true) if(show_motor_flange==true)
translate([0,0,-1]) // offset to separate objects translate([0,0,-1]) // offset to separate objects
difference() difference()
{ {
union() union()
{ {
// motor flange // motor flange
translate([0,0,-(wall_thickness)]) translate([0,0,-(wall_thickness)])
cylinder(d=d_motor_flange,h=wall_thickness); cylinder(d=d_motor_flange,h=wall_thickness);
} }
// recess for disc // recess for disc
translate([0,0,-clearance]) translate([0,0,-clearance])
cylinder(d=d_disc+1,h=h_disc); cylinder(d=d_disc+1,h=h_disc);
//steppermotor //steppermotor
translate([0,0,-motor_width-wall_thickness]) translate([0,0,-motor_width-wall_thickness])
%radius_chamfer_cube(motor_width,motor_width,motor_width,4,1); %radius_chamfer_cube(motor_width,motor_width,motor_width,4,1);
// screw holes for attaching the motor flange to the case // screw holes for attaching the motor flange to the case
for(i=[0:1:4]) for(i=[0:1:4])
{ {
rotate(90*i,[0,0,1]) rotate(90*i,[0,0,1])
translate([r_motor_flange_screws,0,-wall_thickness]) translate([r_motor_flange_screws,0,-wall_thickness])
//cylinder(d=d_lid_screw_borehole,h=10); //cylinder(d=d_lid_screw_borehole,h=10);
rotate(180,[1,0,0]) rotate(180,[1,0,0])
screw_hole(4,wall_thickness+4,8,2,false); screw_hole(4,wall_thickness+4,8,2,false);
} }
// screw holes for attaching the motor to the motor flange // screw holes for attaching the motor to the motor flange
translate([0,0,0]) translate([0,0,0])
for(i=[0:1:3]) for(i=[0:1:3])
{ {
rotate(90*i,[0,0,1]) rotate(90*i,[0,0,1])
translate([motor_thread_distance/2,motor_thread_distance/2,0]) translate([motor_thread_distance/2,motor_thread_distance/2,0])
screw_hole(d_motor_screws,wall_thickness+4,6,2,false); screw_hole(d_motor_screws,wall_thickness+4,6,2,false);
} }
// recess for excess on stepper motor // recess for excess on stepper motor
translate([0,0,-(wall_thickness)]) translate([0,0,-(wall_thickness)])
cylinder(d=d_motor_flange_excess,h=h_motor_flange_excess); cylinder(d=d_motor_flange_excess,h=h_motor_flange_excess);
// hole for motor shaft // hole for motor shaft
translate([0,0,-(wall_thickness)]) translate([0,0,-(wall_thickness)])
cylinder(d=d_motor_shaft+clearance,h=wall_thickness); cylinder(d=d_motor_shaft+clearance,h=wall_thickness);
} }
// MODULES USED // MODULES USED
module screw_hole(diameter,length,head_diameter,recess_length,flathead) module screw_hole(diameter,length,head_diameter,recess_length,flathead)
{ {
head_length=head_diameter/2-diameter/2; head_length=head_diameter/2-diameter/2;
translate([0,0,-length]) translate([0,0,-length])
{ {
cylinder(d=diameter,h=length); cylinder(d=diameter,h=length);
if(flathead==false) if(flathead==false)
{ {
translate([0,0,length-head_length]) translate([0,0,length-head_length])
cylinder(d1=diameter,d2=head_diameter,h=head_length); cylinder(d1=diameter,d2=head_diameter,h=head_length);
} }
else else
{ {
translate([0,0,length-head_length]) translate([0,0,length-head_length])
cylinder(d=head_diameter,h=head_length); cylinder(d=head_diameter,h=head_length);
} }
if(recess_length > 0) if(recess_length > 0)
{ {
translate([0,0,length]) translate([0,0,length])
cylinder(d=head_diameter,h=recess_length); cylinder(d=head_diameter,h=recess_length);
} }
} }
} }
module radius_chamfer_cube(x,y,z,r,center) module radius_chamfer_cube(x,y,z,r,center)
{ {
if(center == 0) if(center == 0)
{ {
if(r>0) if(r>0)
{ {
translate([r,r,0]) translate([r,r,0])
minkowski() minkowski()
{ {
cube([x-2*r,y-2*r,z/2]); cube([x-2*r,y-2*r,z/2]);
cylinder(r=r,h=z/2); cylinder(r=r,h=z/2);
} }
} }
else else
{ {
cube([x,y,z]); cube([x,y,z]);
} }
} }
if(center == 1) if(center == 1)
{ {
translate([-x/2,-y/2,0]) translate([-x/2,-y/2,0])
{ {
if(r>0) if(r>0)
{ {
translate([r,r,0]) translate([r,r,0])
minkowski() minkowski()
{ {
cube([x-2*r,y-2*r,z/2]); cube([x-2*r,y-2*r,z/2]);
cylinder(r=r,h=z/2); cylinder(r=r,h=z/2);
} }
} }
else else
{ {
cube([x,y,z]); cube([x,y,z]);
} }
} }
} }
if(center == 2) if(center == 2)
{ {
translate([-x/2,-y/2,-z/2]) translate([-x/2,-y/2,-z/2])
{ {
if(r>0) if(r>0)
{ {
translate([r,r,0]) translate([r,r,0])
minkowski() minkowski()
{ {
cube([x-2*r,y-2*r,z/2]); cube([x-2*r,y-2*r,z/2]);
cylinder(r=r,h=z/2); cylinder(r=r,h=z/2);
} }
} }
else else
{ {
cube([x,y,z]); cube([x,y,z]);
} }
} }
} }
} }
Loading…
Cancel
Save