//MY5777 Recyclebot Modification Group //This parametric code has been modified / minized from jaap 2013 for the groups purposes. //Link to jaap's original source files: https://www.thingiverse.com/thing:360671 ///START translate([100,0,0]) pulley(teeth = 32); // same, but using defaults for all other values // Functions function tooth_spaceing_curvefit (teeth,b,c,d) = ((c * pow(teeth,d)) / (b + pow(teeth,d))) * teeth ; function tooth_spacing(teeth,tooth_pitch,pitch_line_offset) = (2*((teeth*tooth_pitch)/(3.14159265*2)-pitch_line_offset)) ; // Main Module module pulley( teeth = 8, // Number of teeth, standard Mendel T5 belt = 8, gives Outside Diameter of 11.88mm belt_type = "T5", // supported types: MXL 40DP XL H T2.5 T5 T10 AT5 HTD_3mm HTD_5mm HTD_8mm GT2_2mm GT2_3mm GT2_5mm motor_shaft = 13, // NEMA17 motor shaft exact diameter = 5 m3_dia = 3.2, // 3mm hole diameter m3_nut_hex = 1, // 1 for hex, 0 for square nut m3_nut_flats = 5.7, // normal M3 hex nut exact width = 5.5 m3_nut_depth = 2.7, // normal M3 hex nut exact depth = 2.4, nyloc = 4 retainer = 1, // Belt retainer above teeth, 0 = No, 1 = Yes retainer_ht = 3, // height of retainer flange over pulley, standard = 1.5 idler = 1, // Belt retainer below teeth, 0 = No, 1 = Yes idler_ht = 3, // height of idler flange over pulley, standard = 1.5 pulley_t_ht = 11, // length of toothed part of pulley, standard = 12 pulley_b_ht = 0, // pulley base height, standard = 8. Set to same as idler_ht if you want an idler but no pulley. pulley_b_dia = 20, // pulley base diameter, standard = 20 no_of_nuts = 1, // number of captive nuts required, standard = 1 nut_angle = 90, // angle between nuts, standard = 90 nut_shaft_distance = 2.2, // distance between inner face of nut and shaft, can be negative. // ******************************** // ** Scaling tooth for good fit ** // ******************************** // To improve fit of belt to pulley, set the following constant. Decrease or // increase by 0.1mm at a time. We are modelling the *BELT* tooth here, not the // tooth on the pulley. Increasing the number will *decrease* the pulley tooth // size. Increasing the tooth width will also scale proportionately the tooth // depth, to maintain the shape of the tooth, and increase how far into the // pulley the tooth is indented. Can be negative additional_tooth_width = 0.2, // scaling for good fit // If you need more tooth depth than this provides, adjust the following constant. // However, this will cause the shape of the tooth to change. additional_tooth_depth = 0 //mm ) { if (belt_type == "T5") { pulley2(teeth, belt_type, motor_shaft, m3_dia, m3_nut_hex, m3_nut_flats, m3_nut_depth, retainer, retainer_ht, idler, idler_ht, pulley_t_ht, pulley_b_ht, pulley_b_dia, no_of_nuts, nut_angle, nut_shaft_distance, additional_tooth_width, additional_tooth_depth, tooth_spaceing_curvefit (teeth, 0.6523,1.591,1.064), 1.19, 3.264); } } module pulley2(teeth, belt_type, motor_shaft, m3_dia, m3_nut_hex, m3_nut_flats, m3_nut_depth, retainer, retainer_ht, idler, idler_ht, pulley_t_ht, pulley_b_ht, pulley_b_dia, no_of_nuts, nut_angle, nut_shaft_distance, additional_tooth_width, additional_tooth_depth, pulley_OD, tooth_width, tooth_depth) { // calculated constants nut_elevation = pulley_b_ht/2; m3_nut_points = 2*((m3_nut_flats/2)/cos(30)); // This is needed for the nut trap echo (str("Belt type = ",belt_type,"; Number of teeth = ",teeth,"; Pulley Outside Diameter = ",pulley_OD,"mm ")); tooth_distance_from_centre = sqrt( pow(pulley_OD/2,2) - pow((tooth_width+additional_tooth_width)/2,2)); tooth_width_scale = (tooth_width + additional_tooth_width ) / tooth_width; tooth_depth_scale = ((tooth_depth + additional_tooth_depth ) / tooth_depth) ; // ************************************************************************ // *** uncomment the following line if pulley is wider than puller base *** // ************************************************************************ // translate ([0,0, pulley_b_ht + pulley_t_ht + retainer_ht ]) rotate ([0,180,0]) difference() { union() { //base if ( pulley_b_ht < 2 ) { echo ("CAN'T DRAW PULLEY BASE, HEIGHT LESS THAN 2!!!"); } else { rotate_extrude($fn=pulley_b_dia*2) { square([pulley_b_dia/2-1,pulley_b_ht]); square([pulley_b_dia/2,pulley_b_ht-1]); translate([pulley_b_dia/2-1,pulley_b_ht-1]) circle(1); } } difference() { //shaft - diameter is outside diameter of pulley translate([0,0,pulley_b_ht]) rotate ([0,0,360/(teeth*4)]) cylinder(r=pulley_OD/2,h=pulley_t_ht, $fn=teeth*4); //teeth - cut out of shaft for(i=[1:teeth]) rotate([0,0,i*(360/teeth)]) translate([0,-tooth_distance_from_centre,pulley_b_ht -1]) scale ([ tooth_width_scale , tooth_depth_scale , 1 ]) { if ( belt_type == "MXL" ) { MXL();} if ( belt_type == "40DP" ) { 40DP();} if ( belt_type == "XL" ) { XL();} if ( belt_type == "H" ) { H();} if ( belt_type == "T2.5" ) { T2_5();} if ( belt_type == "T5" ) { T5();} if ( belt_type == "T10" ) { T10();} if ( belt_type == "AT5" ) { AT5();} if ( belt_type == "HTD_3mm" ) { HTD_3mm();} if ( belt_type == "HTD_5mm" ) { HTD_5mm();} if ( belt_type == "HTD_8mm" ) { HTD_8mm();} if ( belt_type == "GT2_2mm" ) { GT2_2mm();} if ( belt_type == "GT2_3mm" ) { GT2_3mm();} if ( belt_type == "GT2_5mm" ) { GT2_5mm();} } } //belt retainer / idler if ( retainer > 0 ) {translate ([0,0, pulley_b_ht + pulley_t_ht ]) rotate_extrude($fn=teeth*4) polygon([[0,0],[pulley_OD/2,0],[pulley_OD/2 + retainer_ht , retainer_ht],[0 , retainer_ht],[0,0]]);} if ( idler > 0 ) {translate ([0,0, pulley_b_ht - idler_ht ]) rotate_extrude($fn=teeth*4) polygon([[0,0],[pulley_OD/2 + idler_ht,0],[pulley_OD/2 , idler_ht],[0 , idler_ht],[0,0]]);} } //hole for motor shaft translate([0,0,-1])cylinder(r=motor_shaft/2,h=pulley_b_ht + pulley_t_ht + retainer_ht + 2,$fn=motor_shaft*4); //captive nut and grub screw holes if ( pulley_b_ht < m3_nut_flats ) { echo ("CAN'T DRAW CAPTIVE NUTS, HEIGHT LESS THAN NUT DIAMETER!!!"); } else { if ( (pulley_b_dia - motor_shaft)/2 < m3_nut_depth + 3 ) { echo ("CAN'T DRAW CAPTIVE NUTS, DIAMETER TOO SMALL FOR NUT DEPTH!!!"); } else { for(j=[1:no_of_nuts]) rotate([0,0,j*nut_angle]) translate([0,0,nut_elevation])rotate([90,0,0]) union() { //entrance translate([0,-pulley_b_ht/4-0.5,motor_shaft/2+m3_nut_depth/2+nut_shaft_distance]) cube([m3_nut_flats,pulley_b_ht/2+1,m3_nut_depth],center=true); //nut if ( m3_nut_hex > 0 ) { // hex nut translate([0,0.25,motor_shaft/2+m3_nut_depth/2+nut_shaft_distance]) rotate([0,0,30]) cylinder(r=m3_nut_points/2,h=m3_nut_depth,center=true,$fn=6); } else { // square nut translate([0,0.25,motor_shaft/2+m3_nut_depth/2+nut_shaft_distance]) cube([m3_nut_flats,m3_nut_flats,m3_nut_depth],center=true); } //grub screw hole rotate([0,0,22.5])cylinder(r=m3_dia/2,h=pulley_b_dia/2+1,$fn=8); } }} } } // Tooth profile modules module T5() { linear_extrude(height=pulley_t_ht+2) polygon([[-1.632126,-0.5],[-1.632126,0],[-1.568549,0.004939],[-1.507539,0.019367],[-1.450023,0.042686],[-1.396912,0.074224],[-1.349125,0.113379],[-1.307581,0.159508],[-1.273186,0.211991],[-1.246868,0.270192],[-1.009802,0.920362],[-0.983414,0.978433],[-0.949018,1.030788],[-0.907524,1.076798],[-0.859829,1.115847],[-0.80682,1.147314],[-0.749402,1.170562],[-0.688471,1.184956],[-0.624921,1.189895],[0.624971,1.189895],[0.688622,1.184956],[0.749607,1.170562],[0.807043,1.147314],[0.860055,1.115847],[0.907754,1.076798],[0.949269,1.030788],[0.9837,0.978433],[1.010193,0.920362],[1.246907,0.270192],[1.273295,0.211991],[1.307726,0.159508],[1.349276,0.113379],[1.397039,0.074224],[1.450111,0.042686],[1.507589,0.019367],[1.568563,0.004939],[1.632126,0],[1.632126,-0.5]]); }