/* ******************************************* Objekt Info: Planetengetriebe 2 ******************************************* Version: 19.09.2022 khf ******************************************* */ //*************** Auswahl ************* // keine //***************************************** //*************** Libraries ************ // keine //***************************************** //*************** Parameter ************* // Durchmesser des aeusseren Zylinders OuterWheelDiameter = 65; // Ringgetriebe Durchmesser vom aeusseren Rad aus RingGearDiameter = 60; Thickness = 18; // Abstand zwischen den Zahnraedern Clearance = 0.4; Planets = 5; PlanetTeethCount = 8; SunToothCountEstimate = 10; // Druckwinkel der Schraeglage der Evolventenzaehne PressureAngle = 45; // Die # der Zaehne, die jeder Zahnradzahn spiralfoermig kreuzt TeethToTwistAcross = 0.9; // 0=keine Fuellung; Die Groesse der Waben-Loecher Infill_HoleSize = 0; // aendert die Wabenwandstaerke Infill_Strength = 10; // Die aeussere Kantenwandstaerke der Wabe Infill_BorderSize = 1; // Effekte # von Eckpunkten ueber involute Zahnschritte & # von Scheiben pro Zahnradextruder Precision = 11; // (0=kein Loch; Die HEX-Lochbreite im Sonnenschutzgetriebe) CenterHEXHoleWidth = 6.7; // Schluesselbundhalter auf der Aussenseite Keychain = "no"; // [yes, no] // Die Dicke des Schluesselbundlochs KeychainThickness = 5; //***************************************** //************** Programm ************** // VORBERECHNUNGEN-------- InFill_HoleStep = (Infill_HoleSize*3.5) + (((Infill_Strength/100)*(Infill_HoleSize*4))); MaxTeethDepthRatio = 0.5*1; PiExact = 1*3.141592653589793238462643383279502884197169399375105820974944592307816406286; PlanetCount = round(Planets); PlanetToothCount = round(PlanetTeethCount); PlanetToothCount_Step1 = round(2/PlanetCount*(SunToothCountEstimate+PlanetToothCount)); PlanetToothCount_Step2 = PlanetToothCount_Step1*PlanetCount%2!=0 ? PlanetToothCount_Step1+1 : PlanetToothCount_Step1; SunToothCount = PlanetToothCount_Step2*PlanetCount/2-PlanetToothCount; RingToothCount=SunToothCount+2*PlanetToothCount; pitchD=0.9*RingGearDiameter/(1+min(PiExact/(2*RingToothCount*tan(PressureAngle)),PiExact*MaxTeethDepthRatio/RingToothCount)); Pitch=pitchD*PiExact/RingToothCount; helix_angle=atan(2*TeethToTwistAcross*Pitch/Thickness); phi = $t * 360 / PlanetCount; PlanetOffset = pitchD/2*(SunToothCount+PlanetToothCount)/RingToothCount; PlanetRotationMultiplier = SunToothCount/PlanetCount*360/PlanetToothCount-phi*(SunToothCount+PlanetToothCount)/PlanetToothCount-phi; // USER INFO -------------------------------------------------------------- echo("Planets",Planets); echo("SunToothCount",SunToothCount); echo("PlanetToothCount",PlanetTeethCount); echo("RingToothCount", RingToothCount); echo("PlanetOffset",PlanetOffset); echo("RingGearDiameter",RingGearDiameter); echo("Thickness",Thickness); echo("Clearance",Clearance); echo("TeethToTwistAcross",TeethToTwistAcross); echo("helix_angle=",helix_angle); echo("PressureAngle",PressureAngle); echo("Pitch",Pitch); echo("CenterHEXHoleWidth",CenterHEXHoleWidth); // ---------------------------------------------------------- translate([0,0,Thickness/2]){ // AUssENRING GETRIEBE difference(){ //cylinder(r=OuterWheelDiameter/2,h=Thickness,center=true,$fn=(Precision*10)); union() { pitch_radius = RingToothCount*Pitch/(2*PiExact); depth = Pitch/(2*tan(PressureAngle)); outer_radius = Clearance<0 ? pitch_radius+depth/2-Clearance : pitch_radius+depth/2; cylinder(r=outer_radius+Infill_BorderSize+0.5,h=Thickness,center=true,$fn=(Precision*10)); Infill_Cylinder(IRadius=OuterWheelDiameter/2,IHeight=Thickness,IPrecision=Precision, IHoleSize=Infill_HoleSize, IHoleStep=InFill_HoleStep, IBorderSize=Infill_BorderSize); } herringbone(RingToothCount,Pitch,PressureAngle,MaxTeethDepthRatio,-Clearance,helix_angle,Thickness+0.2); } // SUN GEAR rotate([0,0,(PlanetToothCount+1)*180/SunToothCount+phi*(SunToothCount+PlanetToothCount)*2/SunToothCount]) difference(){ mirror([0,1,0]) herringbone_adv(SunToothCount,Pitch,PressureAngle,MaxTeethDepthRatio,Clearance,helix_angle,Thickness, Infill_HoleSize, Infill_Strength, Infill_BorderSize, CenterHEXHoleWidth); } for(i=[1:PlanetCount]) rotate([0,0,i*360/PlanetCount+phi]) translate([PlanetOffset,0,0]) rotate([0,0,i*PlanetRotationMultiplier]) herringbone_adv(PlanetToothCount,Pitch,PressureAngle,MaxTeethDepthRatio,Clearance,helix_angle,Thickness, Infill_HoleSize, Infill_Strength, Infill_BorderSize, 0); if( Keychain == "yes") { echo("DRAWING KEYHOLE"); translate([(OuterWheelDiameter/2)+(KeychainThickness*1.5), 0, -(Thickness/2)+(KeychainThickness/2)]) CreateKeyChainTab(KeychainThickness); } } module CreateKeyChainTab(KeychainHoleThickness = 5) { difference() { union() { translate([-(KeychainHoleThickness/2),0, 0]) cube([KeychainHoleThickness*3,KeychainHoleThickness*2,KeychainHoleThickness], center = true); translate([KeychainHoleThickness,0, 0]) rotate([90,0,0]) cylinder(d = KeychainHoleThickness, h=(KeychainHoleThickness*2), center = true, $fn=(Precision*10)); translate([-(KeychainHoleThickness/2),KeychainHoleThickness, 0]) rotate([0,90,0]) cylinder(d = KeychainHoleThickness, h=(KeychainHoleThickness*3), center = true, $fn=(Precision*10)); translate([-(KeychainHoleThickness/2),-(KeychainHoleThickness), 0]) rotate([0,90,0]) cylinder(d = KeychainHoleThickness, h=(KeychainHoleThickness*3), center = true, $fn=(Precision*10)); translate([(KeychainHoleThickness),(KeychainHoleThickness), 0]) sphere(d = KeychainHoleThickness, $fn=(Precision*10)); translate([(KeychainHoleThickness),-(KeychainHoleThickness), 0]) sphere(d = KeychainHoleThickness, $fn=(Precision*10)); } color("Red") translate([0,0, -(KeychainHoleThickness)]) cylinder(r = KeychainHoleThickness/1.75, h=(KeychainHoleThickness*2), $fn=(Precision*10)); } } module Infill_Cylinder(IRadius=10,IHeight=10,IPrecision=10, IHoleSize=3.5, IHoleStep=10, IBorderSize=3 ) { union() { difference() { cylinder(r=IRadius,h=IHeight,center=true,$fn=(IPrecision*10)); Infill_Cylinder_Pattern(IC_Radius=IRadius, IC_Height=IHeight+1, IC_Precision=IPrecision, HoleSize=IHoleSize, HoleStep=IHoleStep); } difference() { cylinder(r=IRadius,h=IHeight,center=true,$fn=(IPrecision*10)); cylinder(r=IRadius-IBorderSize,h=IHeight+1,center=true,$fn=(IPrecision*10)); } } } module herringbone_adv( number_of_teeth=15, circular_pitch=10, pressure_angle=28, depth_ratio=1, GearClearance=0, helix_angle=0, gear_GearThickness=5, Infill_HoleSize, Infill_Strength, Infill_BorderSize, CenterHEXHoleWidth) { union() { difference() { // herringbone gear herringbone(number_of_teeth,circular_pitch,pressure_angle,depth_ratio,GearClearance,helix_angle,gear_GearThickness); cylinder(r=CenterHEXHoleWidth/sqrt(3),h=gear_GearThickness+1,center=true,$fn=6); pitch_radius = number_of_teeth*circular_pitch/(2*PiExact); base_radius = pitch_radius*cos(pressure_angle); depth = circular_pitch/(2*tan(pressure_angle)); root_radius1 = pitch_radius-depth/2-GearClearance/2; root_radius = (GearClearance<0 && root_radius1 0) { difference() { cylinder(r=CenterHEXHoleWidth/sqrt(3)+Infill_BorderSize,h=gear_GearThickness,center=true,$fn=(Precision*10));//6); cylinder(r=CenterHEXHoleWidth/sqrt(3),h=gear_GearThickness+1,center=true,$fn=6); } } } } module Infill_Cylinder_Pattern( IC_Radius=10, IC_Height=10, IC_Precision=10, HoleSize=3, HoleStep=3 ) { if(HoleSize>0) { HoneyCombRatio = PiExact/(2*sqrt(3)); intersection() { cylinder(r=IC_Radius, h=IC_Height, center=true, $fn=(IC_Precision*10)); union() { StartPosition = (IC_Radius+HoleStep); XStep = (HoleStep*HoneyCombRatio); YStep = (HoleStep*0.5); XOffset = StartPosition - (floor(StartPosition / XStep)*XStep); YOffset = StartPosition - (floor(StartPosition / YStep)*YStep); for(x=[-StartPosition+XOffset:XStep:IC_Radius+HoleStep]) { for(y=[-StartPosition+YOffset:YStep:IC_Radius+HoleStep]) { translate([x,y,0]) cylinder(r=HoleSize, h=IC_Height+2, center=true, $fn=6); translate([x+(HoleStep*(0.5*HoneyCombRatio)),y+(HoleStep*0.75),0]) cylinder(r=HoleSize, h=IC_Height+2, center=true, $fn=6); } } } } } } // MODULE & FUNKTIONEN------------------------ module herringbone( number_of_teeth=15, circular_pitch=10, pressure_angle=28, depth_ratio=1, clearance=0, helix_angle=0, gear_thickness=5) { union() { gear(number_of_teeth, circular_pitch, pressure_angle, depth_ratio, clearance, helix_angle, gear_thickness/2); mirror([0,0,1]) gear(number_of_teeth, circular_pitch, pressure_angle, depth_ratio, clearance, helix_angle, gear_thickness/2); } } module gear( number_of_teeth=15, circular_pitch=10, pressure_angle=28, depth_ratio=1, clearance=0, helix_angle=0, gear_thickness=5, flat=false) { pitch_radius = number_of_teeth*circular_pitch/(2*PiExact); twist=tan(helix_angle)*gear_thickness/pitch_radius*180/PiExact; flat_extrude(h=gear_thickness,twist=twist,flat=flat) gear2D( number_of_teeth, circular_pitch, pressure_angle, depth_ratio, clearance); } module flat_extrude(h,twist,flat) { if(flat==false) linear_extrude(height=h,twist=twist,slices=Precision) children(0); else children(0); } module gear2D( number_of_teeth, circular_pitch, pressure_angle, depth_ratio, clearance) { pitch_radius = number_of_teeth*circular_pitch/(2*PiExact); base_radius = pitch_radius*cos(pressure_angle); depth = circular_pitch/(2*tan(pressure_angle)); outer_radius = clearance<0 ? pitch_radius+depth/2-clearance : pitch_radius+depth/2; root_radius1 = pitch_radius-depth/2-clearance/2; root_radius = (clearance<0 && root_radius1