哈工大机械原理大作业凸轮机构设计题.doc
文本预览下载声明
Harbin Institute of Technology
机械原理大作业二
课程名称: 机械原理
设计题目: 凸轮机构设计
院系机电工程学院
班级 1208101
设 计 者学号
指导教师
设计时间 2014年6月1日Private Sub Command1_Click()
Timer1.Enabled = True 开启计时器
End Sub
Private Sub Timer1_Timer()
Static i As Single
Dim s As Single, q As Single i作为静态变量,控制流程;s代表位移;q代表角度
Picture1.CurrentX = 0
Picture1.CurrentY = 0
i = i + 0.1
If i = 45 Then
q = i
s = 240 * (q / 90) ^ 2
Picture1.PSet Step(q, -s), vbRed
ElseIf i = 45 And i = 90 Then
q = i
s = 120 - 240 * ((90 - q) ^ 2) / (90 ^ 2)
Picture1.PSet Step(q, -s), vbGreen
ElseIf i = 90 And i = 150 Then
q = i
s = 120
Picture1.PSet Step(q, -s), vbBlack
ElseIf i = 150 And i = 190 Then
q = i
s = 120 - 240 * (q - 150) ^ 2 / 6400
Picture1.PSet Step(q, -s), vbBlue
ElseIf i = 190 And i = 230 Then
q = i
s = 240 * (230 - q) ^ 2 / 6400
Picture1.PSet Step(q, -s), vbRed
ElseIf i = 230 And i = 360 Then
q = i
s = 0
Picture1.PSet Step(q, -s), vbBlack
Else
End If
End Sub
2.速度
Private Sub Command2_Click()
Timer2.Enabled = True 开启计时器
End Sub
Private Sub Timer2_Timer()
Static i As Single
Dim v As Single, q As Single, w As Single i为静态变量,控制流程;q代表角度;w代表角速度,此处被赋予50
Picture1.CurrentX = 0
Picture1.CurrentY = 0
w = 50
i = i + 0.1
If i = 45 Then
q = i
v = 480 * w * q / 8100
Picture1.PSet Step(q, -v), vbRed
ElseIf i = 45 And i = 90 Then
q = i
v = 480 * w * (90 - q) / 8100
Picture1.PSet Step(q, -v), vbBlack
ElseIf i = 90 And i = 150 Then
q = i
v = 0
Picture1.PSet Step(q, -v), vbGreen
ElseIf i = 150 And i = 190 Then
q = i
v = -480 * w * (q - 150) / 6400
Picture1.PSet Step(q, -v), vbBlue
ElseIf i = 190 And i = 230 Then
q = i
v = -480 * w * (230 - q) / 6400
Picture1.PSet Step(q, -v), vbRed
ElseIf i = 230 And i = 360 Then
q = i
v = 0
Picture1.PSet Step(q, -v), vbBlack
Else
End If
End Sub
3.加速度
Private Sub Command3_Click()
Timer3.Enabled = True 开启计时器
End S
显示全部