沈阳航空航天大学铰链四杆机构设计报告学院:机电工程学院班级:姓名:学号: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 * / 180 初始角度转弧度Call bj(bjj)If bjj = 1 Then Exit Subw1 = 0Call jsgw1 = Val 公式计算角速度,角加速度w2 = -w1 * l1 * Sin(a - c) / (l3 * Sin(b - c))w3 = w1 * l1 * Sin(a - b) / (l2 * Sin(c - b))= w2= w3a2 = (l3 * w3 * w3 - l1 * w1 * w1 * Cos(a - c) - l2 * w2 * w2 * Cos(b - c)) / (l2 * Sin(b - c))a3 = (l2 * w2 * w2 + l1 * w1 * w1 * Cos(a - b) - l3 * w3 * w3 * Cos(c - b)) / (l3 * Sin(c - b)) = a2= a3End SubFunction jsg()If p = 0 Then p = -1On Error GoTo ela = a + * 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 ^ 2) * p) / (d - f))b = Atn((e + l3 * Sin(c)) / (d + l3 * Cos(c)))w1 = -w1el:w1 = -w1Line1(0).Y1 = / 2 定义各个线段端点的坐标Line1(0).X1 = / 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 = 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 连接两杆转动副的中心坐标Shape1(i).Top = Line1(i).Y1 - 50Next i(Line1(1).X1, Line1(1).Y1), vbRed 画出主动件和连架杆的轨迹(Line1(2).X1, Line1(2).Y1), vbGreenEnd 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 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。
(-8, 4)-(8, -4) 画出角速度w2函数图像, 0)-, 0)(0, -(0,= : = : "x"= : = 4: "y"For i = -7 To 7(i, 0)-(i,= i - : = : iNext iFor i = To StepIf i > And i < Then i = 0= : = i + : i, i)-(0, i)Next iDim a1, b1, c1, d1, e1, f1, w11#w11 =For x = To StepIf 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 = -w11el:w11 = -w11w111 = Valw21 = -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 * w31 * w31 * Cos(c1 - b1)) / (l3 * Sin(c1 - b1))(x, w21)Next xEnd IfEnd Sub(-8, -(8, 画出角速度w3函数图像, 0)-, 0)(0, -(0,= : = : "x"= : = : "y"For i = -7 To 7(i, 0)-(i,= i - : = : iNext iFor i = To StepIf i > And i < Then i = 0= : = i + : i, i)-(0, i)Next iDim a1, b1, c1, d1, e1, f1, w11#w11 =For x = To StepIf 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 = -w11el:w11 = -w11w111 = Valw21 = -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 * w31 * w31 * Cos(c1 - b1)) / (l3 * Sin(c1 - b1))(x, w31)Next xEnd IfEnd SubPrivate Sub Picture4_DblClick() 画出角加速度a2d(-8, 8)-(8, -8), 0)-, 0)(0, -(0,= : = : "x"= : = 8: "y"For i = -7 To 7(i, 0)-(i,= i - : = : iNext iFor i = 7 To -7 StepIf i > And i < Then i = 0= : = i + : i, i)-(0, i)Next iDim a1, b1, c1, d1, e1, f1, w11#w11 =For x = To StepIf 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 IsEmpty(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 = ValIf 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 * w31 * w31 * Cos(c1 - b1)) / (l3 * Sin(c1 - b1))(x, a21)(-8, 8)-(8, -8) 画出角加速度a3 , 0)-, 0)(0, -(0,= : = : "x"= : = 8: "y"For i = -7 To 7(i, 0)-(i,= i - : = : iNext iFor i = -7 To 7 StepIf i > And i < Then i = 0= : = i + : i, i)-(0, i)Next iDim a1, b1, c1, d1, e1, f1, w11#w11 =For x = To StepIf 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 = -w11el:w11 = -w11w111 = Valw21 = -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 * w31 * w31 * Cos(c1 - b1)) / (l3 * Sin(c1 - b1))(x, a31)(-8, -(8, 角位移s2,s3函数的输出, 0)-, 0)(0, -(0,= : = : "x"= : = : "y"For i = -7 To 7 Step(i, 0)-(i,= i - : = : iNext iFor i = -3 To StepIf i > And i < Then i = 0= : = i + : i, i)-(0, i)Next iDim a1, b1, c1, d1, e1, f1, w11#w11 =For x = To StepIf 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 = -w11el:w11 = -w11If x = Then czd = c1: czx = c1If czd < c1 Then czd = c1If czx > c1 Then czx = c1= czd - czxIf x = Then czd1 = b1: czx1 = b1If czd1 < b1 Then czd1 = b1If czx1 > b1 Then czx1 = b1= czd1 - czx1(x, c1)(x, b1), vbRed。