计算机辅助凸轮机构设计程序
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
13.4 计算机辅助凸轮机构设计
本节主要介绍直动从动件凸轮机构的计算机辅助设计。
13.4.1 直动从动件凸轮机构设计
例13-6 设计一偏置直动滚子从动件盘形凸轮机构的凸轮廓线,凸轮以匀角速度
110rad/s ω=逆时针转动,推程运动角60Φ=︒、远休止角30s Φ=︒、回程运动角60'Φ=︒
和近休止角210s 'Φ=︒,行程30mm h =,基圆半径060mm r =,滚子半径10mm r r =,偏距e =20 mm ,从动件的推程和回程的运动规律均为摆线运动规律。
解:建立直角坐标系如图13-6所示。
从动件推程阶段的摆线运动规律的方程为:[0,]ϕ∈Φ
22
2sin 22cos 22sin h h s h h v h a πϕϕπωπωϕπωπϕ⎧⎛⎫
=- ⎪⎪ΦΦ⎝⎭⎪⎪⎛⎫
=-
⎨ ⎪ΦΦΦ⎝⎭⎪⎪⎛⎫
=⎪ ⎪ΦΦ⎪⎝⎭⎩
(13-76) 从动件回程阶段的摆线运动规律的方程为:],[Φ'∈0ϕ
x
y
y
e
e
s 0
α
P
O
O
r 0 r 0
x
图13-6 凸轮机构的设计
(a )
(b )
ω1
ω1
22
2sin 22cos 22sin h h s h h h v h a πϕϕπωπωϕπωπϕ⎧⎛⎫=-+ ⎪⎪''ΦΦ⎝⎭⎪⎪⎛⎫⎪⎛⎫=--⎨ ⎪ ⎪'''ΦΦΦ⎝⎭⎝⎭⎪⎪⎛⎫⎪=- ⎪''ΦΦ⎪⎝⎭⎩
(13-77) 直动滚子从动件盘形凸轮的理论廓线方程为:
00()sin cos ()cos sin x s s e y s s e ϕϕ
ϕϕ=++⎧⎨
=+-⎩
(13-78) 式中,2
2
00s r e =-
外凸的实际廓线方程为:
2
2
2
2
a r a r dy x x r dx dy d d dx y y r dx dy d d ϕϕϕϕ⎧⎪
=+⎪⎪⎛⎫⎛⎫+⎪ ⎪ ⎪⎝⎭⎝⎭
⎪⎨⎪⎪
=-⎪⎛⎫⎛⎫⎪+ ⎪ ⎪⎪⎝⎭⎝⎭
⎩
(13-79)
13.4.2 直动从动件凸轮机构程序设计
下面是例13-6中直动从动件凸轮机构的设计程序。
Rem program to pitch curve and cam profile of translating follower cam mechanism Rem defining a printing character function in the picture1 Private Function PrintWord1(x, y, m, Word As String) With Picture1(m) .CurrentX = x .CurrentY = y
.ForeColor = RGB(0, 0, 255) End With
Picture1(m).Print Word End Function
Rem defining a printing character function in the picture2 Private Function PrintWord2(x, y, Word As String) With Picture2 .CurrentX = x .CurrentY = y
.ForeColor = RGB(0, 0, 255)
End With
Picture2.Print Word
End Function
Private Sub Command1_Click()
Dim bigfai1, bigfai3 As Double
Dim x1(360), y1(360), xa1(360), ya1(360), s(360), v(360), a(360) As Double h = 30: r0 = 60: rr = 10: e = 20: omg = 10
pi = 4# * Atn(1#)
bigfai1 = 60 * pi / 180
bigfai3 = 60 * pi / 180
Picture1(0).Scale (-0.6, 45)-(2 * pi + 0.5, -12)
Picture1(1).Scale (-0.6, 900)-(2 * pi + 0.5, -900)
Picture1(2).Scale (-1#, 26000)-(2 * pi + 0.5, -26000)
Picture1(0).DrawWidth = 1
Picture1(1).DrawWidth = 1
Picture1(2).DrawWidth = 1
Rem draw x-axis and y-axis
Picture1(0).Line (0, 0)-(2 * pi, 0)
Picture1(0).Line (0, -10)-(0, 40)
Picture1(1).Line (0, 0)-(2 * pi, 0)
Picture1(1).Line (0, -750)-(0, 750)
Picture1(2).Line (0, 0)-(2 * pi, 0)
Picture1(2).Line (0, -25000)-(0, 25000)
Rem draw x-axis scale line
For lin = 0 To 2 * pi Step pi / 2
lin1 = lin1 + 0.5
Picture1(0).Line (lin, 0)-(lin, 2)
word0 = PrintWord1(lin + 1.3, -0.5, 0, Str(lin1) + "π")
Picture1(1).Line (lin, 0)-(lin, 50)
word1 = PrintWord1(lin + 1.3, -10, 1, Str(lin1) + "π")
Picture1(2).Line (lin, 0)-(lin, 1700)
word2 = PrintWord1(lin + 1.3, -400, 2, Str(lin1) + "π")
Next lin
Rem draw y-axis scale line of picture1
For lin = -10 To 40 Step 10
Picture1(0).Line (0, lin)-(0.1, lin)
word0 = PrintWord1(-0.4, lin + 1.5, 0, Str(lin))
Next lin
For lin = -750 To 750 Step 250
Picture1(1).Line (0, lin)-(0.1, lin)
word1 = PrintWord1(-0.5, lin + 50, 1, Str(lin))
Next lin
For lin = -25000 To 25000 Step 10000
Picture1(2).Line (0, lin)-(0.1, lin)
word2 = PrintWord1(-0.73, lin + 1500, 2, Str(lin))
Next lin
Picture2.Scale (-130, 130)-(130, -130)
Picture2.DrawWidth = 1
Picture2.Line (-100, -100)-(-100, 100): Picture2.Line (-100, -100)-(100, -100)
Rem draw x-axis scale line of picture2
For lin = -80 To 100 Step 20
Picture2.Line (lin, -100)-(lin, -97)
word3 = PrintWord2(lin - 5, -105, Str(lin))
Next lin
Rem draw y-axis scale line of picture2
For lin = -100 To 100 Step 20
Picture2.Line (-100, lin)-(-97, lin)
word4 = PrintWord2(-115, lin + 3, Str(lin))
Next lin
s0 = Sqr(r0 * r0 - e * e)
Picture1(0).DrawWidth = 1.5
Picture1(1).DrawWidth = 1.5
Picture1(2).DrawWidth = 1.5
Rem draw pitch circle
Picture2.Line (-100, 0)-(100, 0)
Picture2.Line (0, -100)-(0, 100)
Picture2.CurrentX = -5: Picture2.CurrentY = -3
Picture2.Print "0"
For fai = 0 To 360
If (fai <> 0) Then
Picture2.Line (60 * Cos((fai - 1) * pi / 180), 60 * Sin((fai - 1) * pi / 180)) _
-(60 * Cos(fai * pi / 180), 60 * Sin(fai * pi / 180)), vbBlack End If
Next fai
Picture2.DrawWidth = 1.5
Rem cam displacement velocity acceleration curve and pitch curve during rise stroke For fai = 0 To 60 Step 1 / 300
fai1 = fai * pi / 180
s(fai) = (h / bigfai1) * fai1 - h / (2 * pi) * Sin((2 * pi) / bigfai1 * (fai1))
v(fai) = (h * omg / bigfai1) * (1 - Cos(((2 * pi) / bigfai1) * fai1))
a(fai) = (2 * pi * h * omg ^ 2) / (bigfai1 ^ 2) * Sin((2 * pi) / bigfai1 * (fai1))
x1(fai) = (s0 + s(fai)) * Sin(fai1) + e * Cos(fai1)
y1(fai) = (s0 + s(fai)) * Cos(fai1) - e * Sin(fai1)
Picture1(0).PSet (fai1, s(fai)), vbBlue
Picture1(1).PSet (fai1, v(fai)), vbBlue
Picture1(2).PSet (fai1, a(fai)), vbBlue
Picture2.PSet (x1(fai), y1(fai)), vbBlue
Next fai
Rem cam displacement velocity acceleration curve and pitch curve during outer dwell
For fai = 60 To 90 Step 1 / 100
fai2 = fai * pi / 180
s(fai) = 30
v(fai) = 0
a(fai) = 0
x1(fai) = (s0 + s(fai)) * Sin(fai2) + e * Cos(fai2)
y1(fai) = (s0 + s(fai)) * Cos(fai2) - e * Sin(fai2)
If (fai = 60) Then
Picture1(0).Line (60 * pi / 180, 30)-(90 * pi / 180, 30), vbRed
Picture1(1).Line (60 * pi / 180, 0)-(90 * pi / 180, 0), vbRed
Picture1(2).Line (60 * pi / 180, 0)-(90 * pi / 180, 0), vbRed
Else
Picture2.Line (x1(fai - 1), y1(fai - 1))-(x1(fai), y1(fai)), vbRed
End If
Next fai
Rem cam displacement velocity acceleration curve and pitch curve during return stroke
For fai = 90 To 150 Step 1 / 300
fai3 = fai * pi / 180
s(fai) = h - (h / bigfai3) * (fai3 - 90 * pi / 180) _
+ h / (2 * pi) * Sin((2 * pi) / bigfai3 * (fai3 - 90 * pi / 180))
v(fai) = -(h * omg / bigfai3) * (1 - Cos(((2 * pi) / bigfai3) * (fai3 - 90 * pi / 180)))
a(fai) = -(2 * pi * h * omg ^ 2) / (bigfai3 ^ 2) * Sin((2 * pi) / bigfai3 * (fai3 - 90 * pi / 180)) x1(fai) = (s0 + s(fai)) * Sin(fai3) + e * Cos(fai3)
y1(fai) = (s0 + s(fai)) * Cos(fai3) - e * Sin(fai3)
Picture1(0).PSet (fai3, s(fai)), vbBlue
Picture1(1).PSet (fai3, v(fai)), vbBlue
Picture1(2).PSet (fai3, a(fai)), vbBlue
Picture2.PSet (x1(fai), y1(fai)), vbBlue
Next fai
Rem cam displacement velocity acceleration curve and pitch curve during inner dwell
For fai = 150 To 360 Step 1 / 300
fai4 = fai * pi / 180
s(fai) = 0
v(fai) = 0
a(fai) = 0
x1(fai) = (s0 + s(fai)) * Sin(fai4) + e * Cos(fai4)
y1(fai) = (s0 + s(fai)) * Cos(fai4) - e * Sin(fai4)
If fai = 150 Then
Picture1(0).Line (150 * pi / 180, 0)-(2 * pi, 0), vbRed
Picture1(1).Line (150 * pi / 180, 0)-(2 * pi, 0), vbRed
Picture1(2).Line (150 * pi / 180, 0)-(2 * pi, 0), vbRed
Else
Picture2.Line (x1(fai - 1), y1(fai - 1))-(x1(fai), y1(fai)), vbRed
End If
Next fai
Rem 指定位置显示描述文字
Picture1(0).CurrentX = 1.2 * pi: Picture1(0).CurrentY = -8
Picture1(0).Print "(a) 位移曲线"
Picture1(1).CurrentX = 1.2 * pi: Picture1(1).CurrentY = -500
Picture1(1).Print "(b) 速度曲线"
Picture1(2).CurrentX = 1.2 * pi: Picture1(2).CurrentY = -15000
Picture1(2).Print "(c) 加速度曲线"
Rem cam profile during rise stroke
For fai = 0 To 60
fai1 = fai * pi / 180
dsbidfai1 = h / bigfai1 - h / bigfai1 * Cos((2 * pi / bigfai1) * fai1)
dxbidfai1 = (s0 + s(fai)) * Cos(fai1) - e * Sin(fai1) + dsbidfai1 * Sin(fai1)
dybidfai1 = -(s0 + s(fai)) * Sin(fai1) - e * Cos(fai1) + dsbidfai1 * Cos(fai1)
xa1(fai) = x1(fai) + rr * dybidfai1 / Sqr(dxbidfai1 * dxbidfai1 + dybidfai1 * dybidfai1) ya1(fai) = y1(fai) - rr * dxbidfai1 / Sqr(dxbidfai1 * dxbidfai1 + dybidfai1 * dybidfai1) If (fai <> 0) Then
Picture2.Line (xa1(fai - 1), ya1(fai - 1))-(xa1(fai), ya1(fai)), vbBlue
End If
Next fai
Rem cam profile during outer dwell
For fai = 60 To 90 Step 1 / 300
fai2 = fai * pi / 180
dsbidfai2 = 0
dxbidfai2 = (s0 + s(fai)) * Cos(fai2) - e * Sin(fai2)
dybidfai2 = -(s0 + s(fai)) * Sin(fai2) - e * Cos(fai2)
xa1(fai) = x1(fai) + rr * dybidfai2 / Sqr(dxbidfai2 * dxbidfai2 + dybidfai2 * dybidfai2) ya1(fai) = y1(fai) - rr * dxbidfai2 / Sqr(dxbidfai2 * dxbidfai2 + dybidfai2 * dybidfai2) If (fai <> 60) Then
Picture2.Line (xa1(fai - 1), ya1(fai - 1))-(xa1(fai), ya1(fai)), vbRed
End If
Next fai
Rem cam profile during return stroke
For fai = 90 To 150 Step 1 / 300
fai3 = fai * pi / 180
dsbidfai3 = -h / bigfai3 + h / bigfai3 * Cos((2 * pi / bigfai3) * (fai3 - 90 * pi / 180))
dxbidfai3 = (s0 + s(fai)) * Cos(fai3) - e * Sin(fai3) + dsbidfai3 * Sin(fai3)
dybidfai3 = -(s0 + s(fai)) * Sin(fai3) - e * Cos(fai3) + dsbidfai3 * Cos(fai3)
xa1(fai) = x1(fai) + rr * dybidfai3 / Sqr(dxbidfai3 * dxbidfai3 + dybidfai3 * dybidfai3)
ya1(fai) = y1(fai) - rr * dxbidfai3 / Sqr(dxbidfai3 * dxbidfai3 + dybidfai3 * dybidfai3)
If (fai <> 90) Then
Picture2.Line (xa1(fai - 1), ya1(fai - 1))-(xa1(fai), ya1(fai)), vbBlue
End If
Next fai
Rem cam profile during inner return
For fai = 150 To 360
fai4 = fai * pi / 180
dsbidfai4 = 0
dxbidfai4 = (s0 + s(fai)) * Cos(fai4) - e * Sin(fai4)
dybidfai4 = -(s0 + s(fai)) * Sin(fai4) - e * Cos(fai4)
xa1(fai) = x1(fai) + rr * dybidfai4 / Sqr(dxbidfai4 * dxbidfai4 + dybidfai4 * dybidfai4)
ya1(fai) = y1(fai) - rr * dxbidfai4 / Sqr(dxbidfai4 * dxbidfai4 + dybidfai4 * dybidfai4)
If (fai <> 150) Then
Picture2.Line (xa1(fai - 1), ya1(fai - 1))-(xa1(fai), ya1(fai)), vbRed
End If
Next fai
Rem draw roll
Picture2.DrawWidth = 1
Picture2.Circle (x1(0), y1(0)), 10, vbBlack
Picture2.Line (x1(0), y1(0))-(x1(0), 100), vbBlack
Picture2.Line (x1(0) - 3, 80)-(x1(0) - 3, 90), vbBlack
Picture2.Line (x1(0) + 3, 80)-(x1(0) + 3, 90), vbBlack
Rem output data
Open "e:\tu.txt" For Output As #1
For fai = 0 To 360 Step 10
Print #1, fai, Format(s(fai), "0.00"), Format(v(fai), "0.00"), Format(a(fai), "0.00"), _ Format(x1(fai), "0.00"), Format(y1(fai), "0.00"), Format(xa1(fai), "0.00"), Format(ya1(fai), "0.00")
Next fai
Close #1
End Sub
上述程序中与公式对应的参数说明如下。
fai表示凸轮的转角 ;
s(fai),v(fai),a(fai)分别表示从动件的位移、速度和加速度;
x1(fai),y1(fai)分别表示凸轮的理论廓线的坐标值(x,y);
xa1(fai),ya1(fai)分别表示凸轮的实际廓线的坐标值(x a,y a);
dx dϕ;
dsbidfai表示表达式/
ds dϕ;
dxbidfai表示表达式/
dy dϕ;
dybidfai表示表达式/
应用本程序计算的从动件的位移s、速度v、加速度a以及凸轮理论廓线的坐标值(x,y)和实际廓线的坐标值(x a,y a)如表13-3所示。
图13-7是运行程序后得到的凸轮的理论廓线和实际廓线。
图13-7 凸轮轮廓线的计算机辅助设计
表13-3 凸轮机构计算机辅助设计计算结果
ϕ︒s/mm v/mm・s-1 a/mm・s-2x/mm y/mm x a/mm y a/mm
/()
0 0.00 0.39 893.60 20.49 56.39 17.16 46.97
20 6.24 442.42 14418.95 40.73 51.83 40.74 41.83
40 24.50 416.54 -15315.27 67.86 48.66 63.76 39.54
60 30.00 0.00 0.00 85.19 25.22 75.61 22.38
80 30.00 0.00 0.00 88.68 -5.42 78.70 -4.81
100 29.00 -156.42 -15315.27 80.50 -35.26 72.12 -29.80
120 14.50 -572.57 899.59 51.08 -53.30 48.99 -43.53
140 0.75 -130.45 14415.69 21.02 -56.95 19.37 -47.08
160 0.00 0.00 0.00 0.03 -60.00 -0.06 -50.00
180 0.00 0.00 0.00 -20.49 -56.39 -17.16 -46.96
200 0.00 0.00 0.00 -38.54 -45.98 -32.19 -38.26
220 0.00 0.00 0.00 -51.95 -30.03 -43.33 -24.95
240 0.00 0.00 0.00 -59.08 -10.45 -49.25 -8.62 260 0.00 0.00 0.00 -59.09 10.39 -49.23 8.74 280 0.00 0.00 0.00 -51.98 29.97 -43.27 25.05 300 0.00 0.00 0.00 -38.59 45.94 -32.09 38.34 320 0.00 0.00 0.00 -20.55 56.37 -17.04 47.01 340 0.00 0.00 0.00 -0.03 60.00 0.06 50.00 360 0.00 0.00 0.00 20.00 56.57 16.67 47.14。