哈工大机械原理大作业——凸轮——9号.doc
文本预览下载声明
凸轮机构运动分析
班 级:
设 计 者:
学 号:
指导教师:
设计时间:
源代码
Public r0, e, h, f, ff, w As Double
Public f0, fs, f01, fs1 As Double
Public s, v, a, x, y, x1, y1, q1, q2, rr As Double
Public pi, pa, T, s0, i As Double
Public dsdf, dxdf, dydf As Double
Private Sub pushcos()
s = h / 2 * (1 - Cos(pi / f0 * f))
v = pi * h * w / 2 / f0 * Sin(pi / f0 * f)
a = pi ^ 2 * h * w ^ 2 / 2 / f0 ^ 2 * Cos(pi / f0 * f)
dsdf = h / 2 * Sin(pi / f0 * f) * pi / f0
End Sub
Private Sub backsin()
T = f - (f0 + fs)
s = h * (1 - T / f01 + Sin(2 * pi / f01 * T) / 2 / pi)
v = -h * w / f01 * (1 - Cos(2 * pi / f01 * T))
a = -2 * pi * h * w ^ 2 / f01 ^ 2 * Sin(2 * pi / f01 * T)
dsdf = h * (-1 / f01 + Cos(2 * pi / f01 * T) / f01)
End Sub
Private Sub pushstay()
s = h
v = 0
a = 0
dsdf = 0
End Sub
Private Sub backstay()
s = 0
v = 0
a = 0
dsdf = 0
End Sub
Private Sub pushaa()
End Sub
Private Sub backcos()
End Sub
Private Sub Command1_Click()
Picture1.Cls
Picture1.Scale (-30, 100)-(390, -20)
Picture1.Line (-30, 0)-(390, 0)
Picture1.Line (0, 390)-(0, -20)
For i = 0 To 360 Step 30
Picture1.Line (i, 2)-(i, 0)
Picture1.CurrentX = i - 10: Picture1.CurrentY = 0
Picture1.Print i
Next i
For i = 10 To 100 Step 10
Picture1.Line (0, i)-(5, i)
Picture1.CurrentX = -30: Picture1.CurrentY = i + 2
Picture1.Print i
Next i
For ff = 0 To 360 Step 0.1
f = ff * pa
s0 = Sqr(r0 ^ 2 - e ^ 2)
If f f0 Then
Call pushcos
ElseIf f = f0 And f fs + f0 Then
Call pushstay
ElseIf f = fs + f0 And f fs + f0 + f01 Then
Call backsin
ElseIf f = fs + f0 + f01 And f = 2 * pi Then
Call backstay
End If
Picture1.PSet (ff, s)
Next ff
End Sub
Private Sub Command2_Click()
Picture1.Cls
Picture1.Scale (-30, 150)-(390, -150)
Picture1.Line (-30, 0)-(390, 0)
Picture1.Line (0, 390)-(0, -150)
For i = 0 To 360 Step 30
Picture1.Line (i, 0.5)-(i, 0)
Picture1.CurrentX = i - 10: Picture1.CurrentY = 0
Picture1.Print i
Next i
For i = -150 To 150 Step 10
Picture1.Line (0, i)-(5, i)
显示全部