C : START OF THE PROGRAM C : * --------------------------------------------------- * C : C : Program to create a gear tooth involute profile C : and create a solid object in SDRC IDEAS C : Master Series 4 C : Kris Kolady (JCI CAD/CAM Methods) C : Scott Zimmerlee SDRC C : * --------------------------------------------------- * C : K : C : C :----------------------------------------------------------- C : SHOW COMMENT IN ALL I-DEAS WINDOWS C :----------------------------------------------------------- K : #OUTPUT "*************************************************" K : #OUTPUT "SPUR AND HELICAL GEAR GENERATION PROGRAM" K : #OUTPUT "" K : #OUTPUT "WARNING: PROGRAM WILL PUT AWAY ALL PARTS ON " K : #OUTPUT "WARNING: THE WORKBENCH. " K : #OUTPUT "*************************************************" K : #MENU "Read warnings on list window. Continue?" cont_ans 1 2, K : "Y - YES", K : "N - NO" K : #if( Z_INP_STAT eq 0 ) then goto Clean_Exit K : #if( Z_INP_STAT eq 1 ) then goto Clean_Exit K : #if( cont_ans eq 2 ) then , K : #GOTO Clean_Exit K : cl C : #on_error pause K : #DELETE ALL C : ---------- DON'T REMOVE UPDATE GRAPHICS K : /ma pu all K : K : K : K : K : K : K : K : K : K : /cr m3 l pp k 0,0,0 0,.01,0 K : $ /de K : ALL K : ALL K : K : K : C : --------------------------------------------- C : C : -----------------------------Variable Declarations K : #DECLARE xval(100) K : #DECLARE yval(100) C : C : ---------------------------- INPUT C : C : Get number of teeth for the gear K : #In_N: K : #INPUT "Enter number of teeth on gear" N 12 K : #if( Z_INP_STAT eq 0 ) then goto Clean_Exit K : #if( Z_INP_STAT eq 1 ) then goto Cfamily C : C : Get width of the gear K : #In_W: K : #INPUT "Enter width of gear" W 1 K : #if( Z_INP_STAT eq 0 ) then goto Clean_Exit K : #if( Z_INP_STAT eq 1 ) then goto Cfamily C : C : Get the pressure angle for the gear K : #In_dphi: K : #INPUT "Enter the pressure angle for the gear" dphi 20.0 K : #if( Z_INP_STAT eq 0 ) then goto Clean_Exit K : #if( Z_INP_STAT eq 1 ) then goto In_N C : C : Get the helix angle for the gear K : #In_si: K : #INPUT "Enter the helix angle(deg) for the gear" si 0.0 K : #if( Z_INP_STAT eq 0 ) then goto Clean_Exit K : #if( Z_INP_STAT eq 1 ) then goto In_dphi C : C : Get the pitch diameter for the gear K : #In_PD: K : #INPUT "Enter the pitch diameter for the gear" PD 12 K : #if( Z_INP_STAT eq 0 ) then goto Clean_Exit K : #if( Z_INP_STAT eq 1 ) then goto In_si C : C : Get the Circular thickness at the pitch circle K : #In_Ct: K : #INPUT "Enter circular thickness at the pitch circle" Ct 1.925 K : #if( Z_INP_STAT eq 0 ) then goto Clean_Exit K : #if( Z_INP_STAT eq 1 ) then goto In_PD C : C : Get the Outer diameter of the gear K : #In_Odia: K : #INPUT "Enter the outer diameter of the gear" Odia 15 K : #if( Z_INP_STAT eq 0 ) then goto Clean_Exit K : #if( Z_INP_STAT eq 1 ) then goto In_Ct C : K : /V E ; 0.0 0.0 1.0 ; C : C : --------------------------------------------------------------- C : REDISPLAY C : --------------------------------------------------------------- K : REDI C : C : ---------------------------------------------------------------- C : CHANGE OF DEGREES INTO RADIANS C : ---------------------------------------------------------------- K : #phi=dphi*3.14159/180 K : #cphi=cos(dphi) K : #sphi=sin(dphi) C : C : Transformation angle K : #trn=90+dphi K : #ctrn=cos(trn) K : #strn=sin(trn) C : C : Calculate the diametral pitch K : #R=PD/2.0 K : #Pn=N/(PD * cos(si) ) C : C : Echo the inputs and prompt for confirmation K : #OUTPUT "################The input values are: " K : #OUTPUT "### Number of Teeth " N K : #OUTPUT "### Pressure Angle " dphi K : #OUTPUT "### Helix Angle " si K : #OUTPUT "### Pitch Diameter " PD K : #OUTPUT "### Tooth Thickness " Ct K : #OUTPUT "### Outside Diameter " Odia K : #OUTPUT "### Calculated Diametral Pitch " Pn K : #OUTPUT "### Calculated Pitch Radius " R C : K : #MENU "Check inputs in list window. Continue?" Chk_Inp 1 2, K : "CO - CONTINUE", K : "RI - REENTER INPUTS" K : #if( Z_INP_STAT eq 0 ) then goto Clean_Exit K : #if( Z_INP_STAT eq 1 ) then goto In_Odia K : #if( Chk_Inp eq 2 ) then goto In_N C : C : Half tooth angle at pitch point K : #tang=-(Ct*360)/(4 * 3.14159 * R) K : #ctang=cos(tang) K : #stang=sin(tang) C : Initialize theta K : #output "phi " phi K : #theta=-phi K : #i=1 C : C : Loop through and calculate the points C : #################################### POINTS C : K : #OPEN pnts "point.dat" K : #WRITE pnts "K :/cr m3 sp key " C : K : #pro_loop: C : K : #dtheta=theta*180/3.14159 K : #stheta=sin(dtheta) K : #ctheta=cos(dtheta) C : K : #xint=(theta * stheta)+ctheta-1.0 K : #yint=stheta-(theta*ctheta) C : K : #xint=-R*( (sphi * stheta) + (cphi * xint) ) K : #yint=R*( (sphi * (1-ctheta)) + (cphi * yint) ) C : K : #xnew=(xint*ctrn)+(yint*strn) K : #ynew=-(xint*strn)+(yint*ctrn)+R C : K : #xval(i)=(xnew*ctang)+(ynew*stang) K : #yval(i)=-(xnew*stang)+(ynew*ctang) C : C : ************** Write values to a text file... ********************** C : C : #WRITE pnts format=" (2f6.3)" xval(i),yval(i) K : #WRITE pnts "K : ", xval(i), " ", yval(i) C : K : #i=i+1 C : C : Increment theta K : #theta=theta+(4.0*3.14159/180.) C : C : Check for termination K : #if( xval(i-1) le 0 ) then goto pro_loop C : K : #WRITE pnts "K : done okay done" K : #WRITE pnts "E : " K : #CLOSE pnts C : C : --------------------------------------------------------------- C : CUTTING ARC C : --------------------------------------------------------------- K : #tang=xval(1)/yval(1) K : #tang=atan(tang) C : K : #duang=-(180.0/N)-tang K : #cuang=cos(duang) K : #suang=sin(duang) C : K : #xc=(xval(1)*cuang)+(yval(1)*suang) K : #yc=-(xval(1)*suang)+(yval(1)*cuang) C : C : --------------------------------------------------------------- C : END POINT OF THE ARC C : --------------------------------------------------------------- C : K : #l=(xc*xc)+(yc*yc) K : #l=sqrt(l) C : K : #xe=xval(1)-xc K : #ye=yval(1)-yc K : #rsqr=sqrt((xe*xe)+(ye*ye)) K : #radius=l-rsqr K : #r=rsqr/l C : K : #xe=xc-(r*xc) K : #ye=yc-(r*yc) C : C : --------------------------------------------------------------- C : THE END OF CALCULATIONS C : --------------------------------------------------------------- K : #OUTPUT "################################## END OF CALCULATIONS" C : C : C : ---------------------------------------------------------------- C : DRAWING OF THE INVOLVE SPLINE C : ---------------------------------------------------------------- C : K : /f pr r fil "point.dat" okay C : K : #OUTPUT "################################## THE END OF DRAWING" C : --------------------------------------------------------------- C : DRAWING OF THE ARC C : --------------------------------------------------------------- C : #OUTPUT "STARTING OF DRAWING OF THE ARC ***********************" C : C : K : $ /CR m3 A K : S K K : xc yc K : xval(1) yval(1) K : xe ye K : D C : C : #OUTPUT "####################### THE END OF DRAWING OF THE ARC" C : C : --------------------------- C : Reflect curves about axis C : --------------------- K : $ /mo re K : LAB K : K : C K : c1 K : c2 K : K : AXI K : YZ K : K : C : --------------------------------------------------------------- C : Draw the Outer diameter circle C : --------------------------------------------------------------- C : #OUTPUT " BEGINING OF DRAWING THE OUTER DIAMETER CIRCLE *******" C : K : #Oradius=Odia/2 K : /CR m3 C K : R K K : 0.0 0.0 K : Oradius K : D C : K : C : #OUTPUT "######## THE END OF DRAWING THE OUTER DIAMETER CIRCLE" C: C : Calculate the extrude twist angle K : #exan=si*2*W/PD K : #OUTPUT exan C : ------------------------------------------------------------- C : DIVIDE CURVES C : ---------------------------------------------------------------- K : !!MO K : W K : DI K : l K : K : c5 K : l K : K : C K : c1 K : K : c5 K : K : c K : c3 K : K : c3 K : K : c K : c7 K : K : c1 K : K : c K : c7 K : DON C : -------------------------------------------------------------- C : DELETE CURVES C : -------------------------------------------------------------- K : $ /de K : LAB K : K : C K : 5 6 K : 8 9 K : K : K : DON C : -------------------------------------------------------------- C : Rotate and copy C : -------------------------------------------------------------- K : $ /or r K : ALL K : C K : K : K : K : C K : ON K : Z K : 360/N K : N-1 C : C : ---------------------------------------------------------- C : Extrude C : ------------------------------------------------------------ K : $ /xto db ex oe K : LAB K : K : C K : c1 K : K : DI w K : EO K : TW ON K : TA exan K : OKAY K : OKAY K : K : E :