Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Looking for GRIP program to generate solid models for gears

Status
Not open for further replies.

sociallyinept

Aerospace
Aug 19, 2003
30
0
0
US
I have an old version of a GRIP program that generates the tooth form profile for several kinds of gears. However, I need to make solid models of the gears, not just the tooth form profile. Does anyone out there have an updated GRIP file that will do this?

Otherwise, how do I take surfaces and join them to make a solid?

Thanks!
 
Replies continue below

Recommended for you

I've a couple of grips that do this... although I think their kinda flaky; ...when the work, they work fine ;-)
I didn't write em, and I'm too lazy to tweak em since I don't use me... YMMV
*****************************************************
<code>
ENTITY/ PT(21),PLOW_LINE,HL,HLP,SOLID1,SOLID2,$
PTEMP, FLINE, RRPOINT, TCUT(200),CNTR,$
CIRC1,CIRC2,CIRC3,CIRC4,F_CENT,F_SOLID
NUMBER/ LOWX,LOWY,UPX,UPY,DP,N,FW,PR_ANG,PI,DUMMY
NUMBER/ MAT1(12),MAT2(12), paused, MAT3(12)
NUMBER/ ARC_TT, BASIC_ATT_X2, LZERO, PAR, PD, $
BD, TXO, TYO, DT_R, DT_DEG, $
LAST, FIRST, INTERVAL, STEP, XTEMP, $
YTEMP, LPRIME, XTEMP2, YTEMP2, I,$
VE1(3),VE2(3),ADDD,DDD,RATIO
$$
$$ This Grip builds a female spline "tool" and is appropriate
$$ for use with power transmission shafting.
$$
$$

MESSG/'THIS GRIP CREATES A MALE TOOL THAT MUST BE SUBTRACTED',$
'FROM THE SHAFT TO CREATE THE FEMALE SPLINE.'

$$ Enter the basic parameters

PARAM/'Gear Parameters',$
'Number of teeth',INT,N,$
'Diametral Pitch',PITCH,$
'Over',DUMMY,$
'Press ang ',PA,$
'ArcSpaceTk,max',ATT_MX,$
'ArcSpaceTk,min',ATT_MN,$
'Minor Diameter',ROOT_D,$
'Min Root Fil. Rad.',FIL_RAD,$
'Major Diameter',OD_MAX,$
'Face Width',FW,RSP
$$
$$ DEBUG VALUES IF NEEDED WHEN TINKERING ON CODE...
IF/ N<=0,JUMP/L99:
JUMP/L98:
L99:
N=24
PITCH= 20
DUMMY = 30
PA = 30
ATT_MX=.0826
ATT_MN=.079
ROOT_D=1.133
FIL_RAD=.01
OD_MAX=1.29
FW=1

$$ Perform the basic calculations and
$$ stick in the circles and points...
L98:
PI=3.141592653589790
ARC_TT =(ATT_MX+ATT_MN)/2
PAR = PA*PI/180
PD = N/PITCH
ADDD=OD_MAX
DDD=ROOT_D
BD = PD*COSF(PA)
CNTR = POINT/0,0,0
CIRC1=CIRCLE/CENTER,CNTR,RADIUS,BD/2
CIRC2=CIRCLE/CENTER,CNTR,RADIUS,PD/2
CIRC3=CIRCLE/CENTER,CNTR,RADIUS,DDD/2
CIRC4=CIRCLE/CENTER,CNTR,RADIUS,ADDD/2
TXO = (BD/2)*COSF(PA)
TYO = (BD/2)*SINF(PA)
LZERO =(BD/2)*SINF(PA)/COSF(PA)
$$ DTHETA1?
BASIC_ATT_X2 = PI/PITCH
DT_R = -(PI*2*ARC_TT)/(PD*PI)
DT_DEG = DT_R*180/PI
LAST = 360*LZERO/(PI*BD)
RATIO = DDD/BD

$$ If you have a large diameter gear, this makes
$$ sure that the points forming the involute are spaced appropriately

$$ IF/RATIO >= 1.02,LAST=LAST*(RATIO**(-23.7))


FIRST =-(400/N)
INTERVAL = LAST-FIRST
STEP = INTERVAL/8
I=1

MAT1 = MATRIX/YZROT,180

MAT2 = MATRIX/XYROT,DT_DEG

MAT3 = MATRIX/XYROT,360/N

LAST = LAST +.01

$$
$$ This do loop builds the array of points for the involute
$$

DO/L1:,JTHETA,FIRST,LAST,STEP


XTEMP = (BD/2)*COSF(PA-JTHETA)
YTEMP = (BD/2)*SINF(PA-JTHETA)
LPRIME = LZERO - (JTHETA*PI/180)*BD/2
XTEMP2 = XTEMP+LPRIME*SINF(PA-JTHETA)
YTEMP2 = -(YTEMP-(LPRIME*COSF(PA-JTHETA)))
PT(I) = POINT/XTEMP2,YTEMP2
PTEMP = TRANSF/MAT1,PT(I)
PT(21-I) = TRANSF/MAT2,PTEMP
DELETE/PTEMP
I=I+1

L1:


VE1(1)=-1
VE1(2)=-(YTEMP2/XTEMP2)
VE1(3)=0
MAGPT=SQRTF((XTEMP2*XTEMP2) $
+(YTEMP2*YTEMP2))
THETA0=ATANF(YTEMP2/XTEMP2)
DTHETA0=DT_DEG-(THETA0)
THETA1 = DTHETA0
VE2(1)=MAGPT*COSF(THETA1)
VE2(2)=MAGPT*SINF(THETA1)

DX=XTEMP2-VE2(1)
DY=YTEMP2-VE2(2)
VE2(3)=0
$$ PT(12)= POINT/VE2(1),VE2(2)
VE2(1)=VE2(1)/XTEMP2
VE2(2)=VE2(2)/XTEMP2
$$
$$ Location of the root fillet pick point...
$$
TCUT(200)=POINT/(PD+OD_MAX)/4,SINF(DT_DEG/4)
$$
$$ Location of "top" root point
$$
TCUT(199)=POINT/0,-SINF(DT_DEG/2)
$$
$$ Location of "bottom" root point
$$
TCUT(198)=POINT/0,SINF(DT_DEG/2)
$$ LOCATION OF THE FILLET RADIUS...

ROT_ANG=(ATANF(VE1(2)/VE1(1))+ATANF(VE2(2)/VE2(1)))/2



HLP = SPLINE/PT(1..9)
PLOW_LINE = SPLINE/PT(12..20)

$$ PARAM/'ratio ge 1.02',$
$$ 'Ratio',paused,RSP

JUMP/JP3:

JP3:

$$
$$ Create the curves needed to define the cuts to the gear
$$ Blank
$$



$$ FLINE is the fillet at the root of the tooth..
$$ .....this also trims the involute curves...
FLINE=FILLET/PLOW_LINE,HLP,CENTER,TCUT(200),RADIUS,FIL_RAD
TCUT(197)=LINE/PT(9),TCUT(199)
TCUT(196)=LINE/PT(12),TCUT(198)
TCUT(195)=LINE/TCUT(199),TCUT(198)

$$ TCUT is the array of tooth shapes that will
$$ carve away the blank to form the teeth. This
$$ statement extrudes the curves froming the poster boy
$$ gap between the teeth...


TCUT(1)=SOLEXT/HLP,FLINE,PLOW_LINE,TCUT(197),TCUT(196),$
TCUT(195),HEIGHT,FW,AXIS,0,0,1



$$ Now we make the blank...SOLID1

SOLID1=SOLCYL/ORIGIN,0,0,0,HEIGHT,FW,DIAMTR,ROOT_D,AXIS,0,0,1


$$ This do loop copies the poster boy tooth gap shape
$$ into the TCUT array...

DO/L2:,KK,2,N, 1

TCUT(KK)=TRANSF/MAT3,TCUT(KK-1)


L2:

$$ This do loop subtracts the tooth gap array from the blank

DO/L3:,KK,1,N,1

SOLID1=UNITE/SOLID1,WITH,TCUT(KK)

L3:

$$ This subtracts the material under the rim from the gear
$$ blank...not done in a spline... we keep it solid and allow the shaft
$$ modler to select the shaft ID material...

$$ SOLID1=SUBTRA/SOLID1,WITH,SOLID2

$$
$$ COLOR IT RED (4)
$$

&COLOR(SOLID1) = 4


DELETE/PT,TCUT,PLOW_LINE,HL,HLP,SOLID2,$
PTEMP, FLINE, RRPOINT,CNTR,$
CIRC1,CIRC2,CIRC3,CIRC4,F_CENT,F_SOLID

$$ Free at last!!!
HALT
</code>
*****************************************************
GRIP 2:
*****************************************************
<code>
ENTITY/ PT(20),PLOW_LINE,HL,HLP,SOLID1,SOLID2,$
PTEMP, FLINE, RRPOINT, TCUT(200),CNTR,$
CIRC1,CIRC2,CIRC3,CIRC4,F_CENT,F_SOLID
NUMBER/ LOWX,LOWY,UPX,UPY,DP,N,FW,PR_ANG,PI
NUMBER/ MAT1(12),MAT2(12), paused, MAT3(12)
NUMBER/ ARC_TT, BASIC_ATT_X2, LZERO, PAR, PD, $
BD, TXO, TYO, DT_R, DT_DEG, $
LAST, FIRST, INTERVAL, STEP, XTEMP, $
YTEMP, LPRIME, XTEMP2, YTEMP2, I,$
VE1(3),VE2(3),ADDD,DDD,RATIO
$$
$$ This Grip builds a basic spur gear and is appropriate
$$ for use with power transmission gearing. Standard
$$ addendums and dedendums are used.
$$
$$ If you are doing something special (pump gears)
$$ or have customized the addendums or dedendums,
$$ then use the specific grip for that product.
$$


$$ Enter the basic parameters

PARAM/'Gear Parameters',$
'Number of teeth',INT,N,$
'Diametral Pitch',PITCH,$
'Pitch Diameter',PD_REF,$
'Press ang ',PA,$
'Arc T.Thick,max',ATT_MX,$
'Arc T.Thick,min',ATT_MN,$
'Root Diameter',ROOT_D,$
'Min Fillet Rad.',FIL_RAD,$
'OD (Max)',OD_MAX,$
'Face Width',FW,RSP

$$ Perform the basic calculations and
$$ stick in the circles and points...

PI=3.141592653589790
ARC_TT =(ATT_MX+ATT_MN)/2
PAR = PA*PI/180
PD = N/PITCH
ADDD=OD_MAX
DDD=ROOT_D
BD = PD*COSF(PA)
CNTR = POINT/0,0,0
CIRC1=CIRCLE/CENTER,CNTR,RADIUS,BD/2
CIRC2=CIRCLE/CENTER,CNTR,RADIUS,PD/2
CIRC3=CIRCLE/CENTER,CNTR,RADIUS,DDD/2
CIRC4=CIRCLE/CENTER,CNTR,RADIUS,ADDD/2
TXO = (BD/2)*COSF(PA)
TYO = (BD/2)*SINF(PA)
LZERO =(BD/2)*SINF(PA)/COSF(PA)
$$ DTHETA1?
BASIC_ATT_X2 = PI/PITCH
DT_R = PI*2*(BASIC_ATT_X2-ARC_TT)/(PD*PI)
DT_DEG = DT_R*180/PI
LAST = 360*LZERO/(PI*BD)
RATIO = DDD/BD

$$ If you have a large diameter gear, this makes
$$ sure that the points forming the involute are spaced appropriately

IF/RATIO >= 1.02,LAST=LAST*(RATIO**(-23.7))


FIRST =-(400/N)
INTERVAL = LAST-FIRST
STEP = INTERVAL/8
I=1

MAT1 = MATRIX/YZROT,180

MAT2 = MATRIX/XYROT,DT_DEG

MAT3 = MATRIX/XYROT,360/N

LAST = LAST +.01

$$
$$ This do loop builds the array of points for the involute
$$

DO/L1:,JTHETA,FIRST,LAST,STEP


XTEMP = (BD/2)*COSF(PA-JTHETA)
YTEMP = (BD/2)*SINF(PA-JTHETA)
LPRIME = LZERO - (JTHETA*PI/180)*BD/2
XTEMP2 = XTEMP+LPRIME*SINF(PA-JTHETA)
YTEMP2 = -(YTEMP-(LPRIME*COSF(PA-JTHETA)))
PT(I) = POINT/XTEMP2,YTEMP2
PTEMP = TRANSF/MAT1,PT(I)
PT(21-I) = TRANSF/MAT2,PTEMP

I=I+1

L1:


VE1(1)=-1
VE1(2)=-(YTEMP2/XTEMP2)
VE1(3)=0
MAGPT=SQRTF((XTEMP2*XTEMP2) $
+(YTEMP2*YTEMP2))
THETA0=ATANF(YTEMP2/XTEMP2)
DTHETA0=DT_DEG-(THETA0)
THETA1 = DTHETA0
VE2(1)=MAGPT*COSF(THETA1)
VE2(2)=MAGPT*SINF(THETA1)

DX=XTEMP2-VE2(1)
DY=YTEMP2-VE2(2)
VE2(3)=0
PT(12)= POINT/VE2(1),VE2(2)
VE2(1)=VE2(1)/XTEMP2
VE2(2)=VE2(2)/XTEMP2
TCUT(200)=POINT/(ADDD/2)+.5,ARC_TT
TCUT(199)=POINT/(ADDD/2),ARC_TT/2

$$ LOCATION OF THE FILLET RADIUS...

ROT_ANG=(ATANF(VE1(2)/VE1(1))+ATANF(VE2(2)/VE2(1)))/2

$$
$$ Branch based upon the relative diameters of the base
$$ root diameters (needed for large tooth counts)
$$ Create the curves defining the active profile of the
$$ gear...

IF/RATIO-1.02,JP1:,JP1:,JP2:

JP1:
PT(10)=POINT/0,0
PT(11)=POINT/0,0
HLP = SPLINE/PT(1..10)
PLOW_LINE = SPLINE/PT(11..20)
$$ PARAM/'ratio le 1.02',$
$$ 'Ratio',paused,RSP
JUMP/JP3:

JP2:

HLP = SPLINE/PT(1..9)
PLOW_LINE = SPLINE/PT(12..20)

$$ PARAM/'ratio ge 1.02',$
$$ 'Ratio',paused,RSP

JUMP/JP3:

JP3:

$$
$$ Create the curves needed to define the cuts to the gear
$$ Blank
$$


$$ HL is the OD curve of the gear cutting shape (non functional
$$ needed for programming...)

HL = BCURVE/PT(1),TCUT(200),PT(20)

$$ FLINE is the fillet at the root of the tooth..
$$ .....this also trims the involute curves...
FLINE=FILLET/PLOW_LINE,OUT,CIRC3,HLP,CENTER,TCUT(199)

$$ TCUT is the array of tooth shapes that will
$$ carve away the blank to form the teeth. This
$$ statement extrudes the curves froming the poster boy
$$ gap between the teeth...


TCUT(1)=SOLEXT/HLP,FLINE,PLOW_LINE,HL,HEIGHT,FW,AXIS,0,0,1

$$ FILLET RADIUS CALCULATIONS AND FORMATION

F_CENT = POINT/((ROOT_D/2)+FIL_RAD)*COSF(ROT_ANG),$
((ROOT_D/2)+FIL_RAD)*SINF(ROT_ANG)
F_SOLID = SOLCYL/ORIGIN,$
((ROOT_D/2)+FIL_RAD)*COSF(ROT_ANG),$
((ROOT_D/2)+FIL_RAD)*SINF(ROT_ANG),0,$
HEIGHT,FW,DIAMTR,FIL_RAD*2,AXIS,0,0,1


$$ ADD IN THE NEXT STEP AFTER DEBUG...(OK, I did!)
TCUT(1) = UNITE/TCUT(1),WITH,F_SOLID

$$ Now we make the blank...SOLID1

SOLID1=SOLCYL/ORIGIN,0,0,0,HEIGHT,FW,DIAMTR,ADDD,AXIS,0,0,1
$$ SOLID2 will be subtracted from SOLID1 to form the gear rim...
$$ The rim will be as thick at the total tooth height...
$$ This is the minimum rim acceptable to some of our customers...

SOLID2=SOLCYL/ORIGIN,0,0,0,HEIGHT,FW,DIAMTR,DDD-(1.2*(ADDD-DDD)),AXIS,0,0,1

$$ This do loop copies the poster boy tooth gap shape
$$ into the TCUT array...

DO/L2:,KK,2,N, 1

TCUT(KK)=TRANSF/MAT3,TCUT(KK-1)


L2:

$$ This do loop subtracts the tooth gap array from the blank

DO/L3:,KK,1,N,1

SOLID1=SUBTRA/SOLID1,WITH,TCUT(KK)

L3:

$$ This subtracts the material under the rim from the gear
$$ blank...

SOLID1=SUBTRA/SOLID1,WITH,SOLID2


$$ Free at last!!!
HALT
</code>
*****************************************************
If nothing else, you may be able to get what you need to alter the grips you already have...

If these don't work, you could always just extrude the ones you have and sew the sheets together. :)

Regards,
SS
CAD should pay for itself, shouldn't it?
 
I've not tried creating GRIP's before, but thought this gear program would be useful, i copied these programs from where it start, <code> , to where it finishes with <code>, into 2 text files, then changed the extention to .grs ,then using NX grip open, i tried to compile, but it came up with lots of errors.i couldn't figure how to make the .grx file.
The help is hard to follow, so i'm stuck...
Can someone give me any-old grip program that will compile OK , and a few simple instructions to get it to work, so i can at least learn how the compiler, and link thing works? any help much appreciated
 
JohnRBaker,
Could you share with the rest of us how you successfully compiled those scripts? I run the compilation command as part of the NX Open Grip software but it fails each time.

Please advise.

Sociallyinept
 
I used the GRADE utility that has been in place for YEARS. I did nothing special. Please review the User Documentation for Automation -> NX Open -> NX open for GRIP -> Grip Reference Guide -> Developing & Executing Programs -> Developing a GRIP Program -> Compiling a GRIP Program. To launch the GRADE utility, from Windows, go to Start -> All Programs -> select the NX entry -> NX Tools -> NX Open Grip.


John R. Baker, P.E.
Product 'Evangelist'
NX Product Line
SIEMENS PLM Software Inc.
Cypress, CA
 
since i'm not the only one who couldn't get them going, could you think of a reason why yours did, John ??
the errors it came up with were syntax in the program , so why would it work on yours ??
 
i've found another GRIP program about finding points to output, i got that one to compile OK, i've managed to produce a .gri file from that, but the help doesn't tell me how to create an .grx file
Can anyone help?
 
If you're using GRADE, option 1 is used to edit your source file, option 2 is used to compile your routine, including any sub-routines, if you have any, and then option 3 links the routines to create a single executable. The result of an edit is a .grs (GRIP source) file. The result of a compile is a .gri (GRIP intermediate) file. And the result of a link is a .grx (GRIP execute) file.


John R. Baker, P.E.
Product 'Evangelist'
NX Product Line
SIEMENS PLM Software Inc.
Cypress, CA
 
Moog2,

I just double checked the validity of the code and both grips I submitted compiled fine. I'm using GRADE v2.0 so differences aren't the compiler. Simply put, just do a simple copy/paste of everything 'as is' between the "<code>" and "</code>" tags and don't include the tags. Make sure your only copying 1 source code and not both at the same time...

I'm puzzled...

Regards,
SS
CAD should pay for itself, shouldn't it?
 
Ahhhhh. Got it. Thanks SS for the tiny little detail of removing the "code" tags. Not so obvious a step for a novice like me. I don't use GRIP files all that much but am beginning to see how useful they can be.

Thanks again to all.
 
Eureka !!
Mine worked too, thanks Shadowspawn..Although not being too fermiliar with gear-speak, could you list me a couple of test values to try in each one as the ones i tried were too approximate or impossible to produce. Thanks again...
 
Status
Not open for further replies.
Back
Top