哈工大机械设计带传动设计电算大作业vb和c语言程序代码.doc_第1页
哈工大机械设计带传动设计电算大作业vb和c语言程序代码.doc_第2页
哈工大机械设计带传动设计电算大作业vb和c语言程序代码.doc_第3页
哈工大机械设计带传动设计电算大作业vb和c语言程序代码.doc_第4页
哈工大机械设计带传动设计电算大作业vb和c语言程序代码.doc_第5页
已阅读5页,还剩8页未读 继续免费阅读

下载本文档

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

文档简介

上机电算说明书课程名称: 机械设计 电算题目: V带传动设计 院 系: 机电控制学院 班 级: 1308102班 设 计 者: 尤开灵 学 号: 1130810222 设计时间: 2015.10.17 部分变量说明(所有说明见程序部分变量定义) ka 工作情况系数 p 输入功率 kwpd 工作功率 kw i 传动比 n1 输入小轮转速 r/min d1 小带轮直径 mm d2 大带轮直径 mm v 皮带速度 m/s jiao 输出包容角度 ff0 初拉力 N ff1 轴间力 N ld 带的长度 mmz 皮带代数 根 m 质量 kg程序运行截图判断语句:包括速度判断选择小轮直径,输入数据判断小轮直径输出结果及其函数界面程序代码Dim ka1 As Double 工作情况系数变量Dim ka As Double 工作情况系数Dim p As Double 输入功率Dim pi As Double pi的定义Dim pd As Double 工作功率Dim i As Double 传动比Dim n1 As Double 输入小轮转速Dim d1 As Double 小带轮直径Dim d2 As Double 大带轮直径Dim k As Double 循环变量Dim a() As Variant 小轮直径选择序列Dim b() As Variant 皮带的长度选择序列Dim nn() As Variant 转速的选择序列Dim mm() As Variant 包容修正系数列表Dim v As Double 皮带速度Dim aa As Double 输入中心距离Dim aaa As Double 输出实际中心距Dim jiao As Double 输出包容角度Dim ff0 As Double 初拉力Dim ff1 As Double 轴间力Dim ld As Double 带的长度Dim shunxu As Double 基本额定功率顺序Dim shunxu1 As Double 长度顺序Dim pnum() As Variant 基本功率序列Dim lxishu() As Variant c长度系数Dim p0 As Double 基本功率Dim dp0 As Double 增加功率Dim z As Double 皮带数Dim kaa As Double 包容修正系数Dim kl As Double 长度系数Dim ki As Double 传动比系数Dim kb As Double 弯曲系数Dim m As Double 质量运行程序Private Sub Command5_Click() 条件输入确定Call f0Call f1Text5.Text = n1 & r/minText4.Text = pd & kwEnd SubPrivate Sub Command2_Click() 小轮直径选择与确定d1 = Val(Text7.Text)Call f2Call f3Call f4End SubPrivate Sub Command3_Click() 中心距离输入aa = Val(Text16.Text)Call f5End SubPrivate Sub Command4_Click() 计算Call f6Call f7Call f8Text6.Text = d1 & mmText9.Text = d2 & mmText10.Text = z & 根Text12.Text = aaa & mmText11.Text = jiao & 度Text13.Text = ff0 & NText14.Text = ff1 & NEnd SubPrivate Sub Command1_Click()EndEnd SubPrivate Sub f0() 参数赋值函数pi = 3.14159p = Val(Text1.Text)i = Val(Text2.Text)n1 = Val(Text3.Text)a() = Array(20, 28, 31.5, 35.5, 40, 45, 50, 56, 63, 71, 75, 80, 90, 100, 112, 125, 140, 150, 160, 180, 200, 224, 250, 280, 315, 355, 400, 425, 450, 500, 560, 600, 630, 710, 800, 0)b() = Array(200, 224, 250, 280, 315, 355, 400, 450, 500, 560, 630, 710, 800, 900, 1000, 1120, 1250, 1400, 1600, 1800, 2000, 2240, 2500, 2800, 3150, 3550, 4000, 4500, 5000, 0)nn() = Array(100, 200, 400, 700, 800, 950, 1200, 1450, 1600, 2000, 2400, 2800, 3200, 3600, 4000, 4500, 5000, 5500, 6000, 0)mm() = Array(0.68, 0.73, 0.78, 0.82, 0.86, 0.89, 0.92, 0.95, 0.98, 1, 1.05, 1.1, 1.15, 1.2, 0)End SubPrivate Sub f1() 选择ka1 计算pdIf dianjileixing.Text = I类 And zaihe.Text = 载荷平稳 And workhour.Text = 16h/天 Then ka1 = 1.2If dianjileixing.Text = I类 And zaihe.Text = 载荷变动小 And workhour.Text = 16h/天 Then ka1 = 1.3If dianjileixing.Text = I类 And zaihe.Text = 载荷变动较大 And workhour.Text = 16h/天 Then ka1 = 1.4If dianjileixing.Text = I类 And zaihe.Text = 载荷变动很大 And workhour.Text = 16h/天 Then ka1 = 1.5If dianjileixing.Text = II类 And zaihe.Text = 载荷平稳 And workhour.Text = 16h/天 Then ka1 = 1.3If dianjileixing.Text = II类 And zaihe.Text = 载荷变动小 And workhour.Text = 16h/天 Then ka1 = 1.4If dianjileixing.Text = II类 And zaihe.Text = 载荷变动较大 And workhour.Text = 16h/天 Then ka1 = 1.6If dianjileixing.Text = II类 And zaihe.Text = 载荷变动很大 And workhour.Text = 16h/天 Then ka1 = 1.8If Check1.Value = 0 Then ka = ka1If Check1.Value = 1 Then ka = ka1 * 1.1pd = p * kaEnd SubPrivate Sub f2() 计算带轮直径d1 = Val(Text7.Text)d2 = 0For k = 0 To 50 Step 1 If a(k) = 0 Then Exit For End If If Abs(a(k) / d1 - i) / i) 20 Then MsgBox 小带轮直径过大!,重新输入直径 Exit SubEnd IfIf v 5 Then MsgBox 小带轮直径过小!,重新输入直径 Exit SubEnd IfEnd SubPrivate Sub f4() 估计中心距离Dim aa0 As DoubleDim aa1 As Doubleaa0 = 0.7 * (d1 + d2)aa1 = 2 * (d1 + d2)Text15.Text = aa0 & - & aa1End SubPrivate Sub f5() 确定带长和中心距和角度 Dim ll As Double Dim c1 As Double Dim c2 As Double If Text8.Text = Y Then lxishu = Array(0.81, 0.82, 0.84, 0.87, 0.9, 0.92, 0.96, 1, 1.02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)If Text8.Text = Z Then lxishu = Array(0, 0, 0, 0, 0, 0, 0.87, 0.89, 0.91, 0.94, 0.96, 0.99, 1, 1.03, 1.06, 1.08, 1.1, 1.14, 1.16, 1.18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)If Text8.Text = A Then lxishu = Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.81, 0.83, 0.85, 0.87, 0.89, 0.91, 0.93, 0.96, 0.99, 1.01, 1.03, 1.06, 1.09, 1.11, 1.13, 1.17, 1.19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)If Text8.Text = B Then lxishu = Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.82, 0.84, 0.86, 0.88, 0.9, 0.92, 0.95, 0.98, 1, 1.03, 1.05, 1.07, 1.09, 1.13, 1.15, 1.18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)If Text8.Text = C Then lxishu = Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.83, 0.86, 0.88, 0.91, 0.93, 0.95, 0.97, 0.99, 1.02, 1.04, 1.07, 1.09, 1.12, 1.15, 1.18, 1.21, 1.23, 0, 0, 0, 0)If Text8.Text = D Then lxishu = Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.83, 0.86, 0.89, 0.91, 0.93, 0.96, 0.98, 1, 1.03, 1.06, 1.08, 1.11, 1.14, 1.17, 1.2, 1.22)If Text8.Text = E Then lxishu = Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.9, 0.92, 0.96, 0.97, 1, 1.02, 1.05, 1.07, 1.1, 1.12, 1.15, 1.18)ll = 2 * aa + pi / 2 * (d1 + d2) + (d1 - d2) 2 / (4 * aa)c2 = 5000For k = 0 To 100 Step 1 c1 = Abs(b(k) - ll) If c1 c2 Then c2 = c1 ld = b(k) shunxu1 = k End If If b(k) = 0 Then Exit For End IfNext kkl = lxishu(shunxu1)aaa = aa + (ld - ll) / 2jiao = 180 - (d2 - d1) / aaa * 57.3)End SubPrivate Sub f6() 确定根数 Dim c1 As Double Dim c2 As Double c2 = 5000 If Text8.Text = Y And Text7.Text = 20 Then pnum = Array(0, 0, 0, 0, 0, 0.01, 0.02, 0.02, 0.03, 0.03, 0.04, 0.04, 0.06, 0.06, 0.07, 0.08, 0.09, 0.1)If Text8.Text = Y And Text7.Text = 28 Then pnum = Array(0, 0, 0, 0, 0.03, 0.04, 0.04, 0.05, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.11, 0.12, 0.13, 0.14, 0.15)If Text8.Text = Y And Text7.Text = 35.5 Then pnum = Array(0, 0, 0, 0.04, 0.05, 0.05, 0.06, 0.06, 0.07, 0.08, 0.09, 0.11, 0.12, 0.13, 0.14, 0.16, 0.18, 0.19, 0.2)If Text8.Text = Y And Text7.Text = 40 Then pnum = Array(0, 0, 0, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.11, 0.12, 0.14, 0.15, 0.16, 0.18, 0.19, 0.2, 0.22, 0.24)If Text8.Text = Z And Text7.Text = 50 Then pnum = Array(0, 0.04, 0.06, 0.09, 0.1, 0.12, 0.14, 0.16, 0.17, 0.2, 0.22, 0.26, 0.28, 0.3, 0.32, 0.33, 0.34, 0.33, 0.31)If Text8.Text = Z And Text7.Text = 63 Then pnum = Array(0, 0.05, 0.08, 0.13, 0.15, 0.18, 0.22, 0.25, 0.27, 0.32, 0.37, 0.41, 0.45, 0.47, 0.49, 0.5, 0.5, 0.49, 0.48)If Text8.Text = Z And Text7.Text = 71 Then pnum = Array(0, 0.06, 0.09, 0.17, 0.2, 0.23, 0.27, 0.3, 0.33, 0.39, 0.46, 0.5, 0.54, 0.58, 0.61, 0.62, 0.62, 0.61, 0.58)If Text8.Text = Z And Text7.Text = 80 Then pnum = Array(0, 0.1, 0.14, 0.2, 0.22, 0.26, 0.3, 0.35, 0.39, 0.44, 0.5, 0.56, 0.61, 0.64, 0.67, 0.67, 0.66, 0.64, 0)If Text8.Text = A And Text7.Text = 75 Then pnum = Array(0, 0.15, 0.26, 0.4, 0.45, 0.51, 0.6, 0.68, 0.73, 0.84, 0.92, 1, 1.04, 1.08, 1.09, 1.07, 1.02, 0.96, 0.8)If Text8.Text = A And Text7.Text = 90 Then pnum = Array(0, 0.22, 0.39, 0.61, 0.68, 0.77, 0.93, 1.07, 1.15, 1.34, 1.5, 1.64, 1.73, 1.83, 1.87, 1.88, 1.82, 0, 0)If Text8.Text = A And Text7.Text = 100 Then pnum = Array(0, 0.26, 0.47, 0.74, 0.83, 0.95, 1.14, 1.32, 1.42, 1.66, 1.87, 2.05, 2.19, 2.28, 2.34, 2.33, 0, 0, 0)If Text8.Text = A And Text7.Text = 125 Then pnum = Array(0, 0.37, 0.67, 1.07, 1.19, 1.37, 1.66, 1.92, 2.07, 2.44, 2.74, 2.98, 3.16, 3.26, 0, 0, 0, 0, 0)If Text8.Text = B And Text7.Text = 125 Then pnum = Array(0, 0.48, 0.84, 1.3, 1.44, 1.64, 1.93, 2.19, 2.33, 2.64, 2.85, 2.96, 2.94, 2.8, 0, 0, 0, 0, 0)If Text8.Text = B And Text7.Text = 140 Then pnum = Array(0, 0.59, 1.05, 1.64, 1.82, 2.08, 2.47, 2.82, 3, 3.42, 3.7, 3.85, 3.83, 0, 0, 0, 0, 0, 0)If Text8.Text = B And Text7.Text = 160 Then pnum = Array(0, 0.74, 1.32, 2.09, 2.32, 2.66, 3.17, 3.62, 3.86, 4.4, 4.75, 4.89, 0, 0, 0, 0, 0, 0, 0)If Text8.Text = B And Text7.Text = 180 Then pnum = Array(0, 0.88, 1.59, 2.53, 2.81, 3.22, 3.85, 4.39, 4.68, 5.3, 5.67, 0, 0, 0, 0, 0, 0, 0, 0)If Text8.Text = C And Text7.Text = 200 Then pnum = Array(0, 1.39, 2.41, 3.69, 4.07, 4.58, 5.29, 5.84, 6.07, 6.34, 6.02, 0, 0, 0, 0, 0, 0, 0, 0)If Text8.Text = C And Text7.Text = 250 Then pnum = Array(0, 2.03, 3.62, 5.64, 6.23, 7.04, 8.21, 9.04, 9.38, 9.62, 0, 0, 0, 0, 0, 0, 0, 0, 0)If Text8.Text = C And Text7.Text = 315 Then pnum = Array(0, 2.84, 5.14, 8.09, 8.92, 10.05, 11.53, 12.46, 12.72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)If Text8.Text = C And Text7.Text = 400 Then pnum = Array(0, 3.91, 7.06, 11.02, 12.1, 13.48, 15.04, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)If Text8.Text = D And Text7.Text = 355 Then pnum = Array(3.01, 5.31, 9.24, 13.7, 14.83, 16.15, 17.25, 16.77, 15.63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)If Text8.Text = D And Text7.Text = 400 Then pnum = Array(3.66, 6.52, 11.45, 17.07, 18.46, 20.06, 21.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)If Text8.Text = D And Text7.Text = 450 Then pnum = Array(4.37, 7.9, 13.85, 20.63, 22.25, 24.01, 24.84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)If Text8.Text = D And Text7.Text = 500 Then pnum = Array(5.08, 9.21, 16.2, 23#, 25.76, 27.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)If Text8.Text = E And Text7.Text = 500 Then pnum = Array(6.21, 10.86, 18.55, 26.21, 27.57, 28.32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)If Text8.Text = E And Text7.Text = 560 Then pnum = Array(7.32, 13.09, 22.49, 31.59, 33.03, 33.4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)If Text8.Text = E And Text7.Text = 630 Then pnum = Array(8.75, 15.65, 26.95, 37.26, 38.62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)If Text8.Text = E And Text7.Text = 710 Then pnum = Array(10.31, 18.52, 31.83, 42.87, 43.52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)For k = 0 To 20 Step 1 c1 = Abs(nn(k) - n1) If c1 = 1 And i = 1.02 And i = 1.05 And i = 1.09 And i = 1.13 And i = 1.19 And i = 1.25 And i = 1.35 And i = 1.52 And i = 2 Then ki = 1.1373End IfFor k = 0 To 21 Step 1 c1 = Abs(100 + k * 10 - jiao) If c1 = 10 Then MsgBox 小带轮直径和带型选择不合适!,重新输入直径和选择带型 Exit SubEnd IfEnd SubPrivate Sub f7() 选择质量函数If Text8.Text = Z Thenm = 0.06ElseIf Text8.Text = A Thenm = 0.1ElseIf Text8.Text = B Thenm = 0.17ElseIf Text8.Text = C Thenm = 0.3ElseIf Text8.Text = D Thenm = 0.6ElseIf Text8.Text = E Thenm = 0.9End IfEnd SubPrivate Sub f8() 计算初拉力和轴向力ff0 = 500 * pd / z / v * (2.5 - kaa) / kaa + m * v * vff1 = 2 * z * ff0 * Sin(jiao * pi / 2 / 180)ff0 = Round(ff0, 3)ff1 = Round(ff1, 3)aaa = Round(aaa, 3)jiao = Round(jiao, 3)End Sub#include#include#include#define PAI 3.14#includefloat Select_dd1(int TYPE)int i;float dd1;float DD164=50,63,71,80,75,90,100,125,125,140,160,180,200,250,315,400,355,400,450,500,500,560,630,710;printf(该带型推荐的小带轮基准直径有(mm):n);for(i=0;i4;i+)printf(%.2f ,DD1TYPEi);printf(n请选择小带轮基准直径dd1:);scanf(%f,&dd1);return dd1;float Select_dd2(int dd1,float i)float DD2=50,56,63,71,80,90,100,112,125,140,150,160,180,200,224,250,280,315,355,400,425,450,500,560,600,630,710,800;float dd2,temp,t;int j=0;temp=i*dd1;for(j=0;j28;j+)t=temp-DD2j;if(t=0)break;if(DD2j-temp)(temp-DD2j-1)dd2=DD2j;elsedd2=DD2j-1;return dd2;float* Compute_LAK(float dd1,float dd2,int TYPE)int j=0;float a1,a2,a0,Ld0,temp,KALF,Ld,a,KL;float LAK3;float kl236=400,0.87,450,0.89,500,0.91,560,0.94,630,0.96,0.81,710,0.99,0.83,800,1.00,0.85,0.82,900,1.03,0.87,0.84,0.83,1000,1.06,0.89,0.86,0.86,0.83,1120,1.08,0.91,0.88,0.88,0.86,1250,1.10,0.93,0.90,0.91,0.89,1400,1.14,0.96,0.92,0.93,0.91,1600,1.16,0.99,0.95,0.95,0.93,1800,1.18,1.01,0.98,0.97,0.96,2000,0,1.03,1.00,0.99,0.98,2240,0,1.06,1.03,1.02,1.00,2500,0,1.09,1.05,1.04,1.03,2800,0,1.11,1.07,1.07,1.06,3150,0,1.13,1.09,1.09,1.08,3550,0,1.17,1.13,1.12,1.11,4000,0,1.19,1.15,1.15,1.14,4500,0,0,1.18,1.18,1.17,5000,0,0,0,1.21,1.20;a1=0.7*(dd1+dd2);a2=2*(dd1+dd2);printf(请选择输入初估中心距a0(范围为%.2fmm%.2fmm):,a1,a2);scanf(%f,&a0);Ld0=2*a0+(dd1+dd2)*PAI/2+(dd2-dd1)*(dd2-dd1)/a0/4;for(j=0;j23;j+)temp=Ld0-klj0;if(temp(klj0-Ld0)Ld=klj0;KL=kljTYPE+1;elseLd=klj-10;KL=klj-1TYPE+1;a=a0+(Ld-Ld0)/2;LAK0=Ld;LAK1=a;LAK2=KL;return LAK;int main() float ka143=1.0,1.1,1.2,1.1,1.2,1.3,1.2,1.3,1.4,1.3,1.4,1.5;float ka243=1.1,1.2,1.3,1.2,1.3,1.4,1.4,1.5,1.6,1.5,1.6,1.8; float K16=0.246,0.449,0.794,1.48,3.15,4.57; float KI10=1.0000,1.0136,1.0276,1.0419,1.0567,1.0719,1.0875,1.1036,1.1202,1.1373;float I10=1.00,1.02,1.05,1.09,1.13,1.19,1.25,1.35,1.52,2.00;float K26=7.44,19.02,50.6,143.2,507.3,951.5;float K36=0.441e-4,0.765e-4,1.31e-4,2.34e-4,4.77e-4,7.06e-4;float KB6=0.2925e-3,0.7725e-3,1.9875e-3,5.625e-3,19.95e-3,37.35e-3;float kalf214=220,210,200,190,180,170,160,150,140,130,120,110,100,90,1.20,1.15,1.10,1.05,1.00,0.98,0.95,0.92,0.89,0.86,0.82,0.78,0.73,0.68; float M6=0.06,0.1,0.17,0.3,0.6,0.9; float f6=8,10,12.5,17,23,29;float e6=12,15,19,25.5,37,44.5;float P,H,i,n1,KA,Ki,dd1,dd2,V,P0,DIFP0,Pd,VMAX,*LAK,m,Ld,KALF,a,KL,z,F0,ALF1,Q,B,Kb;int YDJ,GZJ,TYPE,ANS,j;char type,ans;printf( V带传动设计程序n);START:printf(请输入初始参数:n);printf(电机额定功率P(KW):);scanf(%f,&P);printf(小带轮/电动机转速n1(r/min):);scanf(%f,&n1);printf(传动比i:);scanf(%f,&i);printf(每天工作时间H(h):);scanf(%f,&H);p

温馨提示

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

评论

0/150

提交评论