外渐开线跨棒距及接触圆直径等参数的互相计算及VB代码

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

外渐开线跨棒距及接触圆直径等参数的互相计算及VB代码一、已知接触点在dx圆处的量棒直径为dlx和dx圆处刀具弧齿厚Sx, 计算测量值M
及相关参数的过程;
1、分度圆直径:d=m*z
2、拉刀基圆直径:d0=d*cos(ap) ap为拉刀压力角
3、拉刀渐开线函数:inva=Tan(ap1) - ap1
4、
5、分度圆处齿厚:sf = pi * m / 2 pi=3.141592654
6、
7、
量棒dx中心处渐开线函数invae = s x/ d + inva + dlx / d0 - pi / z由下面公式带入得:
8、中心角函数的算法:ae = Atn(1.442252453 * invae ^ (1 / 3) + 0.599931525 * invae +
0.1093716057 * invae ^ 1.67 - 0.01932924212 * invae ^ 2.26)
9、量棒与齿形的接触点通过的任意圆直径: dx = Sqr((d0 * Tan(ae) - dlx) ^ 2 + d0 ^ 2)
其中中心角ae=(wx+ax) tan(ae)=O1B/r0 推导出:
O1B=r0*tan(ae)
在直角三角形OPB中
dx=SQR(PB^2+r0^2)
推导出:
dx = Sqr((d0 * Tan(ae) - dlx) ^ 2 + d0 ^ 2)
10、M值的计算见上
VB的form窗口设置及计算结果如下:
VB代码如下:
Public Function 弧转角(temp As Double) As Double
Dim pi As Double
pi = 4 * Atn(1#)
弧转角= temp * 180 / pi
End Function
Public Function 精度限制(k2 As Double, k1 As Double) As Integer Dim temp As Double
temp = Abs(k2 - k1) / (1 + Abs(k2)) - 0.00000001
If temp < 0 Then
精度限制= 1
Else
精度限制= 0
End If
'Public Function getarf(myarf As Double) As Double
' Dim a As Double
' a = Val(Text1)
' getarf = myarf - (Tan(myarf) - myarf - a) / (Tan(myarf) * Tan(myarf)) 'End Function
Public Function 开3次方(temp As Double) As Double
Dim pi As Double
开3次方= Exp(Log(temp) / 3)
End Function
Private Sub Command1_Click()
Dim pi As Double
Dim m As Double
Dim z As Integer
Dim ap As Double
Dim ap1 As Double
Dim s As Double
Dim dlx As Double
Dim dlx1 As Double
Dim d As Double
Dim d0 As Double
Dim inva As Double
Dim invae As Double
Dim ae As Double
Dim ae1 As Double
Dim dx As Double
Dim mo As Double
Dim mj As Double
Dim sg As Double
Dim xg As Double
Dim dl As Double
Dim wf As Double
Dim tf As Double
Dim sf As Double
Dim a1 As Double
Dim b As Double
Dim b1 As Double
Dim invae1 As Double
Dim w As Double
Dim mre As Double
Dim oo1 As Double
Dim smax As Double
Dim n As Integer
Dim arf0 As Double
Dim arf1 As Double
Dim arf2 As Double
Dim a As Double
pi = 3.141592654
m = Val(Text1)
z = Val(Text2)
ap = Val(Text3)
mre = Val(Text4)
dlx = Val(Text7)
dlx1 = Val(Text30)
If m <> 0 Then
If z <> 0 Then
If ap <> 0 Then
If mre <> 0 Then
If dlx <> 0 Then
d = m * z
ap1 = pi / 180 * ap
d0 = d * Cos(ap1)
inva = Tan(ap1) - ap1
tf = pi * m
sf = pi * m / 2
wf = 57.29578 * ((tf - sf) / d)
dl = d * Sin(wf * pi / 180) / Cos(ap1 + wf * pi / 180)
If z Mod 2 = 0 Then
oo1 = (d0 / 2) * (mre - dlx) / d0
Else
oo1 = (d0 / 2) * (mre - dlx) / (d0 * Cos(90 / z * pi / 180))
End If
ae = Atn((Sqr(oo1 ^ 2 - (d0 / 2) ^ 2)) / (d0 / 2))
invae = Tan(ae) - ae
smax = d * (invae - inva - dlx / d0 + pi / z)
If dlx1 = 0 Then
'invae = s / d + inva + dlx / d0 - pi / z
'ae = Atn(1.442252453 * invae ^ (1 / 3) + 0.599931525 * invae + 0.1093716057 * invae ^ 1.67 - 0.01932924212 * invae ^ 2.26)
'a = invae
'arf0 = 开3次方(a * 3)
'arf2 = arf0 - (Tan(arf0) - arf0 - a) / (Tan(arf0) * Tan(arf0))
'Do
' arf1 = arf2
' arf2 = arf2 - (Tan(arf2) - arf2 - a) / (Tan(arf2) * Tan(arf2)) 'Loop Until 精度限制(arf2, arf1) = 1
' ae = arf2
ae1 = ae * 180 / pi
dx = Sqr((d0 * Tan(ae) - dlx) ^ 2 + d0 ^ 2)
If z Mod 2 = 0 Then
mo = d0 / Cos(ae) + dlx
Text8 = ""
Text9 = ""
Text0 = ""
Text11 = ""
Text12 = ""
Text13 = ""
Text14 = ""
Text15 = ""
Text14 = Format(mo, "0.00000")
Else
mj = (d0 / Cos(ae)) * Cos((90 / z) * pi / 180) + dlx
Text8 = ""
Text9 = ""
Text0 = ""
Text11 = ""
Text12 = ""
Text13 = ""
Text14 = ""
Text15 = ""
Text15 = Format(mj, "0.00000")
End If
Text8 = Format(d, "0.000000000000")
Text9 = Format(d0, "0.000000000000")
Text10 = Format(inva, "0.000000000000")
Text11 = Format(invae, "0.000000000000")
Text12 = Format(ae1, "0.000000000000")
Text5 = Format(smax, "0.000000000000")
Text13 = Format(dx, "0.000000000000")
Else
invae1 = smax / d + inva + dlx1 / d0 - pi / z
'ae1 = Atn(1.442252453 * invae1 ^ (1 / 3) + 0.599931525 * invae1 + 0.1093716057 * invae1 ^ 1.67 - 0.01932924212 * invae1 ^ 2.26)
a = invae1
arf0 = 开3次方(a * 3)
arf2 = arf0 - (Tan(arf0) - arf0 - a) / (Tan(arf0) * Tan(arf0))
Do
arf1 = arf2
arf2 = arf2 - (Tan(arf2) - arf2 - a) / (Tan(arf2) * Tan(arf2))
Loop Until 精度限制(arf2, arf1) = 1
ae1 = arf2
dx = Sqr((d0 * Tan(ae1) - dlx1) ^ 2 + d0 ^ 2)
If z Mod 2 = 0 Then
mo = d0 / Cos(ae1) + dlx1
Text8 = ""
Text9 = ""
Text0 = ""
Text11 = ""
Text12 = ""
Text13 = ""
Text14 = ""
Text15 = ""
Text14 = Format(mo, "0.00000")
Else
mj = (d0 / Cos(ae1)) * Cos((90 / z) * pi / 180) + dlx1
Text8 = ""
Text9 = ""
Text0 = ""
Text11 = ""
Text12 = ""
Text13 = ""
Text14 = ""
Text15 = ""
Text15 = Format(mj, "0.00000")
End If
Text8 = Format(d, "0.000000000000")
Text9 = Format(d0, "0.000000000000")
Text10 = Format(inva, "0.000000000000")
Text11 = Format(invae1, "0.000000000000")
Text12 = Format(ae1, "0.000000000000")
Text5 = Format(smax, "0.000000000000")
Text13 = Format(dx, "0.000000000000")
End If
'a = invae
'arf0 = 开3次方(a * 3)
'arf2 = arf0 - (Tan(arf0) - arf0 - a) / (Tan(arf0) * Tan(arf0))
'Do
' arf1 = arf2
' arf2 = arf2 - (Tan(arf2) - arf2 - a) / (Tan(arf2) * Tan(arf2))
'Loop Until 精度限制(arf2, arf1) = 1
' ae = arf2
Else
MsgBox "请输入量棒直径dlx数据并保证输入正确", vbInformation, "信息"
End If
Else
MsgBox "请输入跨棒距MREmax数据并保证输入正确", vbInformation, "信息"
End If
Else
MsgBox "请输入标准压力角ap数据并保证输入正确", vbInformation, "信息"
End If
Else
MsgBox "请输入齿数z数据并保证输入正确", vbInformation, "信息"
End If
Else
MsgBox "请输入模数m数据并保证输入正确", vbInformation, "信息"
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Command3_Click()
Dim pi As Double
Dim m As Double
Dim z As Integer
Dim ap As Double
Dim ap1 As Double
Dim sx As Double Dim dlx As Double Dim dlx1 As Double Dim d As Double
Dim d0 As Double Dim inva As Double Dim invae As Double Dim ae As Double Dim ae1 As Double Dim dx As Double Dim mo As Double Dim mj As Double Dim sg As Double Dim xg As Double Dim dl As Double
Dim wf As Double Dim tf As Double
Dim sf As Double
Dim a1 As Double Dim b As Double
Dim b1 As Double Dim invae1 As Double Dim w As Double
Dim mre As Double Dim oo1 As Double Dim smax As Double
Dim i As Integer
Dim n As Integer
Dim arf0 As Double
Dim arf1 As Double
Dim arf2 As Double
Dim a As Double
pi = 3.141592654
m = Val(Text16)
z = Val(Text17)
ap = Val(Text18)
mre = Val(Text6)
dlx = Val(Text29)
dx = Val(Text19)
If m <> 0 Then
If z <> 0 Then
If ap <> 0 Then
If mre <> 0 Then
If dlx <> 0 Then
d = m * z
ap1 = pi / 180 * ap
d0 = d * Cos(ap1)
inva = Tan(ap1) - ap1
tf = pi * m
sf = pi * m / 2
wf = 57.29578 * ((tf - sf) / d)
dl = d * Sin(wf * pi / 180) / Cos(ap1 + wf * pi / 180)
If z Mod 2 = 0 Then
oo1 = (d0 / 2) * (mre - dlx) / d0
Else
oo1 = (d0 / 2) * (mre - dlx) / (d0 * Cos(90 / z * pi / 180))
End If
ae = Atn((Sqr(oo1 ^ 2 - (d0 / 2) ^ 2)) / (d0 / 2))
invae = Tan(ae) - ae
smax = d * (invae - inva - dlx / d0 + pi / z)
ax = Atn(Sqr(dx ^ 2 - d0 ^ 2) / d0)
invax = Tan(ax) - ax
sx = dx * (smax / d + inva - invax)
wx = pi / z - sx / dx
dlx1 = dx * Sin(wx) / Cos(ax + wx)
'invae = s / d + inva + dlx / d0 - pi / z
'ae = Atn(1.442252453 * invae ^ (1 / 3) + 0.599931525 * invae + 0.1093716057 * invae ^ 1.67 - 0.01932924212 * invae ^ 2.26)
'a = invae
' arf0 = 开3次方(a * 3)
'arf2 = arf0 - (Tan(arf0) - arf0 - a) / (Tan(arf0) * Tan(arf0))
' Do
' arf1 = arf2
' arf2 = arf2 - (Tan(arf2) - arf2 - a) / (Tan(arf2) * Tan(arf2))
' Loop Until 精度限制(arf2, arf1) = 1
' ae = arf2
ae1 = ae * 180 / pi
If z Mod 2 = 0 Then
mo = d0 / Cos(ax + wx) + dlx1
Text20 = ""
Text21 = ""
Text22 = ""
Text23 = ""
Text24 = ""
Text25 = ""
Text26 = ""
Text27 = ""
Text28 = ""
Text27 = Format(mo, "0.0000")
Else
mj = (d0 / Cos(ax + wx)) * Cos((90 / z) * pi / 180) + dlx1
Text20 = ""
Text21 = ""
Text22 = ""
Text23 = ""
Text24 = ""
Text25 = ""
Text26 = ""
Text27 = ""
Text28 = ""
Text28 = Format(mj, "0.0000")
End If
Text20 = Format(d, "0.000000000000")
Text21 = Format(d0, "0.000000000000")
Text22 = Format(inva, "0.000000000000")
Text23 = Format(ax * 180 / pi, "0.000000000000")
Text24 = Format(sx, "0.000000000000")
Text25 = Format(wx * 180 / pi, "0.000000000000")
Text26 = Format(dlx1, "0.0000")
Else
MsgBox "请输入量棒直径dlx数据并保证输入正确", vbInformation, "信息"
End If
Else
MsgBox "请输入跨棒距MREmax数据并保证输入正确", vbInformation, "信息"
End If
Else
MsgBox "请输入标准压力角ap数据并保证输入正确", vbInformation, "信息"
End If
Else
MsgBox "请输入齿数z数据并保证输入正确", vbInformation, "信息" End If
Else
MsgBox "请输入模数m数据并保证输入正确", vbInformation, "信息" End If
End Sub。

相关文档
最新文档