机械原理大作业VB四杆机构的设计_第1页
机械原理大作业VB四杆机构的设计_第2页
机械原理大作业VB四杆机构的设计_第3页
机械原理大作业VB四杆机构的设计_第4页
机械原理大作业VB四杆机构的设计_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、沈阳航空航天大学铰链四杆机构设计报告学院:机电工程学院班级:姓名:学号:Dim a, b, c, d, e, f, l1, l2, l3, l4, w1, w2, w3, a2, a3#, p, m, dc, bjj, n%Private Sub Command1_Click() 杆长赋值l1 = Val(Text1(0).Text)l2 = Val(Text1(1).Text)l3 = Val(Text1(2).Text)l4 = Val(Text1(3).Text)a = Val(Text3.Text) * 3.14159265358979 / 180 初始 角度转弧度Call bj(bj

2、j)If bjj = 1 Then Exit Subw1 = 0Call jsgw1 = Val(Text2.Text) 公式计算角速度,角加速度 w2 = -w1 * l1 * Sin(a - c) / (l3 * Sin(b - c)w3 = w1 * l1 * Sin(a - b) / (l2 * Sin(c - b)Text4.Text = w2Text6.Text = w3a2 = (l3 * w3 * w3 - l1 * w1 * w1 * Cos(a - c) - l2 * w2 * w2 * Cos(b - c) / (l2 * Sin(b - c)a3 = (l2 * w2

3、* w2 + l1 * w1 * w1 * Cos(a - b) - l3 * w3 * w3 * Cos(c - b) / (l3 * Sin(c - b)Text5.Text = a2Text7.Text = a3End SubFunction jsg()If p = 0 Then p = -1On Error GoTo ela = a + 0.01 * w1 角度随时间增加d = l4 - l1 * Cos(a)e = -l1 * Sin(a)f = (d 2 + e 2 + l3 2 - l2 2) / (2 * l3)c = 2 * Atn(e + Sqr(d 2 + e 2 - f

4、 2) * p) / (d - f)b = Atn(e + l3 * Sin(c) / (d + l3 * Cos(c)w1 = -w1el:w1 = -w1Line1(0).Y1 = Picture1.Height / 2 定义各个线段端点的坐标Line1(0).X1 = Picture1.Width / 2Line1(0).X2 = l1 * Cos(a) + Line1(0).X1Line1(0).Y2 = Line1(0).Y1 - l1 * Sin(a)Line1(3).X2 = Line1(0).X1 + l4Line1(3).Y2 = Line1(0).Y1Line1(3).X1

5、 = Line1(0).X1Line1(3).Y1 = Line1(0).Y1Line1(2).X1 = Line1(3).X2 + l3 * Cos(c)Line1(2).Y1 = Line1(3).Y2 - l3 * Sin(c)Line1(2).X2 = Line1(3).X2Line1(2).Y2 = Line1(3).Y2Line1(1).X1 = Line1(0).X2Line1(1).Y1 = Line1(0).Y2Line1(1).X2 = Line1(2).X1Line1(1).Y2 = Line1(2).Y1Shape1(i).Left = Line1(i).X1 - 50

6、 连接两杆转动副的中心坐标 Shape1(i).Top = Line1(i).Y1 - 50Next iPicture1.PSet (Line1(1).X1, Line1(1).Y1), vbRed 画出主动件和连架杆的轨迹 Picture1.PSet (Line1(2).X1, Line1(2).Y1), vbGreen End FunctionFunction bj(x) 杆长条件的判断x = 0xld = Val(Text1(0).Text)xlx = Val(Text1(0).Text)For i = 1 To 3If xld < Val(Text1(i).Text) Then

7、xld = Val(Text1(i).Text)If xlx > Val(Text1(i).Text) Then xlx = Val(Text1(i).Text)Next iFor i = 0 To 3zh = Val(Text1(i).Text) + zhNext iIf (xlx + xld) > (zh - (xlx + xld) ThenMsgBox ("不满足杆长要求")x = 1End IfEnd Function。Picture2.Scale (-8, 4)-(8, -4) 画出角速度w2函数图像 Picture2.Line (-7.5, 0)-(

8、7.5, 0)Picture2.Line (0, 3.8)-(0, -3.8)Picture2.CurrentX = 7.5: Picture2.CurrentY = 0.2: Picture2.Print "x"Picture2.CurrentX = 0.3: Picture2.CurrentY = 4: Picture2.Print "y"For i = -7 To 7Picture2.Line (i, 0)-(i, 0.1)Picture2.CurrentX = i - 0.1: Picture2.CurrentY = -0.01: Picture

9、2.Print i Next iFor i = 3.2 To -3.2 Step -0.2If i > -0.01 And i < 0.01 Then i = 0Picture2.CurrentX = -0.3: Picture2.CurrentY = i + 0.03: Picture2.Print i Picture2.Line (0.3, i)-(0, i)Next iDim a1, b1, c1, d1, e1, f1, w11#w11 = 0.001For x = -6.283 To 6.283 Step 0.001If p = 0 Then p = -1On Error

10、 GoTo ela1 = a1 + w11d1 = l4 - l1 * Cos(a1)e1 = -l1 * Sin(a1)f1 = (d1 2 + e1 2 + l3 2 - l2 2) / (2 * l3)c1 = 2 * Atn(e1 + Sqr(d1 2 + e1 2 - f1 2) * p) / (d1 - f1)b1 = Atn(e1 + l3 * Sin(c1) / (d1 + l3 * Cos(c1)w11 = -w11el:w11 = -w11w111 = Val(Text2.Text)w21 = -w111 * l1 * Sin(a1 - c1) / (l3 * Sin(b1

11、 - c1)w31 = w1 * l1 * Sin(a1 - b1) / (l2 * Sin(c1 - b1)a21 = (l3 * w31 * w31 - l1 * w111 * w111 * Cos(a1 - c1) - l2 * w21 * w21 * Cos(b1 - c1) / (l2 * Sin(b1 - c1)a31 = (l2 * w21 * w21 + l1 * w111 * w111 * Cos(a1 - b1) - l3 * w31 * w31 * Cos(c1 - b1) / (l3 * Sin(c1 - b1)Picture2.PSet (x, w21)Next xE

12、nd IfEnd SubPicture3.Scale (-8, 3.5)-(8, -3.5) 画出角速度w3函数图像Picture3.Line (-7.5, 0)-(7.5, 0)Picture3.Line (0, 3.4)-(0, -3.4)Picture3.CurrentX = 7.5: Picture3.CurrentY = 0.2: Picture3.Print "x"Picture3.CurrentX = 0.3: Picture3.CurrentY = 3.5: Picture3.Print "y"For i = -7 To 7Picture

13、3.Line (i, 0)-(i, 0.1)Picture3.CurrentX = i - 0.1: Picture3.CurrentY = -0.01: Picture3.Print iNext iFor i = 3.2 To -3.2 Step -0.2If i > -0.01 And i < 0.01 Then i = 0Picture3.CurrentX = -0.3: Picture3.CurrentY = i + 0.03: Picture3.Print iPicture3.Line (0.3, i)-(0, i)Next iDim a1, b1, c1, d1, e1

14、, f1, w11#w11 = 0.001For x = -6.283 To 6.283 Step 0.001If p = 0 Then p = -1On Error GoTo ela1 = a1 + w11d1 = l4 - l1 * Cos(a1)e1 = -l1 * Sin(a1)f1 = (d1 2 + e1 2 + l3 2 - l2 2) / (2 * l3)c1 = 2 * Atn(e1 + Sqr(d1 2 + e1 2 - f1 2) * p) / (d1 - f1)b1 = Atn(e1 + l3 * Sin(c1) / (d1 + l3 * Cos(c1)w11 = -w

15、11el:w11 = -w11w111 = Val(Text2.Text)w21 = -w111 * l1 * Sin(a1 - c1) / (l3 * Sin(b1 - c1)w31 = w1 * l1 * Sin(a1 - b1) / (l2 * Sin(c1 - b1)a21 = (l3 * w31 * w31 - l1 * w111 * w111 * Cos(a1 - c1) - l2 * w21 * w21 * Cos(b1 - c1) / (l2 * Sin(b1 - c1)a31 = (l2 * w21 * w21 + l1 * w111 * w111 * Cos(a1 - b1

16、) - l3 * w31 * w31 * Cos(c1 - b1) / (l3 * Sin(c1 - b1)Picture3.PSet (x, w31)Next xEnd IfEnd SubPrivate Sub Picture4_DblClick() 画出角加速度a2 Picture3.ClsdPicture4.Scale (-8, 8)-(8, -8)Picture4.Line (-7.5, 0)-(7.5, 0)Picture4.Line (0, 7.5)-(0, -7.5)Picture4.CurrentX = 7.5: Picture4.CurrentY = 0.2: Picture

17、4.Print "x"Picture4.CurrentX = 0.3: Picture4.CurrentY = 8: Picture4.Print "y"For i = -7 To 7Picture4.Line (i, 0)-(i, 0.1)Picture4.CurrentX = i - 0.1: Picture4.CurrentY = -0.01: Picture4.Print i Next iFor i = 7 To -7 Step -0.5If i > -0.01 And i < 0.01 Then i = 0Picture4.Curr

18、entX = -0.3: Picture4.CurrentY = i + 0.03: Picture4.Print i Picture4.Line (0.3, i)-(0, i)Next iDim a1, b1, c1, d1, e1, f1, w11#w11 = 0.001For x = -6.283 To 6.283 Step 0.001If p = 0 Then p = -1On Error GoTo elell:a1 = a1 + w11d1 = l4 - l1 * Cos(a1)If IsEmpty(d1) Then GoTo elle1 = -l1 * Sin(a1)If IsEm

19、pty(e1) Then GoTo ellf1 = (d1 2 + e1 2 + l3 2 - l2 2) / (2 * l3)If IsEmpty(f1) Then GoTo ellc1 = 2 * Atn(e1 + Sqr(d1 2 + e1 2 - f1 2) * p) / (d1 - f1)If IsEmpty(c1) ThenGoTo ellEnd Ifb1 = Atn(e1 + l3 * Sin(c1) / (d1 + l3 * Cos(c1)If IsEmpty(b1) Then GoTo ellw11 = -w11el:w11 = -w11w111 = Val(Text2.Te

20、xt)If b1 = Null Then GoTo ellw21 = -w111 * l1 * Sin(a1 - c1) / (l3 * Sin(b1 - c1)w31 = w1 * l1 * Sin(a1 - b1) / (l2 * Sin(c1 - b1)a21 = (l3 * w31 * w31 - l1 * w111 * w111 * Cos(a1 - c1) - l2 * w21 * w21 * Cos(b1 - c1) / (l2 * Sin(b1 - c1)a31 = (l2 * w21 * w21 + l1 * w111 * w111 * Cos(a1 - b1) - l3 *

21、 w31 * w31 * Cos(c1 - b1) / (l3 * Sin(c1 - b1)Picture4.PSet (x, a21)Picture5.Scale (-8, 8)-(8, -8) 画出角加速度a3Picture5.Line (-7.5, 0)-(7.5, 0)Picture5.Line (0, 7.5)-(0, -7.5)Picture5.CurrentX = 7.5: Picture5.CurrentY = 0.2: Picture5.Print "x"Picture5.CurrentX = 0.3: Picture5.CurrentY = 8: Pic

22、ture5.Print "y"For i = -7 To 7Picture5.Line (i, 0)-(i, 0.1)Picture5.CurrentX = i - 0.1: Picture5.CurrentY = -0.01: Picture5.Print iNext iFor i = -7 To 7 Step 0.5If i > -0.01 And i < 0.01 Then i = 0Picture5.CurrentX = -0.3: Picture5.CurrentY = i + 0.03: Picture5.Print iPicture5.Line (

23、0.3, i)-(0, i)Next iDim a1, b1, c1, d1, e1, f1, w11#w11 = 0.001For x = -6.283 To 6.283 Step 0.001If p = 0 Then p = -1On Error GoTo ela1 = a1 + w11d1 = l4 - l1 * Cos(a1)e1 = -l1 * Sin(a1)f1 = (d1 2 + e1 2 + l3 2 - l2 2) / (2 * l3)c1 = 2 * Atn(e1 + Sqr(d1 2 + e1 2 - f1 2) * p) / (d1 - f1)b1 = Atn(e1 +

24、 l3 * Sin(c1) / (d1 + l3 * Cos(c1)w11 = -w11el:w11 = -w11w111 = Val(Text2.Text)w21 = -w111 * l1 * Sin(a1 - c1) / (l3 * Sin(b1 - c1)w31 = w1 * l1 * Sin(a1 - b1) / (l2 * Sin(c1 - b1)a21 = (l3 * w31 * w31 - l1 * w111 * w111 * Cos(a1 - c1) - l2 * w21 * w21 * Cos(b1 - c1) / (l2 * Sin(b1 - c1)a31 = (l2 *

25、w21 * w21 + l1 * w111 * w111 * Cos(a1 - b1) - l3 * w31 * w31 * Cos(c1 - b1) / (l3 * Sin(c1 - b1)Picture5.PSet (x, a31)Picture6.Scale (-8, 3.5)-(8, -3.5) 角位移s2,s3函数的输出Picture6.Line (-7.5, 0)-(7.5, 0)Picture6.Line (0, 3.2)-(0, -3.2)Picture6.CurrentX = 7.5: Picture6.CurrentY = 0.2: Picture6.Print "x"Picture6.CurrentX = 0.3: Picture6.CurrentY = 3.5: Picture6.Print "y"For i = -7 To 7 Step 0.5Picture6.Line (i, 0)-(i, 0.1)Picture6.CurrentX = i - 0.1

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论