哈工大机械原理连杆机构_第1页
哈工大机械原理连杆机构_第2页
哈工大机械原理连杆机构_第3页
哈工大机械原理连杆机构_第4页
哈工大机械原理连杆机构_第5页
已阅读5页,还剩18页未读 继续免费阅读

下载本文档

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

文档简介

1、Harbin Institute of Technology机械原理大作业1课程名称:机械原理 设计题目:连杆机构运动分析 院 系: 能源学院 班 级:1402401班 设 计 者: 学 号: 指导教师: 设计时间: 2016年6月9日 哈尔滨工业大学5,源代码RR I级机构运动分析的源代码Public Class RR '定义输入字段 Public rxA As Single Public ryA As Single Public vxA As Single Public vyA As Single Public axA As SinglePublic ayA As Single P

2、ublic phii As Single Public omegai As Single Public alphai As SinglePublic li As Single '定义输出参数 Private sgl_rxB As Single Private sgl_ryB As Single Private sgl_vxB As Single Private sgl_vyB As Single Private sgl_axB As Single Private sgl_ayB As Single '实例化类并初始化输入字段 Public Sub New(ByVal radiu

3、sVector_xA As Single, ByVal radiusVector_yA As Single, ByVal velocity_xA As Single, ByVal velocity_yA As Single, ByVal acceleration_xA As Single, ByVal acceleration_yA As Single, ByVal phi_i As Single, ByVal omega_i As Single, ByVal alpha_i As Single, ByVal length_i As Single) rxA = radiusVector_xA

4、ryA = radiusVector_yA vxA = velocity_xA vyA = velocity_yA axA = acceleration_xA ayA = acceleration_yA phii = phi_i omegai = omega_i alphai = alpha_i li = length_i End Sub '定义输出属性 Public ReadOnly Property rxB As Single Get Return sgl_rxB End Get End Property Public ReadOnly Property ryB As Single

5、 Get Return sgl_ryB End Get End Property Public ReadOnly Property vxB As Single Get Return sgl_vxB End Get End Property Public ReadOnly Property vyB As Single Get Return sgl_vyB End Get End Property Public ReadOnly Property axB As Single Get Return sgl_axB End Get End Property Public ReadOnly Proper

6、ty ayB As Single Get Return sgl_ayB End Get End Property '计算输出参数 Public Sub Calculate() sgl_rxB = rxA + li * Math.Cos(phii) sgl_ryB = ryA + li * Math.Sin(phii) sgl_vxB = vxA - omegai * li * Math.Sin(phii) sgl_vyB = vyA + omegai * li * Math.Cos(phii) sgl_axB = axA - omegai * omegai * li * Math.Co

7、s(phii) - alphai * li *_ Math.Sin(phii) sgl_ayB = ayA - omegai * omegai * li * Math.Sin(phii) + alphai * li *_ Math.Cos(phii) End SubEnd ClassRPR II级基本组运动分析的源代码Public Class RPR '定义杆组模式枚举类型 Public Enum Mode As Integer ClockWise = 1 AntiClockWise = -1 End Enum '定义输入字段 Public rxB As Single Publ

8、ic ryB As Single Public vxB As Single Public vyB As Single Public axB As Single Public ayB As Single Public rxD As Single Public ryD As Single Public vxD As Single Public vyD As Single Public axD As Single Public ayD As Single Public li As Single Public lj As Single Public lk As Single Public M As M

9、ode '定义输出参数 Private sgl_rxC As Single Private sgl_ryC As Single Private sgl_vxC As Single Private sgl_vyC As Single Private sgl_axC As Single Private sgl_ayC As Single Private sgl_rxE As Single Private sgl_ryE As Single Private sgl_vxE As Single Private sgl_vyE As Single Private sgl_axE As Singl

10、e Private sgl_ayE As Single Private sgl_phij As Double Private sgl_omegaj As Double Private sgl_alphaj As Double '实例化类并初始化输入字段 Public Sub New(ByVal radiusVector_xB As Single, ByVal radiusVector_yB As Single, ByVal velocity_xB As Single, ByVal velocity_yB As Single, ByVal acceleration_xB As Singl

11、e, ByVal acceleration_yB As Single, ByVal radiusVector_xD As Single, ByVal radiusVector_yD As Single, ByVal velocity_xD As Single, ByVal velocity_yD As Single, ByVal acceleration_xD As Single, ByVal acceleration_yD As Single, ByVal length_i As Single, ByVal length_j As Single, ByVal length_k As Sing

12、le, ByVal mode As Mode) rxB = radiusVector_xB ryB = radiusVector_yB vxB = velocity_xB vyB = velocity_yB axB = acceleration_xB ayB = acceleration_yB rxD = radiusVector_xD ryD = radiusVector_yD vxD = velocity_xD vyD = velocity_yD axD = acceleration_xD ayD = acceleration_yD li = length_i lj = length_j

13、lk = length_k M = mode End Sub '定义输出属性 Public ReadOnly Property rxC As Single Get Return sgl_rxC End Get End Property Public ReadOnly Property ryC As Single Get Return sgl_ryC End Get End Property Public ReadOnly Property vxC As Single Get Return sgl_vxC End Get End Property Public ReadOnly Prop

14、erty vyC As Single Get Return sgl_vyC End Get End Property Public ReadOnly Property axC As Single Get Return sgl_axC End Get End Property Public ReadOnly Property ayC As Single Get Return sgl_ayC End Get End Property Public ReadOnly Property rxE As Single Get Return sgl_rxE End Get End Property Publ

15、ic ReadOnly Property ryE As Single Get Return sgl_ryE End Get End Property Public ReadOnly Property vxE As Single Get Return sgl_vxE End Get End Property Public ReadOnly Property vyE As Single Get Return sgl_vyE End Get End Property Public ReadOnly Property axE As Single Get Return sgl_axE End Get E

16、nd Property Public ReadOnly Property ayE As Single Get Return sgl_ayE End Get End Property Public ReadOnly Property phij As Single Get Return sgl_phij End Get End Property Public ReadOnly Property omegaj As Single Get Return sgl_omegaj End Get End Property Public ReadOnly Property alphaj As Single G

17、et Return sgl_alphaj End Get End Property '计算输出参数 Public Sub Calculate() Dim phii As Double Dim phik As Double Dim s As Double Dim v As Double Dim a As Double '计算phij Dim kDB As Double Dim phiDB As Double Dim phi As Double If rxB <> rxD Then kDB = (ryB - ryD) / (rxB - rxD) If rxB >

18、rxD Then phiDB = Math.Atan(kDB) Else phiDB = Math.Atan(kDB) + Math.PI End If Else If ryB > ryD Then phiDB = Math.PI / 2 Else phiDB = 3 * Math.PI / 2 End If End If phi = Math.Asin(li + lk) / Math.Sqrt(rxB - rxD) * (rxB - rxD) + (ryB - ryD)*_ (ryB - ryD) sgl_phij = phiDB + M * phi If sgl_phij <

19、0 Then sgl_phij += 2 * Math.PI End If '计算s If li = 0 And lk = 0 Then s = Math.Sqrt(rxB - rxD) * (rxB - rxD) + (ryB - ryD) * (ryB - ryD) Else s = (li + lk) / Math.Tan(phi) End If '计算phii,phik phii = sgl_phij + M * Math.PI / 2 phik = sgl_phij - M * Math.PI / 2 '计算rC sgl_rxC = rxB + li * Ma

20、th.Cos(phii) sgl_ryC = ryB + li * Math.Sin(phii) '计算rE sgl_rxE = rxC + (lj - s) * Math.Cos(sgl_phij) sgl_ryE = ryC + (lj - s) * Math.Sin(sgl_phij) '计算omegaj Dim G4 As Double = (rxB - rxD) * Math.Cos(sgl_phij) + (ryB - ryD) *_ Math.Sin(sgl_phij) sgl_omegaj = (vyB - vyD) * Math.Cos(sgl_phij) -

21、 (vxB - vxD) *_ Math.Sin(sgl_phij) / G4 '计算v v = (vxB - vxD) * (rxB - rxD) + (vyB - vyD) * (ryB - ryD) / G4 '计算vC sgl_vxC = vxB - sgl_omegaj * Math.Sin(phii) sgl_vyC = vyB + sgl_omegaj * Math.Cos(phii) '计算alphaj Dim G5 As Double = axB - ayD + sgl_omegaj * sgl_omegaj * (rxB - rxD) + 2 * v

22、 *_ sgl_omegaj * Math.Sin(sgl_phij) Dim G6 As Double = ayB - ayD + sgl_omegaj * sgl_omegaj * (ryB - ryD) - 2 * v *_ sgl_omegaj * Math.Cos(sgl_phij) sgl_alphaj = (G6 * Math.Cos(sgl_phij) - G5 * Math.Sin(sgl_phij) / G4 '计算s a = (G5 * (rxB - rxD) + G6 * (ryB - ryD) / G4 '计算vC sgl_axC = axB - sg

23、l_alphaj * Math.Sin(phii) - sgl_omegaj * sgl_omegaj *_ Math.Cos(phii) sgl_ayC = ayB + sgl_alphaj * Math.Cos(phii) - sgl_omegaj * sgl_omegaj *_ Math.Sin(phii) End SubEnd ClassRRP II级基本组运动分析的源代码Public Class RRP '定义杆组模式枚举类型 Public Enum Mode As Integer ClockWise = 1 AntiClockWise = -1 End Enum '

24、定义输入字段 Public rxB As Single Public ryB As Single Public vxB As Single Public vyB As Single Public axB As Single Public ayB As Single Public rxK As Single Public ryK As Single Public vxK As Single Public vyK As Single Public axK As Single Public ayK As Single Public phij As Single Public omegaj As Si

25、ngle Public alphaj As Single Public li As Single Public lj As Single Public M As Mode '定义输出参数 Private sgl_rxC As Single Private sgl_ryC As Single Private sgl_vxC As Single Private sgl_vyC As Single Private sgl_axC As Single Private sgl_ayC As Single Private sgl_rxD As Single Private sgl_ryD As S

26、ingle Private sgl_vxD As Single Private sgl_vyD As Single Private sgl_axD As Single Private sgl_ayD As Single Private sgl_phii As Double Private sgl_omegai As Double Private sgl_alphai As Double '实例化类并初始化输入字段 Public Sub New(ByVal radiusVector_xB As Single, ByVal radiusVector_yB As Single, ByVal

27、velocity_xB As Single, ByVal velocity_yB As Single, ByVal acceleration_xB As Single, ByVal acceleration_yB As Single, ByVal radiusVector_xK As Single, ByVal radiusVector_yK As Single, ByVal velocity_xK As Single, ByVal velocity_yK As Single, ByVal acceleration_xK As Single, ByVal acceleration_yK As

28、Single, ByVal phi_j As Single, ByVal omega_j As Single, ByVal alpha_j As Single, ByVal length_i As Single, ByVal length_j As Single, ByVal mode As Mode) rxB = radiusVector_xB ryB = radiusVector_yB vxB = velocity_xB vyB = velocity_yB axB = acceleration_xB ayB = acceleration_yB rxK = radiusVector_xK r

29、yK = radiusVector_yK vxK = velocity_xK vyK = velocity_yK axK = acceleration_xK ayK = acceleration_yK phij = phi_j omegaj = omega_j alphaj = alpha_j li = length_i lj = length_j M = mode End Sub '定义输出属性 Public ReadOnly Property rxC As Single Get Return sgl_rxC End Get End Property Public ReadOnly

30、Property ryC As Single Get Return sgl_ryC End Get End Property Public ReadOnly Property vxC As Single Get Return sgl_vxC End Get End Property Public ReadOnly Property vyC As Single Get Return sgl_vyC End Get End Property Public ReadOnly Property axC As Single Get Return sgl_axC End Get End Property

31、Public ReadOnly Property ayC As Single Get Return sgl_ayC End Get End Property Public ReadOnly Property rxD As Single Get Return sgl_rxD End Get End Property Public ReadOnly Property ryD As Single Get Return sgl_ryD End Get End Property Public ReadOnly Property vxD As Single Get Return sgl_vxD End G

32、et End Property Public ReadOnly Property vyD As Single Get Return sgl_vyD End Get End Property Public ReadOnly Property axD As Single Get Return sgl_axD End Get End Property Public ReadOnly Property ayD As Single Get Return sgl_ayD End Get End Property Public ReadOnly Property phii As Single Get Ret

33、urn sgl_phii End Get End Property Public ReadOnly Property omegai As Single Get Return sgl_omegai End Get End Property Public ReadOnly Property alphai As Single Get Return sgl_alphai End Get End Property '计算输出参数 Public Sub Calculate() '计算phii Dim h As Double If Math.Cos(phij) = 0 Then h = rx

34、B - rxK Else h = Math.Abs(Math.Cos(phij) * (ryK - ryB - Math.Tan(phij) * (rxK - rxB) End If If M = Mode.ClockWise Then sgl_phii = Math.Asin(h + lj) / li) + phij Else sgl_phii = Math.PI - Math.Asin(h + lj) / li) + phij End If '计算rC sgl_rxC = rxB + li * Math.Cos(sgl_phii) sgl_ryC = ryB + li * Math

35、.Sin(sgl_phii) '计算rD Dim s As Double = (sgl_rxC - rxK + lj * Math.Sin(phij) / Math.Cos(phij) sgl_rxD = rxK + s * Math.Cos(phij) sgl_ryD = ryK + s * Math.Sin(phij) '计算omegai Dim Q1 As Double = vxK - vxB - omegaj * (s * Math.Sin(phij) + lj *_ Math.Cos(phij) Dim Q2 As Double = vyK - vyB + omega

36、j * (s * Math.Cos(phij) - lj *_ Math.Sin(phij) Dim Q3 As Double = li * Math.Sin(sgl_phii) * Math.Sin(phij) + li *_ Math.Cos(sgl_phii) * Math.Cos(phij) sgl_omegai = (Q2 * Math.Cos(phij) - Q1 * Math.Sin(phij) / Q3 '计算vC sgl_vxC = vxB - sgl_omegai * li * Math.Sin(sgl_phii) sgl_vyC = vyB + sgl_omega

37、i * li * Math.Cos(sgl_phii) '计算vD Dim v As Double = -(Q1 * li * Math.Cos(sgl_phii) + Q2 * li *_ Math.Sin(sgl_phii) / Q3 sgl_vxD = vxK + v * Math.Cos(phij) - s * omegaj * Math.Sin(phij) sgl_vyD = vyK + v * Math.Sin(phij) + s * omegaj * Math.Cos(phij) '计算alphai Dim Q4 As Double = axK - axB + s

38、gl_omegai * sgl_omegai * li *_ Math.Cos(sgl_phii) - alphaj * (s * Math.Sin(phij) + lj * Math.Cos(phij) - omegaj *_ omegaj * (s * Math.Cos(phij) - lj * Math.Sin(phij) - 2 * v * omegaj * Math.Sin(phij) Dim Q5 As Double = ayK - ayB + sgl_omegai * sgl_omegai * li *_ Math.Sin(sgl_phii) + alphaj * (s * Ma

39、th.Cos(phij) - lj * Math.Sin(phij) - omegaj *_ omegaj * (s * Math.Sin(phij) + lj * Math.Cos(phij) + 2 * v * omegaj * Math.Cos(phij) sgl_alphai = (Q5 * Math.Cos(phij) - Q4 * Math.Sin(phij) / Q3 '计算aC sgl_axC = axB - sgl_alphai * li * Math.Sin(sgl_phii) - sgl_omegai * sgl_omegai_ * li * Math.Cos(s

40、gl_phii) sgl_ayC = ayB + sgl_alphai * li * Math.Cos(sgl_phii) - sgl_omegai * sgl_omegai_ * li * Math.Sin(sgl_phii) '计算aD Dim a As Double = -(Q4 * li * Math.Cos(sgl_phii) + Q5 * li *_ Math.Sin(sgl_phii) / Q3 sgl_axD = axK + a * Math.Cos(phij) - s * alphaj * Math.Sin(phij) -s * omegaj *_ omegaj *

41、Math.Cos(phij) - 2 * v * omegaj * Math.Sin(phij) sgl_ayD = ayK + a * Math.Sin(phij) + s * alphaj * Math.Cos(phij) -s * omegaj *_ omegaj * Math.Sin(phij) + 2 * v * omegaj * Math.Cos(phij) End SubEnd Class整个连杆机构运动分析的源代码Public Class Linkage Public Const n As Integer = 999 '定义各点坐标字段 Public rB(n) As

42、PointF Public rD(n) As PointF Public rF(n) As PointFPublic rH(n) As PointF '定义G点运动状态字段 Public rxG(n) As Single Public vxG(n) As Single Public axG(n) As Single '计算整个机构的运动状态 Private Sub Linkage_Load(sender As Object, e As EventArgs) Handles MyBase.Load '定义并初始化已知参数 Dim omega1 As Single = 10

43、 Dim lAB As Single = 170 Dim lCD As Single = 200 Dim lEF As Single = 650 Dim lFG As Single = 500 Dim vxB(n) As Single Dim vyB(n) As Single Dim axB(n) As Single Dim ayB(n) As Single Dim vxD(n) As Single Dim vyD(n) As Single Dim axD(n) As Single Dim ayD(n) As Single Dim vxF(n) As Single Dim vyF(n) As

44、Single Dim axF(n) As Single Dim ayF(n) As Single Dim phiCD(n) As Single Dim omegaCD(n) As Single Dim alphaCD(n) As Single Dim phiEF(n) As Single Dim omegaEF(n) As Single Dim alphaEF(n) As Single Dim phiAB As Single Dim stepPhi As Single = Math.PI * 2 / 1000 Dim AB As RR Dim BBC As RPR Dim CD As RR D

45、im DDE As RPR Dim EF As RR Dim FGG As RRP '计算机构运动状态 For i As Integer = 0 To n phiAB = i * stepPhi '计算B点的运动状态 AB = New RR(0, 0, 0, 0, 0, 0, phiAB, 10, 0, lAB) AB.Calculate() rB(i).X = AB.rxB rB(i).Y = AB.ryB vxB(i) = AB.vxB vyB(i) = AB.vyB axB(i) = AB.axB ayB(i) = AB.ayB '计算H点和CD杆的运动状态 BBC = New RPR(rB(i).X, rB(i).Y, vxB(i), vyB(i), axB(i), ayB(i), -110, 0, 0, 0, 0, 0, 0, 300, 0, 1) BBC.Calculate() rH(i).X = BBC.rxE rH(i).Y = BBC.ryE phiCD(i) = BBC.phij + Math.PI / 2 If phiCD(i) > 2 * Math.PI Then phiCD(i) -= 2 * Math.PI ome

温馨提示

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

评论

0/150

提交评论