On Friday, December 17, 2021 8:43:37 PM EST John Dammeyer wrote:
> Alright.  So it spins really freely but keeping the planetary cluster
> centred is a bit of an issue.  So the attached photo shows roughly (very
> roughly) what I had in mind.
> 
> With the right coupler between the motor and the gear cluster the planetary
> assembly should stay in the same place.  There really isn't any axial load.
>  There is a place for a 40mmx19mm bearing that I happen to have on hand.
> 
> But what about the driven ring gear?  In one of the model shops today I saw
> a package of 100 5.5mm stainless steel balls they sell for putting into
> paint bottles to help mix them up.

Those might work, but are nominally a mm bigger than BB's. And because it will 
be working in a swarf filled environment, the spider ribs should be replaced 
with solid walls. As far as green ring bearings are concerned, it is not going 
to move fast enough to heat. I have printed that cover and the ring container 
housing as one piece with a bearing groove on the outside of the green ring 
and the housing face as one piece with a .2mm gap for dirt sealing on the 
outside, but with a wide enough gap on the inside to stuff the bearing races 
from the inside. They are adjusted in the print to have a very slight preload, 
and do a great job of restraining the green ring. The housing on the blue side 
has a wrapper wall that extends up past the blue ring which is keyed to this 
housing, and extends past the green ring far enough that the outer race of the 
bearing mentioned a few lines up, then has the outer race super-glued flush 
with the edge of the wall. I have a keyed hole in this moving face that will 
have a printed gt3 pulley for a belt driving the chucks axle about 4" away. 
The chuck axle will carry a 60 tooth belt, and this moving face's keyed 
central hole will have about a 42 or 43 tooth gt3 sprocket glued into the 
hole. The outer edge bearing of BB's is its only support. Smoother balls might 
be better, but with the texture of the printed plastic races, a BB that's .
05mm out of round simply gets lost in the noise of the plastic as its laid 
down. I stuff BB's in until there's no room for another BB.

After stuffing the BB's in, I then roll the whole thing on the desk here, 
putting half my weight on the bearing as it turns, and roll it till the high, 
tight spots are pretty well mashed down.  And its $70+ dollars cheaper than a 
commercial bearing that big. Its 75mm in diameter at the center of the balls 
circle. And it Just Works, still is after around 90 days non-stop, I'm life 
testing it.
 
> Seemed and ideal size for a bearing race between the two ring gears.  Kind
> of like what Gene H. stated he did on his setup.  (Pictures?)

Are too big from my camera, 6+ megabyte jpg's.and John K. blocks the post even 
when I shrink them to under 200k in gimp.

> So the Blue
> Gear is fixed.  The Green Rotates.  The lazy susan like bearing between
> handles axial pressure in the direction of the blue gear.  But really the
> only thing holding up the green ring gear is the planetary assembly.
> 
> Say we wanted to mount a face plate or chuck onto the green gear.  I'm open
> to ideas on how to stabilize that.  Sketches would be great.

Its not strong enough for that, so I use two pulleys and a belt to get to the 
A axis chucks axle. So the huge majority of the beating a mill tool can exert 
is taken by the bearings on that nominally 1" in diameter steel axle.

> Methinks a part that surrounds the blue gear and extends over the green and
> they also have a bearing race between.  Or we make a similar bearing mount
> to the rear one for the front with the gear cluster holding this in place
> extended out to the bearing.  Now the faceplate is attached to this.  But a
> lot more axial twist on the small bearing in the middle.

Because mine is loose belt, and the motor shaft is the armature bearings, the 
only other bearings in mine are the two printed ones wrapped around the 
outside of the eccentric armature, the wave generator. The outer race then has 
to flex as it turns, about 2mm total. Two of those to press equally on the top 
and bottom insides of the loose belt. I have attached the .scad file if anyone 
wants to see it.  Amateur coder at work warnings. At line 584 is a 
'mode" value, set it 1 to 9 to see the various parts in the preview window of 
OpenSCAD, latest beta version.

Or go get a bottle of BB's and some PETG and print it. But my rings are a bit 
narrow, so I'll eventually make them 4 or 5mm wider in addition to  the larger 
output sprocket.

> Thanks
> John


Cheers, Gene Heskett.
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>
// an attempt to make a 30/1 harmonic driver for my new smaller drive
// get data from prev. files because printer is about 1 or 2% undersized.
//for mode; see line 529 1=build houseing,2=build spacer, 3= new armature,
// 4=armature bearings, 5=innerspline, 6=outcup, 7=60 tooth outer,
// 8=62 tooth outer. 9=timing pulley for output belt
// this is intended to be fitted to the A drive supplied with a 4 axis
// 6040 milling machine which due to low gear ratio, doesn't have the cajones to
// hold position. Not in this file, I've made a timing pulley that drives over the one
// supplied and replaces the huge belt with a 83 tooth gt3 belt, with an offset
// to align with this drives output pulley.
// And I am in the process of making it for a direct on the motor mount
// whereas the original idea was to mount it on the back face of the
// mount which on the targetted A drive is 1/2" or 12mm thick. However,
// mounting it directly on the motor will put the end of the motor shaft
// into the middle of the output sprocket. Since the motor shaft is an
// 8mm modified dflat, a 10mm hole is now cut thru the bore of the output
// sprocket. In that event, the armature must lose its extended hub but that
// is yet to be done. It needs all the reinforcement it can get. Stay tuned.
IDofspl=67.05;
splsocht=6.00;
ODofCup=IDofspl+splsocht*2.5;
sink=.745;// jack up bolt head countersink to top of 3.1 mm thick disk
sht=1.513;// height of countersink+noise in preview fudge
$fn=360;// make circles with 1 degree flats
reghole=38.3;// motor registration hole + printer undersize fudge, exact!
nemahole=47.2/2; // one side of square pattern, 47.1 is official target, 
ddht=3.1;//input panel with nema 23 bolt pattern 
ddia=5.1;//5mm bolt clearance
spcringh=6.0;//could be 6.3
spcringh1=6.0;//vertical offset
spcringd1=82.76;// outside of ring, id of surround band
spcringd2=67.9;// inside of spacer ring, press fit on spline od
wrapperh=18.5;//surround band height.
//globals for keys
t1=spcringd1;
t2=spcringd2+.3;
y=spcringh+.05;
z1=4.2;// key sizes, will need tweaked to fit well, probably by .2 + & -
z2=3.8;
z3=2.3;
z4=1.8;
// globals for output timing pulley
toothType=1;
toothWidth = 1.14; // Teeth of PULLEY, that is. Larger=tighter fit of teeth.
// make motor faceing disk
module disk()
{
    translate([0,0,splsocht/4]) // set z bottom at 0
    difference()
    {
        cylinder(h=splsocht/2,d=spcringd1,center=true);
        cylinder(h=splsocht/1.5,d=reghole,center=true);// make registration
       // hole in center
        translate([nemahole,nemahole,0])cylinder(h=ddht,d=ddia,center=true);
        translate([-nemahole,nemahole,0])cylinder(h=ddht,d=ddia,center=true);
        translate([-nemahole,-nemahole,0])cylinder(h=ddht,d=ddia,center=true);
        translate([nemahole,-nemahole,0])cylinder(h=ddht,d=ddia,center=true);
// Now set flat head countersinks at 45 dgree angle so screw head is buried
        translate([nemahole,nemahole,sink])cylinder(h=sht,d1=ddia,d2=10.10,center=true);
        translate([-nemahole,nemahole,sink])cylinder(h=sht,d1=ddia,d2=10.10,center=true);
        translate([-nemahole,-nemahole,sink])cylinder(h=sht,d1=ddia,d2=10.10,center=true);
        translate([nemahole,-nemahole,sink])cylinder(h=sht,d1=ddia,d2=10.10,center=true);
    }  
};


module spacer(fudge1,fudge2)
{
    echo(62,fudge1,fudge2);
    translate([0,0,spcringh1/2])
    difference()
    {
        //make outer a hair smaller
        cylinder(h=spcringh,d=spcringd1+fudge1,center=true);
        // add jack screw holes
        keys5(75,y,3.0);
        // make inner a hair bigger
        cylinder(h=spcringh+.01,d=spcringd2+fudge2,center=true);
        echo(70,spcringd1+fudge1,spcringd2+fudge2);
       // is outer and inner diameter of spacer= 82.36,68.0 mm
    }
};

module wrapper() // housing outer wall
{
    translate([0,0,wrapperh/2])
    difference()
    {
        cylinder(h=wrapperh,d=90,center=true);
        cylinder(h=wrapperh+.01,d=spcringd1,center=true);
    }
};

module keys4(t,y,z)
{ // t is diameter of circle of keys, y is height of cylinder, z is diameter.
    if(key!=0)
    {    
        echo(89,t,y,z);
        for(nn=[0:15:359])
        {
            rotate([0,0,nn])
            translate([t/2.0,0,0]) // fix diameter of circle of keys
            cylinder(h=y,d=z,center=true);
        }
    }
};

module keys5(t,y,z)
{ // t is diameter of circle of keys, y is height of cylinder, z is diameter.
    if(key!=0)
    {    
        echo(105,t,y,z);
        for(nn=[0:60:359])
        {
            rotate([0,0,nn+6.0])
            translate([t/2.0,0,0]) // fix diameter of circle of keys
            cylinder(h=y,d=z,center=true);
        }
    }
};

module armature()
{
    // making this a mm smaller (rd) to make room for stronger bearing OD
    // 6-30-21 14:12
    // and now needs a method to restrict length of hub extention to allow
    // a direct mount on a nema 23 motor.
    rd=38.9;// is diameter for driving elipse
    radarm0=(rd/2.0);// is radius of driver elipse
    bearingod=17.00;
    bearingrad=(bearingod/2.0);
    radarm1=(radarm0 - bearingrad);
    radarm2=(radarm1-1.0);
    hubbore=8.28;// is decent fit on motor shaft, check your printer!
    radarm3=(radarm2-hubbore);// is now radius
    bearthk=6.0;// but not used for armature
    armthk=12.5;//
    armtran=(armthk/2);
    armlen=(radarm3-hubbore);
    hubhgt=12.0;// only big 12 used
    // below dflat needs motor shaft ground with cbn wheel for 
    // bigger flat=stronger torque, no alu hub needed
    dflat=(hubbore*0.64);// fudged for zero slip room
    module disc(r) { cylinder(h=armthk*1.65,r=r);}
    $fn=360;
    rr=rd/2;
    rf1=(1.15/rr);// all this to make scale values, 1.0 = no scale
echo(148,rd,rr,rf1);// is .05 of 40=2mm so elipse is plus or minus 2.
    extoff=20;// hub extension offset upward
    hubextd=20;// hub extension OD
echo(151,rd,rr,rf1);
    difference()
    {
      difference()
      {
        scale([1+rf1,1-rf1,1.015]) disc(rr);// starter for diff, is only
       // elipse here
        difference()// everything below stays round until last 3 lines
        {
          translate([0,0,11.1]) scale([1,1,.48]) disc(21); //take off the top
          translate([0,0,10.7]) cylinder(h=hubhgt*1.8,d=hubextd,center=true,$fn=90);
          echo(138,hubhgt*1.8);
        }
        difference()
        {
          translate([0,0,-.05])cylinder(h=hubhgt*1.75,d=hubbore,$fn=90);
          // the shaft hole is round here
          translate(v=[dflat+.5,0,-.2])// move square to side, makes dflat
          //above shifts next 2 lines into the bore to make it a D flat
          rotate(45)// rotate the square 45 degrees, puts broad face to bore
          cylinder(h=hubhgt*1.9,d=hubbore+1.9,$fn=4);//$fn=4 gives square from cyl.
        }
      }
    }// added longer hub to reach more motor shaft thru 20.5mm hole in mount,
    // works well
};

module armbearing()
{
// my feeble attempt at generating a ball bearing using bb's.
// NOW MODed for smaller drive, in ~/Dlds/3dp.stf/smaller-harmonic-drive
// armature is eccentric, 37.60mm min to 41.66mm max
// adjust dmtr till it fits the armature when distorted by it.
// was 40.3 but in PETG fit is tighter
    fg=.45; // fudge for over extrusion
    vg=.20;//height of layer
    india=38.385+fg; // in mm's of ID, inner should rotate with
    // armature w/o walking
    outdia=52.44-fg; // outer diameter, same as loose belt inner
    height=6-vg; // in mm's, armature is 11.5 mm wide uses 2 of these
// everything below is generated center=true
// which means we're dealing in radius
    ctr_ht=(height*.50000); // 1/2 height,mults are faster
    inrad=india*.50000; // rad of inner diameter
    outrad=outdia*.50000;// rad of outer diameter
    bbtrkd=(outdia+india)*.50000; // to center it
    bbtrkr=(outrad+inrad)*.50000; // ditto the radius
    echo(198, inrad,outrad,bbtrkr,bbtrkd);
    //adjust bearing size till it fits
    bb=4.35+.2; // crosman bb so when inner is preloaded its about right. Was 4.45,
   // slightly tight. This is close, rolls easy once lumps are mashed down
    bbgap=.40; // wide enough to make inserting bb's easier
// how many bb's?
    racircum=(inrad+outrad)*.50*PI;//length of bb track
    echo(205, PI, racircum);
    bbs=racircum/bb;
    echo(207,bb,bbs);
    $fn=90;
// draw it
    difference()
    {
        cylinder(h=height,d=outdia);// big outer for a base
        translate([0,0,-.05])cylinder(h=height+.1,d=india);// subtract inner
        for(fn=[0:2:359]) // now cut ball track and insertion slot
        {
            rotate(fn)
            {
                union()
                {   // subtract bb
                    translate([bbtrkr,0,2.90])rotate([90,0,0])cylinder(h=1,d=bb,true);
                    // subtract bb insertion slot
                    translate([bbtrkr,0,-.20])scale([bbgap*.3,.1,6.1])
                    rotate([0,0,45])cylinder(d=bbtrkr, h=1, $fn=4);
                }
            }
        }
    }
};

module innerspline()
{   // PETG now on printer, 
// and nozzle troubles started, plugged up whole damned hotend.
// new example, low ratio 30/1 harmonic drive floating splined belt. use lots of infill, 55% gyroid
    teeth = 60; // number  of teeth or splines
    arcx = ( 360 / teeth ); // arc of circle per tooth, is 6 degrees   
    $fr = 0.000000;// space holder
// adjust this to just barely get an overlap at inner corners of spline triangle, but must
// have enough overlap for continuous infill! Else retraction hell strikes.
    toothdia = arcx/1.35;// no bigger then needed to get infill connections,
//  larger divisor=smaller, is 1.40 now
// adjust this for outer teeth fit in internal spline
    toothrad=54.70 / 2.000;// make radius was 55.09, reduce backlash but don't compress it either
// adjust this to thin or thicken flex valleys
// when retraction hell strikes, render time jumps nearly a hour!!!!!
    linerdia=53.00; // thins web at bottom of spline, helps flex if larger,
//  rch too big at 53.38 try 53.36 later, its slipping on the bearing races,
//  after 10 days running, so is now 53.20 to tighten it 16 rch more. 
// and this time from PETG on the BIQU printer w/H2 head at 230 and 55.
// at same time, reduce toothrad until green starts to go away, then increase
// to get it all back.   
    height=12;
    tranz=height / 2.000;
    echo (236,teeth,arcx,toothdia,toothrad,linerdia) ;
    union()
    { // make splines first
        for($fr=[ 0: 6 : 359 ])
        {
            rotate([0, 0, $fr]) //make teeth
            translate([toothrad, 0, tranz])  // reposition at toothrad
            cylinder(d=toothdia, h=height, $fn=3, center=true); // make triangle
        // made triangles, now smooth inner wall by making 2 rings, inner rad same as base of teeth
        }
        difference() // construct smooth liner for base of tooth, 2nd arg for union
        { //outer liner, merges with base of tooth in union
            translate([0,0,tranz])cylinder(d=linerdia, h=height+.01, $fn=60,center=true);
            // inner liner to make bottoms of teeth circulsr
            translate([0,0,tranz])cylinder(d=linerdia-.6, h=height+.02, $fn=360,center=true);
        } // innards needs smooth finish
    }
};

module outcup() // has runaway, works but takes way too long to render,
// 7m:29secs
{
// new output disk to contain 62 tooth spline
// and incorporate for space savings the output shaft bearings
// and a timing belt pulley for output coupling.
// will superglue timing pulley in 20mm center hole, after verifying fit.
    IDofspl=68.00;// to fit OD of 60 or 62 tooth spline
    splsocht=6.0;// height of cup for spline
    ODofCup=IDofspl+splsocht*2.5;// incorporate bearing in space
    echo(265,ODofCup);
    //printer is undersize, make bb's bigger, calcs at 4.43
    bb=4.40;// crosman bb dia plus clearance, broken inner on first stuff
   // try bigger
    // need some data for bearing module
    ctr_ht=splsocht/2;// center bb groove vertically
    innr=ODofCup-splsocht/2;// get radius of bb groove
    $fn=360;
    // first, build capping plug as base
    translate([0,0,splsocht/4]) // set z at 0
    difference()
    {
        cylinder(h=splsocht/2,d=IDofspl,center=true);// make hole in center
        cylinder(h=splsocht/1.5,d=20,center=true);
    }; //set cap bottom  at z0.00 ends difffr line 259

    translate([0,0,splsocht-1.5])
    difference()
    { // build output bearing
        // builds inner|outer walls of splined ring socket
        cylinder(h=splsocht+3,d=ODofCup,center=true);// outer
        cylinder(h=splsocht+4,d=IDofspl,center=true);//inner,1st subtract
        echo(289,IDofspl);
        bearing(); // make bearing groove, and separate the rings
    }; // ends difference from line 266

    module bearing()
    {
        rotate_extrude()// make races thicker, groove deeper, recenter
        translate([ODofCup/2.20,1.0])
        union()
        {
            scale([1.01,1,1]) circle(d=bb);//make groove slightly deeper
            union()
            {
                square([.5*splsocht, 1.2*splsocht],center=true);
                square([.35,13],center=true);
            }
        }
    }
    // add keys to lock output sprocket from rotating in socket
    translate([0,0,1.5])keys5(19.8,3.01,2.0);
};

module outspline60() // mode must be 7
{
    aa=51.0000; // was 69.00000000 a blond one too big
    xx=5.9800;//thickness
    dd1=63.25; 
    dd0=67.7; // outer a bit snug in output cup, reduced from 67.75
    toothrad60=31.3; // getting close, but not global
    fw = ([ 360.00000000 / 60.00000000 ]); // arc of circle per tooth, works but...
    fr = [ 0.00000000]; // establish its storage
echo ("319", aa, xx, dd0, dd1, fr, fw,toothrad60) ;  // echo? yes, once
    difference()
    { // the outside smoother
        cylinder(d=dd0, h=xx, $fn=360); //outer is fussy
        translate([0,0,-.005]) cylinder(d=dd1, h=xx+.01, $fn=360);
        //but the inner isn't
    }
    // use this for 60 teeth
    for(fr=[0:6:359 ])
    { 
        rotate([0,0,fr])
        translate([toothrad60, 0.00, 0.00])  // raised .20mm mv x only
        scale(v= [.1,.1,1])
        rotate(180)// switch rotate on for outers and readjust sizes
        cylinder(d=aa, h=xx, $fn=3); // make thick triangle
    }  // switch h=5.9500 for outer rings
};

module outspline62() // mode must be 8?
{
    aa=51.0000; // was 69.00000000 about 30 blond ones too big
    xx=5.98;//thickness
    dd1=64.2000;
    dd0=67.8;
    toothrad62=31.8;// cirle size of teeth, not global
    fw = ([ 360.00000000 / 62.00000000 ]); // arc of circle per tooth, works but...
    fr = [0.00000000]; // establish its storage?
    echo (347, aa, xx, dd0, dd1, fr, fw) ;  // echo? yes, once
    difference()
    { // the outside smoother
        cylinder(d=dd0, h=xx, $fn=360); //outer is fussy
        translate([0,0,-.005])cylinder(d=dd1, h=xx+.01, $fn=360); //but the inner isn't
    }
    // use this for 62 teeth
    for(fr=[0:5.8064516129:359])
    { 
        rotate([0,0, fr])
        translate([toothrad62, 0.00, 0.00])
        scale(v= [.1,.1,1]) // might use a small xy
        // differential here to improve tooth fit if needed.
        rotate(180)
        // cylinder. switch rotate on for outers and readjust sizes
        cylinder(d=aa, h=xx, $fn=3); // make thick triangle
    }
};

module outputpulley(shaft_clear)
{ // thank you Erik de Bruijn
// By Erik de Bruijn <[email protected]>
// License: GPLv2 or later
//
// Goal: the goal of this parametric model is to generate a high quality custom
// timing pulley that is printable without support material.
// NOTE: The diameter of the gear parts are determined by the belt's pitch and
// number of teeth on a pully.
// updates:
// numSetScrews allows you to specify multiple set screws, 1 or 3 are useful
// values. With 3 you will be able to center the axis.

// //////////////////////////////
// USER PARAMETERS
// //////////////////////////////

// Pulley properties
    shaftDiameter = shaft_clear; // the shaft at the center, will be subtracted from the
// pulley. Better be too small than too wide.
    hubDiameter = 20.0; // if the hub or timing pulley is big enough to fit a nut,
// this will be embedded. expand for good fit.
    hubHeight = 3; // the hub is the thick cylinder connected to the pulley to allow a set screw to go through or as a collar for a nut.
    flanges = 2; // the rims that keep the belt from going anywhere
    hubSetScewDiameter = 0; // use either a set screw or nut on a shaft. Set to 0 to not use a set screw.
    numSetScrews = 0;
    numTeeth = 23; // this value together with the pitch determines the pulley diameter
//    toothType = 1; // 1 = slightly rounded, 2 = oval sharp, 3 = square. For square, set the toothWith a little low.

// Belt properties:
    pitch = 3.3; // distance between the teeth
    beltWidth = 7.5; // the width/height of the belt. The (vertical) size of the pulley is adapted to this.
    beltThickness = 1.30; // thickness of the part excluding the notch depth!
// which does not clarify. If the belt is meaasured in a gully, at 1.3mm, its marginally
// too big a circle, and if overall, at 2.5mm, its obviously too small at tooth spacing.
// so trying 2 for belt tooth fit. And elephants foot is being a problem too.
// plus a huge flair UPWARDS for the top flange outer edge. BACK to 1.3 for thickness
    notchDepth = 1.20; // make it slightly bigger than actual, there's an outward
// curvature in the inner solid part of the pulley, smaller = deeper generally


// //////////////////////////////
// Includes
// //////////////////////////////
//<teardrop.scad>
// See the bottom of the script to comment it out if you don't want to use this include!
//

// //////////////////////////////
// OpenSCAD SCRIPT
// //////////////////////////////

    PI = 3.14159265;
    $fs=0.2; // def 1, 0.2 is high res
    $fa=3;//def 12, 3 is very nice

    pulleyDiameter = pitch*numTeeth/PI;

    if(hubSetScewDiameter >= 1) // set screw, no nut
    {
        timingPulley( pitch,beltWidth,beltThickness,notchDepth,numTeeth,flanges,    shaftDiameter,hubDiameter,hubHeight,hubSetScewDiameter);
    }

    if(hubSetScewDiameter == 0) // use a nut
    {
        if(pulleyDiameter >= hubDiameter) // no hub needed
        {
            difference()
            {
                timingPulley(
                pitch,beltWidth,beltThickness,notchDepth,numTeeth,flanges,shaftDiameter,hubDiameter,0,hubSetScewDiameter);
            translate([0,0,-6]) nut(8,8);
            }
        }
        if(pulleyDiameter < hubDiameter)
        {
            difference()
            {
                timingPulley(
                pitch,beltWidth,beltThickness,notchDepth,numTeeth,flanges,shaftDiameter,            hubDiameter,hubHeight,hubSetScewDiameter);
//		        translate([0,0,8]) nut(8,12);
            }
        }
    }
};

// also in ~/RepRap/Object Files/nuts.scad
module nut(nutSize,height)
{
    // Based on some random measurements:
    M3 = 5.36;
    M5 = 7.85;
    M8 = 12.87;
    hexSize = nutSize + 12.67 - 8; // only checked this for M8 hex nuts!!
    union()
	{
        for(i=[0:5])
		{
			intersection()
			{
				rotate([0,0,60*i]) translate([0,-hexSize/2,0]) cube([hexSize/2,hexSize,height]);
				rotate([0,0,60*(i+1)]) translate([0,-hexSize/2,0]) cube([hexSize/2,hexSize,height]);
            }
		}
	}
};

module timingPulley(
	pitch, beltWidth, beltThickness, notchDepth, numTeeth, flanges, shaftDiameter, hubDiameter, hubHeight, hubSetScewDiameter)
{
    totalHeight = beltWidth + flanges + hubHeight;
    difference()
    {
        union()
        {
            timingGear(pitch,beltWidth,beltThickness,numTeeth,notchDepth,flanges);
//			hub(hubDiameter,hubHeight,hubSetScewDiameter);
        }
        translate([0,0,5.5])shaft(22,shaftDiameter);
    }
    module shaft(shaftHeight, shaftDiameter)
    {
        cylinder(h = shaftHeight, r = shaftDiameter/2, center =true);
    }

    module timingGear(pitch,beltWidth,beltThickness,numTeeth,notchDepth,flanges)
    {
        flangeHeight = 0;
        if(flanges==1)
        {
            flangeHeight = 2;
        }
	    toothHeight = beltWidth+flangeHeight*2;
        circumference = numTeeth*pitch;
        outerRadius = circumference/PI/2-beltThickness;
        innerRadius = circumference/PI/2-notchDepth-beltThickness;
        union()
        {
            //solid part of gear
            translate([0,0,-1+toothHeight/2])
            cylinder(h = toothHeight+1.5, r = innerRadius, center=false);
            //teeth part of gear
            translate([0,0,3.7+toothHeight/2])
            teeth(pitch,numTeeth,toothWidth,notchDepth,toothHeight);
            // flanges:
            if(flanges>=1)
            {
                //top flange, might do away with to see how belt fits teeth
                translate([0,0,11.19])
                cylinder(h = 1.1, r1=outerRadius,r2=outerRadius+1,center=true);
                //bottom flange
                translate([0,0,3.4])
                cylinder(h = 1.0,r1=outerRadius+1,r2=outerRadius,center=true);
                translate([0,0,3.3])
                cylinder(h = .3, r=11.2, center=true); //upper seat flange
                translate([0,0,1.5])
                cylinder(h=3, r=9.95,center=true); //lower cylinder
                //translate([0,0,3.4]) cylinder(h = 1.1,r1=outerRadius+1,r2=outerRadius);
            }
        }
    }
    module teeth(pitch,numTeeth,toothWidth,notchDepth,toothHeight)
    {
        // teeth are apart by the 'pitch' distance
        // this determines the outer radius of the teeth
        circumference = numTeeth*pitch;
        outerRadius = circumference/PI/2-beltThickness;
        innerRadius = circumference/PI/2-notchDepth-beltThickness;
        echo("Teeth diameter is: ", outerRadius*2);
        echo("Pulley inside of teeth radius is: ", innerRadius*2);
		for(i = [0:numTeeth-1])
        {
            rotate([0,0,i*360/numTeeth]) translate([innerRadius,0,0]) 
            tooth(toothWidth,notchDepth, toothHeight,toothType);
        }
    }
    module tooth(toothWidth,notchDepth, toothHeight,toothType)
    {
        if(toothType == 1)
        {
            union()
            {
                translate([notchDepth*0.25,0,0]) 
                cube(size = [notchDepth,toothWidth,toothHeight+1],center = true);
                translate([notchDepth*0.75,0,0]) scale([notchDepth/4, toothWidth/2, 1]) 
				cylinder(h = toothHeight+1, r = 1, center=true);
            }
        }
        if(toothType == 2)
            scale([notchDepth, toothWidth/2, 1]) cylinder(h = toothHeight, r = 1, center=true);

        if(toothType == 3)
        {
            union()
            {
                #translate([notchDepth*0.5-1,0,0]) cube(size = [notchDepth+2,toothWidth,toothHeight],center = true);
                //scale([notchDepth/4, toothWidth/2, 1]) cylinder(h = toothHeight, r = 1, center=true);
            }
        }
    }
};

//echo(577,$fn,$fs,$fa,$vpr);
mode=4;//selects module to render, 1 to 9
key=1;//set to 0 to build without keys - sign WAS a size trigger, not any more

if(mode==1) // do base houseing
{
    t=t1;
    z=z2;
    echo(572,t,y,z);
    union()
    {
        disk();
        if(key!=0)translate([0,0,6]) keys4(t,y,z);//optional
        wrapper();
    }
};

if(mode==2) // do spacer with optional keys, holds 60 tooth outer ring in housing
{
    fudge1=-.4;
    fudge2=.1;
    difference()
    {
      echo(587,t1,t2,y,z1,z2,z3,z4);
      echo(588,fudge1,fudge2);
        difference()
        {
            union()
            {
                spacer(fudge1,fudge2);
                // t2 is inside face
                if(key!=0) translate([0,0,3])keys4(t2+fudge2,y,z4); //optional
            }// t1 is outside face
            if(key!=0) translate([0,0,3])keys4(t1,y,z1); //optional
        }
    }
};


if(mode==3) armature();// do eliptical armature with extended hub
if(mode==4) armbearing();// make bearing between OD of armature and ID of innerspline
if(mode==5) innerspline();// make floating spline
if(mode==6) //make output cup, contains 62 tooth spline
{
    outcup();
    if(key!=0)
    {
        translate([0,0,6])keys4(t2,y,z4);
    }
};

if(mode==7)
{
    difference()
    {
        outspline60();
        // add 2mm jack screw holes
        translate([0,0,2.97])keys5(64.55,y,2.0);
        if(key!=0)
        {
            translate([0,0,2.97])keys4(t2,y,z3);
        }
    }
};

if(mode==8)
{
    difference()
    {
        outspline62();
        // add 2mm jack screw holes, but too small
        //translate([0,0,2.97])keys5(64.9,y,2.0);
        if(key!=0)
        {

            translate([0,0,2.97])keys4(t2,y,z3);
        }
    }
};

if(mode==9)
{
    shaft_clear=10;
    difference()
    {
        outputpulley(shaft_clear);
        translate([0,0,1.5])keys5(19.7,3.01,2.3);
    }
};
// It is not really intended to be repairable if its broken,
// just print and assemble another.
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to