// Work based on the project thigiverse https://www.thingiverse.com/thing:454702 // -------- Printer-related settings ------------ // Clearance to generate between non-connected parts. If the gears print 'stuck together' or are difficult to separate, try increasing this value. If there is excessive play between them, try lowering it. (default: 0.15mm) tol=0.25; // Allowed overhang for overhang removal; between 0 and 0.999 (0 = none, 0.5 = 45 degrees, 1 = infinite) allowed_overhang = 0.8; // -------- Details of the tubing used in the pump, in mm ------------ // Outer diameter of your tubing in mm tubing_od = 7; //tubing_od = 6.5; // Wall thickness of your tubing tubing_wall_thickness = 0.89375; // old: // tubing_wall_thickness = 0.79375; // Amount the tubing should be compressed by the rollers, as a proportion of total thickness (0 = no squish, 1.0 = complete squish) tubing_squish_ratio = 0.5; // -------- Part geometry settings ------------ // Approximate outer diameter of ring in mm D=51.7; // Thickness i.e. height in mm T=14; // Number of planet gears number_of_planets=3; // Number of teeth on planet gears number_of_teeth_on_planets=7; // Number of teeth on sun gear (approximate) approximate_number_of_teeth_on_sun=9; // pressure angle P=45;//[30:60] // number of teeth to twist across nTwist=1; // width of hexagonal hole w=5; //w=5.4; DR=0.5*1;// maximum depth ratio of teeth // ----------------End of customizable values ----------------- m=round(number_of_planets); np=round(number_of_teeth_on_planets); ns1=approximate_number_of_teeth_on_sun; k1=round(2/m*(ns1+np)); k= k1*m%2!=0 ? k1+1 : k1; ns=k*m/2-np; echo(ns); nr=ns+2*np; pitchD=0.9*D/(1+min(PI/(2*nr*tan(P)),PI*DR/nr)); pitch=pitchD*PI/nr; echo(pitch); helix_angle=atan(2*nTwist*pitch/T); echo(helix_angle); phi=$t*360/m; // compute some parameters related to the tubing tubing_squished_width = tubing_od * (PI/2); tubing_depth_clearance = 2*(tubing_wall_thickness*(1-tubing_squish_ratio)); // temporary variables for computing the outer radius of the outer ring gear teeth // used to make the clearance for the peristaltic squeezer feature on the planets outerring_pitch_radius = nr*pitch/(2*PI); outerring_depth=pitch/(2*tan(P)); outerring_outer_radius = tol<0 ? outerring_pitch_radius+outerring_depth/2-tol : outerring_pitch_radius+outerring_depth/2; // temporary variables for computing the outer radius of the planet gear teeth // used to make the peristaltic squeezer feature on the planets planet_pitch_radius = np*pitch/(2*PI); planet_depth=pitch/(2*tan(P)); planet_outer_radius = tol<0 ? planet_pitch_radius+planet_depth/2-tol : planet_pitch_radius+planet_depth/2; // temporary variables for computing the inside & outside radius of the sun gear teeth // used to make clearance for planet squeezers sun_pitch_radius = ns*pitch/(2*PI); sun_base_radius = sun_pitch_radius*cos(P); echo(sun_base_radius); sun_depth=pitch/(2*tan(P)); sun_outer_radius = tol<0 ? sun_pitch_radius+sun_depth/2-tol : sun_pitch_radius+sun_depth/2; sun_root_radius1 = sun_pitch_radius-sun_depth/2-tol/2; sun_root_radius = (tol<0 && sun_root_radius1