1、哈尔滨工业大学电算说明书Harbin Institute of Technology课程设计说明书(论文)课程设计说明书(论文)课程名称: 机械设计电算大作业 设计题目: V 带传动电子计算器 院 系: 机电工程学院 班 级: 1508502 设 计 者: 于豪 学 号: 1150850206 指导教师: 曲建俊 设计时间: 2017.10,11 哈尔滨工业大学哈尔滨工业大学电算说明书一、 电算流程图哈尔滨工业大学电算说明书二、 用户界面三、 操作说明(一) 求设计功率和带轮转速:在左侧输入框中依次输入电机功率、电机转速、第一级传动比,并选择工作载荷情况、原动机类型、工作时间,最后勾选特殊工作
2、需求,就可以按“计算设计功率 Pd、带轮转速 n1”键进行一次计算。(二) 确定 V 带类型:根据所求的设计功率和转速,在中央的表中找到对应的 V 带类型,并勾选对应类型的带轮。这时会出现对应的带轮系列直径。(三) 确定小带轮和大带轮直径:在带轮系列中选择一个小带轮直径填入右侧输入框。若 V 带速度合理,则在下方结果处输出大轮小轮直径;若 V 带速度大于最大 V 带速度,则在提示栏提示“choose dd1 again”。(四) 确定中心距和实际基准长度:利用上一步中得出的中心距范围,在输入框中填入初步中心间距,求出初步基准长度。查书上实际基准长度表,获得实际基准长度和对应的带长修正系数,填入
3、右下的输入框中。(五) 输出剩余结果:按下输出结果按钮,计算器自动输出 V 带设计中需要的所有参数到下方的结果显示表中,完成一次计算。哈尔滨工业大学电算说明书四、 电子计算器代码function varargout = trymechanicaldesign(varargin)gui_Singleton = 1;gui_State = struct(gui_Name, mfilename, .gui_Singleton, gui_Singleton, .gui_OpeningFcn, trymechanicaldesign_OpeningFcn, .gui_OutputFcn, trymech
4、anicaldesign_OutputFcn, .gui_LayoutFcn, , .gui_Callback, );if nargin endif nargoutvarargout1:nargout = gui_mainfcn(gui_State, varargin:);elsegui_mainfcn(gui_State, varargin:);end% End initialization code - DO NOT EDIT%GUI自动生成的打开窗口准备程序哈尔滨工业大学电算说明书function trymechanicaldesign_OpeningFcn(hObject, event
5、data, handles, varargin)handles.output = hObject;guidata(hObject, handles);%在窗口打开同时完成下列数据输入global data_KA;%将 KA数值存入数组for a=1:4for b=1:3for c=1:2data_KA(a,b,c)=0;endendenddata_KA(:,:,1)=1.0,1.1,1.2;1.1,1.2,1.3;1.2,1.3,1.4;1.3,1.4,1.5;data_KA(:,:,2)=1.1,1.2,1.3;1.2,1.3,1.4;1.4,1.5,1.6;1.5,1.6,1.8;glob
6、al data_dd1; %将小带轮系列直径存入数组for a = 1:6for b = 1:4data_dd1(a,b)=0;endenddata_dd1(1,:)=50 63 71 80;data_dd1(2,:)=75 90 100 125;哈尔滨工业大学电算说明书data_dd1(3,:)=125 140 160 180;data_dd1(4,:)=200 250 315 400;data_dd1(5,:)=355 400 450 500;data_dd1(6,:)=500 560 630 710;global data_Kb data_K1 data_K2 data_K3; %将 K
7、b、K1、K2、K3 数值存入数组data_Kb = 0.2925 0.7725 1.9875 5.625 19.95 37.35*10(-3);data_K1 = 0.246 0.449 0.794 1.48 3.15 4.57;data_K2 = 7.44 19.02 50.6 143.2 507.3 951.5;data_K3 = 0.441 0.765 1.31 2.34 4.77 7.06*10(-4);global data_e data_f data_m; 将 e、f、带轮单位质量数值存入数组data_e = 12 15 19 25.5 37 44.5;data_f = 8 10
8、 12.5 17 23 29;data_m = 0.023 0.06 0.105 0.17 0.30 0.63 0.97;function varargout = trymechanicaldesign_OutputFcn(hObject, eventdata, handles) varargout1 = handles.output;function edit1_Callback(hObject, eventdata, handles)function edit1_CreateFcn(hObject, eventdata, handles)if ispc endfunction edit2_
9、Callback(hObject, eventdata, handles)if ispc endfunction edit2_CreateFcn(hObject, eventdata, handles)function edit6_Callback(hObject, eventdata, handles)function edit6_CreateFcn(hObject, eventdata, handles)if ispc endfunction edit7_Callback(hObject, eventdata, handles)if ispc endfunction popupmenu1_
10、Callback(hObject, eventdata, handles)if ispc endfunction popupmenu1_CreateFcn(hObject, eventdata, handles)function popupmenu2_Callback(hObject, eventdata, handles)function popupmenu2_CreateFcn(hObject, eventdata, handles)function popupmenu3_Callback(hObject, eventdata, handles)function popupmenu3_Cr
11、eateFcn(hObject, eventdata, handles)if ispc endfunction checkbox1_Callback(hObject, eventdata, handles)哈尔滨工业大学电算说明书function checkbox2_Callback(hObject, eventdata, handles)function checkbox3_Callback(hObject, eventdata, handles)function pushbutton2_Callback(hObject, eventdata, handles)global data_KA;
12、%调用已经存好的全局数组global Pd KA n1 i;%声明设计功率 Pd、转速 n1、传动 i、KA 为全局变量workstress = get(handles.popupmenu1,value);machinekind = get(handles.popupmenu2,value);worktime = get(handles.popupmenu3,value); specialcondition1 = get(handles.checkbox1,value);specialcondition2 = get(handles.checkbox2,value);specialcondit
13、ion3 = get(handles.checkbox3,value); %获得工作环境及特殊条件KA = data_KA(workstress,machinekind,worktime);%通过已知工作环境确定 KAif specialcondition1 = 1%如果有特殊工作要求则 KA乘上 1.1。KA = 1.1*KA;elseif specialcondition2 = 1KA = 1.1*KA;elseif specialcondition3 =1KA = 1.1*KA;end哈尔滨工业大学电算说明书P = str2double(get(handles.edit1,string)
14、;%获得输入的电机功率n1 = str2double(get(handles.edit2,string); %获得输入的电机转速i = str2double(get(handles.edit6,string); %获得输入的传动比Pd = P * KA; %计算设计功率set(handles.text14,String, Pd);set(handles.text16,String, n1); %输出设计功率和带轮转速function uibuttongroup1_SelectionChangedFcn(hObject, eventdata, handles)global data_dd1;gl
15、obal vmax;global beltkind;%声明或定义新的全局变量switch get(hObject,tag) %获得选择的 V带种类并确定最大速度限制case radiobutton1beltkind = 1;vmax = 25;set(handles.text53,string,Z)case radiobutton2beltkind = 2;vmax = 25;set(handles.text53,string,A)case radiobutton3beltkind = 3;vmax = 25;哈尔滨工业大学电算说明书set(handles.text53,string,B)ca
16、se radiobutton4beltkind = 4;vmax = 25;set(handles.text53,string,C)case radiobutton5beltkind = 5;vmax = 30;set(handles.text53,string,D)case radiobutton6beltkind = 6;vmax = 30;set(handles.text53,string,E)endset(handles.text19,string,data_dd1(beltkind,:);%输出所选 V带类型对应的小带轮系列直径function edit9_Callback(hObj
17、ect, eventdata, handles)function edit9_CreateFcn(hObject, eventdata, handles)if ispc end哈尔滨工业大学电算说明书function pushbutton4_Callback(hObject, eventdata, handles)global dd1 dd2 n1 i v vmax;dd1 = str2double(get(handles.edit9,string);%得到所选的小带轮直径dd2 = i * dd1;%计算得到大带轮直径v = pi * dd1 * n1 / 60 /1000;%计算速度if
18、vvmax%检验带轮速度set(handles.text33,string,choose dd1 again);elsedd2 = round(dd2);set(handles.text25,string,dd1);set(handles.text27,string,dd2);amax = 2* (dd1 + dd2);amin = 0.7* (dd1 + dd2);set(handles.text36,string,amax);set(handles.text34,string,amin);endfunction edit10_Callback(hObject, eventdata, han
19、dles)function edit10_CreateFcn(hObject, eventdata, handles)if ispc 哈尔滨工业大学电算说明书endfunction edit10_KeyPressFcn(hObject, eventdata, handles)function edit11_Callback(hObject, eventdata, handles)function edit11_CreateFcn(hObject, eventdata, handles)if ispc endfunction edit12_Callback(hObject, eventdata,
20、 handles)function edit12_CreateFcn(hObject, eventdata, handles)if ispc endfunction pushbutton6_Callback(hObject, eventdata, handles)global dd1 dd2 ;a0 = str2double(get(handles.edit10,string);哈尔滨工业大学电算说明书Ld0 = 2*a0 +pi*(dd1+dd2)/2+(dd1-dd2)2/4/a0;set(handles.text38,string,Ld0);%根据输入的初步中心距计算初步基准长度func
21、tion pushbutton5_Callback(hObject, eventdata, handles)global dd1 dd2 n1 i v Pd data_m;global beltkind data_Kb data_K1 data_K2 data_K3 ;global data_e data_f;Ld = str2double(get(handles.edit11,string);%获得实际基准长度a = round(2*Ld - pi*(dd1+dd2) + (2*Ld-pi*(dd1+dd2)2-8*(dd2-dd1)2)(1/2)/8);set(handles.text29
22、,string,a);set(handles.text31,string,Ld);%输出实际基准长度和中心距ALF1 =180 - (dd2-dd1)*57.3/a;%计算小带轮包角set(handles.text42,string,ALF1);%输出小带轮包角switch round(ALF1/10)%确定带轮包角修正系数case 22KALF = 1.2;case 21KALF = 1.15;case 20KALF = 1.10;case 19KALF = 1.05;哈尔滨工业大学电算说明书case 18KALF = 1;case 17KALF = 0.98; case 16KALF =
23、0.95;case 15KALF = 0.92;case 14KALF = 0.89;case 13KALF = 0.86;case 12KALF = 0.82;case 11KALF = 0.78; case 10KALF = 0.74; case 9KALF = 0.69; endi = round(i,2);%确定传动比修正系数哈尔滨工业大学电算说明书if i =1Ki = 1;elseif i =1.02Ki = 1.0136;elseif i =1.05Ki = 1.0276;elseif i =1.09Ki = 1.0419;elseif i =1.13Ki = 1.0567;el
24、seif i =1.19Ki = 1.0719;elseif i =1.25Ki = 1.0875;elseif i =1.35Ki = 1.1036;elseif i =1.52Ki = 1.1202;elseif i =2Ki = 1.1373;endKL = str2double(get(handles.edit12,string);%获得基准长度修正系数哈尔滨工业大学电算说明书Kb = data_Kb(beltkind);K1 = data_K1(beltkind);K2 = data_K2(beltkind);K3 = data_K3(beltkind); %在从已存数据库中调用 K
25、b、K1、K2、K3P0 = (K1*v(-0.09) - K2/dd1 - K3*v2)*v;DIFP0 = Kb*n1*(1-1/Ki);z = ceil(Pd/(P0 + DIFP0)/KALF/KL);%求 V带数 zset(handles.text45,string,z);%输出 V带数m = data_m(beltkind);F0 = 500*Pd*(2.5 - KALF)/v/z/KALF+ m*v2;set(handles.text47,string,F0);%计算并输出初始拉力FQ = 2*F0*z*sin(ALF1/2);set(handles.text49,string,FQ);%计算并输出轴向拉力e = data_e(beltkind);f = data_f(beltkind);B = (z-1)*e +2*f;set(handles.text51,string,B); %计算并输出 V带宽度function axes3_CreateFcn(hObject, eventdata, handles)imshow(imread(chooseV.jpg);%显示图表