您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 经营企划 > 分享一个Python写的克林根贝尔格锥齿轮设计程序
分享一个Python写的克林根贝尔格锥齿轮设计程序这是一个Python语言写的克林根贝尔格锥齿轮的设计与校核程序获取初始参数frommathimportpiaspifrommathimportsinassinfrommathimportcosascosfrommathimporttanastanfrommathimportatanasatanfrommathimportacosasacosfrommathimportasinasasinfrommathimportsqrtassqrtfrommathimportdegreesasdegreesfrommathimportradiansasradianstheta_t=radians(135)alpha_n=radians(20)theta_k=0de1=150beta_m_temp=radians(35)u=1delta_s=atan(sin(theta_t)/(u+cos(theta_t)))mnm=0.5me_min=1z1=1b=1ha_t=1K=1.2S_F=1.4Y_FS=4.35sigmal_FP=1000/S_FT1=1200/ur0=135z0=5whilemnmme_min:de1+=1Re=de1/(2*sin(delta_s))b=int(round(Re*0.333,0))mnm=int(0.1*b/0.5)*0.5z1=int(round((de1-b*sin(delta_s))*cos(beta_m_temp)/mnm,0))me_min=26.3*pow(K*T1*Y_FS/(z1*z1*sqrt(u*u+1)*sigmal_FP),1/3)Ri=Re-b*cos(theta_k)gamma=asin(mnm*z0/(2*r0))Rm=Re-0.5*b*cos(theta_k)zc=z1/sin(delta_s)beta_m=acos(mnm*zc/(2*Rm))Md=sqrt(Rm*Rm+r0*r0-2*Rm*r0*sin(beta_m-gamma))rb=Md/(1+z0/zc)phi_i=acos((Ri*Ri+Md*Md-r0*r0)/(2*Re*Md))beta_i=atan((Ri-rb*cos(phi_i))/(rb*sin(phi_i)))mni=2*Ri*cos(beta_i)/zczv_i1=z1/cos(delta_s)*pow(cos(beta_i),3)xg=1.1*ha_t-(mni*zv_i1*sin(alpha_n)*sin(alpha_n)+b*sin(theta_k))/(2*mnm)print(z1:,z1)print(b:,b)print(mnm:,mnm)print(de1:,de1)print(xg:,xg)初始参数获取效果,(实际要慢慢修调齿宽系数和模数与齿宽的系数,会得到不同的效果)Python3.2(r32:88445,Feb202011,21:29:02)[MSCv.150032bit(Intel)]onwin32Typecopyright,creditsorlicense()formoreinformation.================================RESTART================================z1:42b:44mnm:4.0de1:244xg:-2.0193989028930326详细计算#---moduleimport---frommathimportpiaspifrommathimportsinassinfrommathimportcosascosfrommathimporttanastanfrommathimportatanasatanfrommathimportacosasacosfrommathimportasinasasinfrommathimportsqrtassqrtfrommathimportdegreesasdegreesfrommathimportradiansasradians#---selfdefinefunction----defanghex(x):x_result=[]x_int=int(x)x_minute=int((x-x_int)*60)x_second=int(round((x-x_int-x_minute/60.0)*3600,0))ifx_second==60:x_minute=x_minute+1x_second=0ifx_minute==60:x_int=x_int+1x_minute=0x_result.append(x_int)x_result.append(x_minute)x_result.append(x_second)returnx_resultdefinv(x):result=tan(x)-xreturnresult#-------------------------------#---characters----blank=10#--basicelements---alpha_n=radians(20)z1=43z2=z1u=z2/z1T1=1200/u#-----------------------------K=1.2S_H=1.1S_F=1.4Y_FS=4.35sigmal_HP=1500/S_Hsigmal_FP=1000/S_Fde1_min=1636*pow(K*T1/(u*sigmal_HP*sigmal_HP),1/3)me_min=26.3*pow(K*T1*Y_FS/(z1*z1*sqrt(u*u+1)*sigmal_FP),1/3)print(u:.rjust(blank),u)print(d_min:.rjust(blank),de1_min)print(me_min:.rjust(blank),me_min)#-------------------------theta_t=radians(135)delta_s=atan(sin(theta_t)/(u+cos(theta_t)))delta_b=atan(u*sin(theta_t)/(1+u*cos(theta_t)))delta_t=delta_s+delta_bprint(delta_s:.rjust(blank),degrees(delta_s),anghex(degrees(delta_s)))print(delta_b:.rjust(blank),degrees(delta_b),anghex(degrees(delta_b)))print(delta_t:.rjust(blank),degrees(delta_t),anghex(degrees(delta_t)))#外锥距de1=248de2=u*de1Re=de1/(2*sin(delta_s))print(Re:.rjust(blank),Re)print(de1:.rjust(blank),de1)print(de2:.rjust(blank),de2)#齿宽b_try_q=Re*0.2b_try_l=Re*0.286b_try_h=Re*0.333print(b_try_q:.rjust(blank),b_try_q)print(b_try_l:.rjust(blank),b_try_l)print(b_try_h:.rjust(blank),b_try_h)#齿数mnm=4b=40beta_m_temp=radians(35)z1_try=(de1-b*sin(delta_s))*cos(beta_m_temp)/mnmprint(z1_try:.rjust(blank),z1_try)#中点锥距theta_k=0Rm=Re-0.5*b*cos(theta_k)print(Rm:.rjust(blank),Rm)#假想平面齿轮齿数zc=z1/sin(delta_s)print(zc:.rjust(blank),zc)#实际中点螺旋角beta_m=acos(mnm*zc/(2*Rm))print(beta_m:.rjust(blank),degrees(beta_m),anghex(degrees(beta_m)))#机床距检验r0=100z0=5Md_min=0Md_max=400gamma=asin(mnm*z0/(2*r0))Md=sqrt(Rm*Rm+r0*r0-2*Rm*r0*sin(beta_m-gamma))print(gamma:.rjust(blank),degrees(gamma),anghex(degrees(gamma)))print(Md:.rjust(blank),Md)ifMdMd_minandMdMd_max:print(check:.rjust(blank),Mdcheckpass!)else:print(check:.rjust(blank),Mdcheckfail!!)#基圆半径rb=Md/(1+z0/zc)print(rb:.rjust(blank),rb)#Re处辅助角phi_e=acos((Re*Re+Md*Md-r0*r0)/(2*Re*Md))print(phi_e:.rjust(blank),degrees(phi_e),anghex(degrees(phi_e)))#Ri处辅助角Ri=Re-b*cos(theta_k)phi_i=acos((Ri*Ri+Md*Md-r0*r0)/(2*Re*Md))print(phi_i:.rjust(blank),degrees(phi_i),anghex(degrees(phi_i)))#大端螺旋角beta_e=atan((Re-rb*cos(phi_e))/(rb*sin(phi_e)))print(beta_e:.rjust(blank),degrees(beta_e),anghex(degrees(beta_e)))#小端螺旋角beta_i=atan((Ri-rb*cos(phi_i))/(rb*sin(phi_i)))print(beta_i:.rjust(blank),degrees(beta_i),anghex(degrees(beta_i)))#大端法向模数mne=2*Re*cos(beta_e)/zcprint(mne:.rjust(blank),mne)#小端法向模数mni=2*Ri*cos(beta_i)/zcprint(mni:.rjust(blank),mni)#模数检验ifmnemnmandmnmmni:print(check:.rjust(blank),modulecheckpass!)else:print(check:.rjust(blank),modulecheckfail!!)#法向齿槽最大处的锥距Ry=sqrt(pow((zc-z0)/(zc+z0),2)*Md*Md+r0*r0)print(Ry:.rjust(blank),Ry)#辅助值x_t1=0x_t2=-x_t1ha_t=1.0ha0=1.25*ha_t*mnmHw=2*(x_t1*mnm+ha0*tan(alpha_n))print(Hw:.rjust(blank),Hw)#法向最大齿槽宽zp=z2/sin(delta_b)En_y1=pi*rb/zp-HwEn_y2=En_y1+4*x_t1*mnmEn_e1=pi*mne/2-HwEn_e2=En_e1+4*x_t1*mnmprint(En_y1:.rjust(blank),En_y1)print(En_y2:.rjust(blank),En_y2)print(En_e1:.rjust(blank),En_e1)print(En_e2:.rjust(blank),En_e2)ifRiRyandRyRe:En_max=max(En_y1,E
本文标题:分享一个Python写的克林根贝尔格锥齿轮设计程序
链接地址:https://www.777doc.com/doc-4458863 .html