哈工大机械原理大作业2-凸轮机构设计-22题.doc
word机械原理大作业二课程名称: 机械原理 设计题目: 凸轮机构设计 一设计题目设计直动从动件盘形凸轮机构,凸轮机构原始参数序号升程(mm)升程运动角(º)升程运动规律升程许用压力角º回程运动角º回程运动规律回程许用压力角º远休止角º近休止角º2212090等加等减速4080等减等加速7070120二 凸轮推杆运动规律1.运动规律等加速等减速运动 推程 推程 2.运动规律等加速等减速运动 回程 回程 三推杆位移、速度、加速度线图与凸轮线图采用VB编程,其源程序与图像如下:1.位移:Private Sub mand1_Click()Timer1.Enabled = True '开启计时器End SubPrivate Sub Timer1_Timer()Static i As SingleDim s As Single, q As Single 'i作为静态变量,控制流程;s代表位移;q代表角度 Picture1.CurrentX = 0 Picture1.CurrentY = 0 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 IfEnd SubPrivate Sub mand2_Click()Timer2.Enabled = True '开启计时器End SubPrivate Sub Timer2_Timer()Static i As SingleDim v As Single, q As Single, w As Single 'i为静态变量,控制流程;q代表角度;w代表角速度,此处被赋予50Picture1.CurrentX = 0 Picture1.CurrentY = 0w = 50 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), vbBlackElse End IfEnd SubPrivate Sub mand3_Click()Timer3.Enabled = True '开启计时器End SubPrivate Sub Timer3_Timer()Static i As SingleDim a As Single, w As Single, q As Single 'i为静态变量,控制流程;a代表加速度;q代表角度;w代表角速度w = 50 Picture1.CurrentX = 0 Picture1.CurrentY = 0 If i <= 45 Then q = i a = 480 * w 2 / 8100 Picture1.PSet Step(q, -a), vbRed ElseIf i >= 45 And i <= 90 Then q = i a = -480 * w 2 / 8100 Picture1.PSet Step(q, -a), vbBlack ElseIf i >= 90 And i <= 150 Then q = i a = 0 Picture1.PSet Step(q, -a), vbGreen ElseIf i >= 150 And i <= 190 Then q = i a = -480 * w 2 / 6400 Picture1.PSet Step(q, -a), vbBlue ElseIf i >= 190 And i <= 230 Then q = i a = 480 * w 2 / 6400 Picture1.PSet Step(q, -a), vbRed ElseIf i >= 230 And i <= 360 Then q = i a = 0 Picture1.PSet Step(q, -a), vbBlack Else End IfEnd SubPrivate Sub mand4_Click()Timer4.Enabled = True '开启计时器;建立坐标系Picture1.Scale (-400, -400)-(400, 400)End SubPrivate Sub Timer4_Timer()Static i As SingleDim x As Single, s As Single, q As Single, scaley As Single, t As Single 'i为静态变量,控制流程;x代表位移;s代表纵坐标ds/dq;q代表角度Picture1.CurrentX = 0Picture1.CurrentY = 0scaley = 1t = 3.14 / 180 If i <= 45 Then q = i * t x = 194.734 * q s = 240 * (2 * q / 3.14) 2 Picture1.PSet Step(x, -s), vbRed ElseIf i >= 45 And i <= 90 Then q = i * t x = 194.734 * (3.14 / 2 - q) s = 120 - 97.367 * (3.14 / 2 - q) 2 Picture1.PSet Step(x, -s), vbRed ElseIf i >= 90 And i <= 150 Then q = i * t x = 0 s = 120 * scaley Picture1.PSet Step(x, -s), vbRed ElseIf i >= 150 And i <= 190 Then q = i * t x = -246.46 * (q - 5 * 3.14 / 6) s = 120 - 123.23 * (q - 5 * 3.14 / 6) 2 Picture1.PSet Step(x, -s), vbRed ElseIf i >= 190 And i <= 230 Then q = i * t x = -246.46 * (23 * 3.14 / 18 - q) s = 123.23 * (23 * 3.14 / 18 - q) 2 Picture1.PSet Step(x, -s), vbRed ElseIf i >= 230 And i <= 360 Then q = i * t x = 0 s = 0 Picture1.PSet Step(x, -s), vbRed Else End IfEnd Sub四确定凸轮基圆半径和偏距1. 求切点转角在图中,右侧曲线为升程阶段的类速度-位移图,作直线Dtdt与其相切,且位移轴正方向呈夹角1=300,如此切点处的斜率与直线Dtdt的斜率相等,因为kDtdt=tan600,右侧曲线斜率可以表示为:q;q=tan600继而求出切点坐标337.272,292.084。同理可求出另一切点-89.766,16.347y-292.084=1.732*x-337.272y-16.347=-0.364*x+89.766程序如下:Private Sub mand5_Click() '开启计时器;画出ds/dq-s图的切线Timer5.Enabled = True Picture1.Scale (-400, -400)-(400, 400) Picture1.Line (-50, 378.671)-(200, -54.329), vbRed Picture1.Line (-200, -65.683)-(40, -481.363), vbBlue Picture1.Line (-200, -209.127)-(200, -63.527), vbBlack Picture1.Line (-200, -56.472)-(200, 89.128), vbGreenEnd SubPrivate Sub Timer5_Timer() 'i为静态变量,控制流程;x代表位移;s代表纵坐标ds/dq;q代表角度;scaley是图形比例系数;t为角度,弧度转化系数Static i As SingleDim x As Single, s As Single, q As Single, scaley As Single, t As SinglePicture1.CurrentX = 0Picture1.CurrentY = 0scaley = 1t = 3.14 / 180 If i <= 45 Then q = i * t x = 194.734 * q s = 240 * (2 * q / 3.14) 2 Picture1.PSet Step(x, -s), vbRed ElseIf i >= 45 And i <= 90 Then q = i * t x = 194.734 * (3.14 / 2 - q) s = 120 - 97.367 * (3.14 / 2 - q) 2 Picture1.PSet Step(x, -s), vbRed ElseIf i >= 90 And i <= 150 Then q = i * t x = 0 s = 120 * scaley Picture1.PSet Step(x, -s), vbRed ElseIf i >= 150 And i <= 190 Then q = i * t x = -246.46 * (q - 5 * 3.14 / 6) s = 120 - 123.23 * (q - 5 * 3.14 / 6) 2 Picture1.PSet Step(x, -s), vbRed ElseIf i >= 190 And i <= 230 Then q = i * t x = -246.46 * (23 * 3.14 / 18 - q) s = 123.23 * (23 * 3.14 / 18 - q) 2 Picture1.PSet Step(x, -s), vbRed ElseIf i >= 230 And i <= 360 Then q = i * t x = 0 s = 0 Picture1.PSet Step(x, -s), vbRed Else End IfEnd Sub在轴心公共许用区内取轴心位置,能够满足压力角要求,现取直线红线 与直线绿线的交点为轴心位置,通过解方程组:x=131.557 y=-64.214 r0五绘制凸轮理论廓线和实际廓线Private Sub mand6_Click() '开启计时器;建立坐标系Picture1.Scale (-500, -500)-(500, 500) Timer6.Enabled = True End SubPrivate Sub Timer6_Timer() 'i为静态变量,控制流程;e为偏距;s为基圆半径平方减去偏距平方再开方所得;q为角度;x为横坐标;y为纵坐标Static i As SingleDim e As Single, q As Single, s As Single, x As Single, y As Single If i <= 3.14 / 4 Then q = i x = (s + 240 * (2 * q / 3.14) 2) * Cos(q) - e * Sin(q) y = (s + 240 * (2 * q / 3.14) 2) * Sin(q) + e * Cos(q) Picture1.PSet Step(x, -y), vbRed ElseIf i >= 3.14 / 4 And i <= 3.14 / 2 Then q = i x = (s + 120 - 97.367 * (3.14 / 2 - q) 2) * Cos(q) - e * Sin(q) y = (s + 120 - 97.367 * (3.14 / 2 - q) 2) * Sin(q) + e * Cos(q) Picture1.PSet Step(x, -y), vbRed ElseIf i >= 3.14 / 2 And i <= 5 * 3.14 / 6 Then q = i x = (s + 120) * Cos(q) - e * Sin(q) y = (s + 120) * Sin(q) + e * Cos(q) Picture1.PSet Step(x, -y), vbRed ElseIf i >= 5 * 3.14 / 6 And i <= 19 * 3.14 / 18 Then q = i x = (s + 120 - 123.23 * (q - 5 / 6 * 3.14) 2) * Cos(q) - e * Sin(q) y = (s + 120 - 123.23 * (q - 5 / 6 * 3.14) 2) * Sin(q) + e * Cos(q) Picture1.PSet Step(x, -y), vbRed ElseIf i >= 19 / 18 * 3.14 And i <= 23 / 18 * 3.14 Then q = i x = (s + 123.23 * (23 / 18 * 3.14 - q) 2) * Cos(q) - e * Sin(q) y = (s + 123.23 * (23 / 18 * 3.14 - q) 2) * Sin(q) + e * Cos(q) Picture1.PSet Step(x, -y), vbRed ElseIf i >= 23 / 18 * 3.14 And i <= 2 * 3.14 Then q = i x = s * Cos(q) - e * Sin(q) y = s * Sin(q) + e * Cos(q) Picture1.PSet Step(x, -y), vbRed Else End If End SubPrivate Sub mand7_Click() '开启计时器,建立坐标系Timer7.Enabled = TruePicture1.Scale (-10, -500)-(10, 10)End SubPrivate Sub Timer7_Timer() 'i为静态变量,控制流程;x代表dx/dq;y代表dy/dq;p代表曲率;e为偏距;s为基圆半径平方减去偏距平方再开方所得Static i As SingleDim s As Single, q As Single, x As Single, y As Single, p As Single Picture1.CurrentX = 0 Picture1.CurrentY = -Sqr(e 2 + s 2) If i <= 3.14 / 4 Then q = i x = (480 * 4 * q / 3.14 2) * Cos(q) + (s + 240 * (2 * q / 3.14) 2) * (-Sin(q) - e * Cos(q) y = (480 * 4 * q / 3.14 2) * Sin(q) - e * Sin(q) + (s + 240 * (2 * q / 3.14) 2) * Cos(q) p = Sqr(x 2 + y 2) Picture1.PSet Step(q, -p), vbRed ElseIf i >= 3.14 / 4 And i <= 3.14 / 2 Then q = i x = (2 * 97.367 * (3.14 / 2 - q) * Cos(q) + (s + 120 - 97.367 * (3.14 / 2 - q) 2) * (-Sin(q) - e * Cos(q) y = (2 * 97.367 * (3.14 / 2 - q) * Sin(q) + (s + 120 - 97.367 * (3.14 / 2 - q) 2) * Cos(q) - e * Sin(q) p = Sqr(x 2 + y 2) Picture1.PSet Step(q, -p), vbRed ElseIf i >= 3.14 / 2 And i <= 5 / 6 * 3.14 Then q = i x = (s + 120) * (-Sin(q) - e * Cos(q) y = (s + 120) * Cos(q) - e * Sin(q) p = Sqr(x 2 + y 2) Picture1.PSet Step(q, -p), vbRed ElseIf i >= 5 / 6 * 3.14 And i <= 19 / 18 * 3.14 Then q = i x = (-2 * 123.23 * (q - 5 / 6 * 3.14) * Cos(q) + (s + 120 - 123.23 * (q - 5 / 6 * 3.14) 2) * (-Sin(q) - e * Cos(q) y = (-2 * 123.23 * (q - 5 / 6 * 3.14) * Sin(q) + (s + 120 - 123.23 * (q - 5 / 6 * 3.14) 2) * Cos(q) - e * Sin(q) p = Sqr(x 2 + y 2) Picture1.PSet Step(q, -p), vbRed ElseIf i >= 19 / 18 * 3.14 And i <= 23 / 18 * 3.14 Then q = i x = (-2 * 123.23 * (23 / 18 * 3.14 - q) * Cos(q) + (s + 123.23 * (23 / 18 * 3.14 - q) 2) * (-Sin(q) - e * Cos(q) y = (-2 * 123.23 * (23 / 18 * 3.14 - q) * Sin(q) + (s + 123.23 * (23 / 18 * 3.14 - q) 2) * Cos(q) - e * Sin(q) p = Sqr(x 2 + y 2) Picture1.PSet Step(q, -p), vbRed ElseIf i >= 23 / 18 * 3.14 And i <= 2 * 3.14 Then q = i x = s * (-Sin(q) - e * Cos(q) y = s * Cos(q) - e * Sin(q) p = Sqr(x 2 + y 2) Picture1.PSet Step(q, -p), vbRed Else End IfEnd SubPrivate Sub mand8_Click()Picture1.Scale (-500, -500)-(500, 500) '建立坐标系;开启计时器Timer8.Enabled = TrueEnd SubPrivate Sub Timer8_Timer() 'i为静态变量,控制流程;q代表角度;x代表dx/dy;y代表dy/dq;a代表理论轮廓的横坐标;b代表理论轮廓的纵坐标;m代表横坐标;n代表纵坐标Static i As SingleDim s As Single, q As Single, x As Single, y As Single, p As Single, rr As Single, a As Single, b As Single, m As Single, n As Single If i <= 3.14 / 4 Then q = i x = (480 * 4 * q / 3.14 2) * Cos(q) + (s + 240 * (2 * q / 3.14) 2) * (-Sin(q) - e * Cos(q) y = (480 * 4 * q / 3.14 2) * Sin(q) - e * Sin(q) + (s + 240 * (2 * q / 3.14) 2) * Cos(q) a = (s + 240 * (2 * q / 3.14) 2) * Cos(q) - e * Sin(q) b = (s + 240 * (2 * q / 3.14) 2) * Sin(q) + e * Cos(q) p = Sqr(x 2 + y 2) m = a - rr * y / p n = b + rr * x / p Picture1.PSet Step(m, -n), vbBlack ElseIf i >= 3.14 / 4 And i <= 3.14 / 2 Then q = i x = (2 * 97.367 * (3.14 / 2 - q) * Cos(q) + (s + 120 - 97.367 * (3.14 / 2 - q) 2) * (-Sin(q) - e * Cos(q) y = (2 * 97.367 * (3.14 / 2 - q) * Sin(q) + (s + 120 - 97.367 * (3.14 / 2 - q) 2) * Cos(q) - e * Sin(q) a = (s + 120 - 97.367 * (3.14 / 2 - q) 2) * Cos(q) - e * Sin(q) b = (s + 120 - 97.367 * (3.14 / 2 - q) 2) * Sin(q) + e * Cos(q) p = Sqr(x 2 + y 2) m = a - rr * y / p n = b + rr * x / p Picture1.PSet Step(m, -n), vbBlack ElseIf i >= 3.14 / 2 And i <= 5 / 6 * 3.14 Then q = i x = (s + 120) * (-Sin(q) - e * Cos(q) y = (s + 120) * Cos(q) - e * Sin(q) a = (s + 120) * Cos(q) - e * Sin(q) b = (s + 120) * Sin(q) + e * Cos(q) p = Sqr(x 2 + y 2) m = a - rr * y / p n = b + rr * x / p Picture1.PSet Step(m, -n), vbBlack ElseIf i >= 5 / 6 * 3.14 And i <= 19 / 18 * 3.14 Then q = i x = (-2 * 123.23 * (q - 5 / 6 * 3.14) * Cos(q) + (s + 120 - 123.23 * (q - 5 / 6 * 3.14) 2) * (-Sin(q) - e * Cos(q) y = (-2 * 123.23 * (q - 5 / 6 * 3.14) * Sin(q) + (s + 120 - 123.23 * (q - 5 / 6 * 3.14) 2) * Cos(q) - e * Sin(q) a = (s + 120 - 123.23 * (q - 5 / 6 * 3.14) 2) * Cos(q) - e * Sin(q) b = (s + 120 - 123.23 * (q - 5 / 6 * 3.14) 2) * Sin(q) + e * Cos(q)p = Sqr(x 2 + y 2)m = a - rr * y / p n = b + rr * x / p Picture1.PSet Step(m, -n), vbBlack ElseIf i >= 19 / 18 * 3.14 And i <= 23 / 18 * 3.14 Then q = i x = (-2 * 123.23 * (23 / 18 * 3.14 - q) * Cos(q) + (s + 123.23 * (23 / 18 * 3.14 - q) 2) * (-Sin(q) - e * Cos(q) y = (-2 * 123.23 * (23 / 18 * 3.14 - q) * Sin(q) + (s + 123.23 * (23 / 18 * 3.14 - q) 2) * Cos(q) - e * Sin(q) a = (s + 123.23 * (23 / 18 * 3.14 - q) 2) * Cos(q) - e * Sin(q) b = (s + 123.23 * (23 / 18 * 3.14 - q) 2) * Sin(q) + e * Cos(q) p = Sqr(x 2 + y 2) m = a - rr * y / p n = b + rr * x / p Picture1.PSet Step(m, -n), vbBlack ElseIf i >= 23 / 18 * 3.14 And i <= 2 * 3.14 Then q = i x = s * (-Sin(q) - e * Cos(q) y = s * Cos(q) - e * Sin(q) a = s * Cos(q) - e * Sin(q) b = s * Sin(q) + e * Cos(q) p = Sqr(x 2 + y 2) m = a - rr * y / p n = b + rr * x / p Picture1.PSet Step(m, -n), vbBlack Else End IfEnd Sub内部轮廓为实际轮廓,外部轮廓为理论轮廓。15 / 15