$$ PROGRAM: GEAR.GRS
$$
$$ KEYWORDSSU
$$
$$ ABSTRACT:
$$ CREATE A GEAR
$$ RELEASE HISTORY:
$$
$$ REQUIRED SUBROUTINES: (NONE)
$$
$$ REQUIRED DATA/PART FILES: (NONE)
$$
$$ AUTHOR: PETER1024
$$
$$ COMPANY:
$$
$$ SYSTEM TYPE: ALL
$$
$$ THEORY/VARIABLE USAGE:
$$
ENTITY/POINT1(361),SP1(200),SP2(200),$
LN1(200),LN2(200),DC1(100),AC1(100),$
LLR1(100),LRR1(100),HLR1(100),HRR1(100)
ENTITY/LN3,C1,C2,C3
NUMBER/R1,X1,Y1,D1,Z1,M1,D2,D3
NUMBER/MAT1(12),MAT2(12)
NUMBER/V1,V2,A1,A2,A3,A4,X2(4),Y2(4),$
SA1(3),RESP1
Z1=20 $$ TOOTH NO
A3=20 $$ PRESS ANGLE 20
M1=2 $$ DEFAULT MODULE 2
PARAM/'PLEASE INPUT PARAMETER','NO OF TOOTH',Z1,$
'MODULE',M1,'PRESS ANGLE',A3,RESP1
JUMP/JERR:,JERR:,,,RESP1
D1=M1*Z1 $$PITCH DIA
D2=D1+2*M1 $$ ADDENDUM DIA
D3=D1-2.5*M1 $$ DEDUNDUM DIA
R1=D1*COSF(A3)/2 $$ INVOLUTE DATUM CIRCLE DIA
A2=180*SQRTF(D2*D2/4-R1*R1)/&I/R1
A4=180*SQRTF(D1*D1/4-R1*R1)/&I/R1-A3
C1=CIRCLE/0,0,D1/2
C2=CIRCLE/0,0,D2/2
C3=CIRCLE/0,0,D3/2
&FONT(C1)=&CLINE
BLANK/C2,C3
V1=0
A1=0 $$ DEFAULT START ANGLE EQUAL TO 0 DEGREE
JP1:
IFTHEN/A1>A2
JUMP/JP2:
ENDIF
X1=R1*COSF(A1)+&I*R1*A1*SINF(A1)/180
Y1=R1*SINF(A1)-&I*R1*A1*COSF(A1)/180
POINT1(V1+1)=POINT/X1,Y1
V1=V1+1
IFTHEN/A2-A1<2 AND A2-A1>0 AND A2<>A1
A1=A2
JUMP/JP1:
ENDIF
A1=A1+2
JUMP/JP1:
JP2:
POINT1(360)=POINT/0,0,0
LN3=LINE/POINT1(360),ATANGL,(90/Z1+A4)
BLANK/LN3
SP1(1)=BCURVE/POINT1(1..V1),DEGREE,3,IFERR,JERR:
LN1(1)=LINE/D3/2,0,0,R1,0,0
MAT1=MATRIX/MIRROR,LN3
MAT2=MATRIX/XYROT,360/Z1
SP2(1)=TRANSF/MAT1,SP1(1)
LN2(1)=TRANSF/MAT1,LN1(1)
POINT1(359)=POINT/0,0
POINT1(358)=POINT/XSMALL,INTOF,LN2(1),C3
POINT1(357)=POINT/XLARGE,INTOF,SP1(1),C2
POINT1(356)=POINT/XLARGE,INTOF,SP2(1),C2
OBTAIN/POINT1(358),X2(1),Y2(1)
OBTAIN/POINT1(357),X2(2),Y2(2)
OBTAIN/POINT1(356),X2(3),Y2(3)
SA1(1)=ATANF(Y2(1)/X2(1))
SA1(2)=ATANF(Y2(2)/X2(2))
SA1(3)=ATANF(Y2(3)/X2(3))
DC1(1)=CIRCLE/CENTER,POINT1(359),RADIUS,D3/2$
,START,SA1(1),END,360/Z1
AC1(1)=CIRCLE/CENTER,POINT1(359),RADIUS,D2/2$
,START,SA1(2),END,SA1(3)
DELETE/POINT1(356..358)
POINT1(358)=POINT/D1/2+20,200
POINT1(357)=POINT/D1/2,0
POINT1(356)=POINT/XLARGE,INTOF,LN3,C1
POINT1(355)=POINT/D1/2+20,-200
LLR1(1)=FILLET/DC1(1),LN2(1),CENTER,POINT1(358),RADIUS,0.2*M1
HLR1(1)=FILLET/AC1(1),SP2(1),CENTER,POINT1(357),RADIUS,0.1*M1
HRR1(1)=FILLET/SP1(1),AC1(1),CENTER,POINT1(356),RADIUS,0.1*M1
LRR1(1)=TRANSF/MAT1,LLR1(1)
LN1(2)=TRANSF/MAT2,LN1(1)
DELETE/LN1(1)
LN1(1)=TRANSF/MAT1,LN2(1)
LRR1(2)=FILLET/LN1(2),DC1(1),CENTER,POINT1(357),RADIUS,0.2*M1
DELETE/LRR1(2)
V2=2
JP3:
IFTHEN/V2>Z1
JUMP/JEND:
ENDIF
DC1(V2)=TRANSF/MAT2,DC1(V2-1)
AC1(V2)=TRANSF/MAT2,AC1(V2-1)
LLR1(V2)=TRANSF/MAT2,LLR1(V2-1)
LRR1(V2)=TRANSF/MAT2,LRR1(V2-1)
HLR1(V2)=TRANSF/MAT2,HLR1(V2-1)
HRR1(V2)=TRANSF/MAT2,HRR1(V2-1)
SP1(V2)=TRANSF/MAT2,SP1(V2-1)
LN1(V2)=TRANSF/MAT2,LN1(V2-1)
SP2(V2)=TRANSF/MAT2,SP2(V2-1)
LN2(V2)=TRANSF/MAT2,LN2(V2-1)
V2=V2+1
JUMP/JP3:
JEND:
DELETE/POINT1(1..V1),POINT1(355..360)
DELETE/LN3,C2,C3
JERR:
HALT
初步可以用了,只是当齿根圆与渐开线基圆半径之差小于0.2模数时,有错。大家自己去改正吧。 |