哈尔滨工业大学电算说明书HHaarrbbiinnIInnssttiittuutteeooffTTeecchhnnoollooggyy课课程程设设计计说说明明书书((论论文文))课程名称:机械设计电算大作业设计题目:V带传动电子计算器院系:机电工程学院班级:1508502设计者:于豪学号:1150850206指导教师:曲建俊设计时间:2017.10,11哈尔滨工业大学哈尔滨工业大学电算说明书一、电算流程图哈尔滨工业大学电算说明书二、用户界面三、操作说明(一)求设计功率和带轮转速:在左侧输入框中依次输入电机功率、电机转速、第一级传动比,并选择工作载荷情况、原动机类型、工作时间,最后勾选特殊工作需求,就可以按“计算设计功率Pd、带轮转速n1”键进行一次计算。(二)确定V带类型:根据所求的设计功率和转速,在中央的表中找到对应的V带类型,并勾选对应类型的带轮。这时会出现对应的带轮系列直径。(三)确定小带轮和大带轮直径:在带轮系列中选择一个小带轮直径填入右侧输入框。若V带速度合理,则在下方结果处输出大轮小轮直径;若V带速度大于最大V带速度,则在提示栏提示“choosedd1again”。(四)确定中心距和实际基准长度:利用上一步中得出的中心距范围,在输入框中填入初步中心间距,求出初步基准长度。查书上实际基准长度表,获得实际基准长度和对应的带长修正系数,填入右下的输入框中。(五)输出剩余结果:按下输出结果按钮,计算器自动输出V带设计中需要的所有参数到下方的结果显示表中,完成一次计算。哈尔滨工业大学电算说明书四、电子计算器代码functionvarargout=trymechanicaldesign(varargin)gui_Singleton=1;gui_State=struct('gui_Name',mfilename,...'gui_Singleton',gui_Singleton,...'gui_OpeningFcn',@trymechanicaldesign_OpeningFcn,...'gui_OutputFcn',@trymechanicaldesign_OutputFcn,...'gui_LayoutFcn',[],...'gui_Callback',[]);ifnargin&&ischar(varargin{1})gui_State.gui_Callback=str2func(varargin{1});endifnargout[varargout{1:nargout}]=gui_mainfcn(gui_State,varargin{:});elsegui_mainfcn(gui_State,varargin{:});end%Endinitializationcode-DONOTEDIT%%GUI自动生成的打开窗口准备程序哈尔滨工业大学电算说明书functiontrymechanicaldesign_OpeningFcn(hObject,eventdata,handles,varargin)handles.output=hObject;guidata(hObject,handles);%%在窗口打开同时完成下列数据输入globaldata_KA;%%将KA数值存入数组fora=1:4forb=1:3forc=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];globaldata_dd1;%%将小带轮系列直径存入数组fora=1:6forb=1:4data_dd1(a,b)=0;endenddata_dd1(1,:)=[50637180];data_dd1(2,:)=[7590100125];哈尔滨工业大学电算说明书data_dd1(3,:)=[125140160180];data_dd1(4,:)=[200250315400];data_dd1(5,:)=[355400450500];data_dd1(6,:)=[500560630710];globaldata_Kbdata_K1data_K2data_K3;%%将Kb、K1、K2、K3数值存入数组data_Kb=[0.29250.77251.98755.62519.9537.35]*10^(-3);data_K1=[0.2460.4490.7941.483.154.57];data_K2=[7.4419.0250.6143.2507.3951.5];data_K3=[0.4410.7651.312.344.777.06]*10^(-4);globaldata_edata_fdata_m;将e、f、带轮单位质量数值存入数组data_e=[12151925.53744.5];data_f=[81012.5172329];;data_m=[0.0230.060.1050.170.300.630.97];functionvarargout=trymechanicaldesign_OutputFcn(hObject,eventdata,handles)varargout{1}=handles.output;functionedit1_Callback(hObject,eventdata,handles)functionedit1_CreateFcn(hObject,eventdata,handles)ifispc&&isequal(get(hObject,'BackgroundColor'),哈尔滨工业大学电算说明书get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');endfunctionedit2_Callback(hObject,eventdata,handles)ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');endfunctionedit2_CreateFcn(hObject,eventdata,handles)functionedit6_Callback(hObject,eventdata,handles)functionedit6_CreateFcn(hObject,eventdata,handles)ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');endfunctionedit7_Callback(hObject,eventdata,handles)ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))哈尔滨工业大学电算说明书set(hObject,'BackgroundColor','white');endfunctionpopupmenu1_Callback(hObject,eventdata,handles)ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');endfunctionpopupmenu1_CreateFcn(hObject,eventdata,handles)functionpopupmenu2_Callback(hObject,eventdata,handles)functionpopupmenu2_CreateFcn(hObject,eventdata,handles)functionpopupmenu3_Callback(hObject,eventdata,handles)functionpopupmenu3_CreateFcn(hObject,eventdata,handles)ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');endfunctioncheckbox1_Callback(hObject,eventdata,handles)哈尔滨工业大学电算说明书functioncheckbox2_Callback(hObject,eventdata,handles)functioncheckbox3_Callback(hObject,eventdata,handles)functionpushbutton2_Callback(hObject,eventdata,handles)globaldata_KA;%%调用已经存好的全局数组globalPdKAn1i;%%声明设计功率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');specialcondition3=get(handles.checkbox3,'value');%%获得工作环境及特殊条件KA=data_KA(workstress,machinekind,worktime);%%通过已知工作环境确定KAifspecialcondition1==1%%如果有特殊工作要求则KA乘上1.1。KA=1.1*KA;elseifspecialcondition2==1KA=1.1*KA;elseifspecialcondition3==1KA=1.1*KA;end哈尔滨工业大学电算说明书P=str2double(get(handles.edit1,'string'));%%获得输入的电机功率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);%%输出设计功率和带轮转速functionuibuttongroup1_SelectionChangedFcn(hObject,eventdata,handles)globaldata_dd1;globalvmax;globalbeltkind;%%声明或定义新的全局变量switchget(hObject,'tag')%%获得选择的V带种类并确定最大速度限制case'radiobutton1'beltkind=1;vmax=25;set(handles.text53,'string','Z')case'rad