机械原理凸轮VB编程

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

理论轮廓线与工作轮廓线Dimr0AsDouble'定义基圆半径DimeAsDouble'定义偏心距DimhAsDouble'定义行程DimfAsDouble'定义凸轮转角DimffAsDoubleDimwAsDouble'定义凸轮角速度Dimf0AsDouble'定义推程运动角DimfsAsDouble'定义远休止角Dimf01AsDouble'定义回程运动角Dimfs1AsDouble'定义近休止角DimsAsDouble'定义从动件位移DimvAsDouble'定义从动件速度DimaAsDouble'定义从动件加速度DimxAsDouble'定义凸轮理论轮廓上点横坐标DimyAsDouble'定义凸轮理论轮廓上点纵坐标Dimx1AsDouble'定义凸轮实际轮廓上点横坐标Dimy1AsDouble'定义凸轮实际轮廓上点纵坐标DimrrAsDouble'定义滚子半径DimpiAsDouble'定义圆周率DimpaAsDouble'定义角度弧度转换中间变量DimTAsDouble'定义中间变量Dims0AsDouble'定义中间变量DimiAsDouble'定义中间变量DimdsdfAsDouble'定义ds/dfDimdxdfAsDouble'定义dx/dfDimdydfAsDouble'定义dy/dfPrivateSubpush()Iff=0Andf=f0/2Thens=2*h*(f/f0)^2v=4*h*w*f/f0^2a=4*h*w^2/f0^2dsdf=4*h*f/f0^2EndIfIff=f0/2Andf=f0Thens=h-2*h*(f0-f)^2/f0^2v=4*h*w*(f0-f)/f0^2a=-4*h*w^2/f0^2dsdf=4*h*(f0-f)/f0^2EndIfEndSubPrivateSubback()Iff=f0+fsAndf=f0+fs+f01/2Thens=h-2*h*(f-(f0+fs))^2/f01^2v=-4*h*w*(f-(f0+fs))/f01^2a=-4*h*w^2/f01^2dsdf=-4*h*(f-(f0+fs))/f01^2EndIfIff=f0+fs+f01/2Andf=f0+fs+f01Thens=2*h*((f0+fs+f01)-f)^2/f01^2v=-4*h*w*((f0+fs+f01)-f)/f01^2a=4*h*w^2/f01^2dsdf=-4*h*((f0+fs+f01)-f)/f01^2EndIfEndSubPrivateSubpushstay()s=hv=0a=0dsdf=0EndSubPrivateSubbackstay()s=0v=0a=0dsdf=0EndSubPrivateSubCommand1_Click()Picture1.ClsPicture1.Scale(-30,110)-(390,-20)Picture1.Line(-30,0)-(390,0)'XPicture1.Line(0,390)-(0,-20)'YFori=0To360Step30'X轴坐标Picture1.Line(i,2)-(i,0)Picture1.CurrentX=i-10:Picture1.CurrentY=0Picture1.PrintiNextiFori=10To110Step10'Y轴坐标Picture1.Line(0,i)-(5,i)Picture1.CurrentX=-30:Picture1.CurrentY=i+2Picture1.PrintiNextiForff=0To360Step0.1f=ffs0=Sqr(r0^2-e^2)Ifff0ThenCallpushElseIff=f0Andffs+f0ThenCallpushstayElseIff=fs+f0Andffs+f0+f01ThenCallbackElseIff=fs+f0+f01Andf=2*piThenCallbackstayEndIfPicture1.PSet(ff,s)NextffEndSubPrivateSubCommand2_Click()Picture1.ClsPicture1.Scale(-30,30)-(390,-30)Picture1.Line(-30,0)-(390,0)'XPicture1.Line(0,390)-(0,-30)'YFori=0To360Step30'X轴坐标Picture1.Line(i,0.5)-(i,0)Picture1.CurrentX=i-10:Picture1.CurrentY=0Picture1.PrintiNextiFori=-100To30Step10'Y轴坐标Picture1.Line(0,i)-(5,i)Picture1.CurrentX=-20:Picture1.CurrentY=i+3Picture1.PrintiNextiForff=0To360Step0.1f=ffIfff0ThenCallpushElseIff=f0Andffs+f0ThenCallpushstayElseIff=fs+f0Andffs+f0+f01ThenCallbackElseIff=fs+f0+f01Andf=360ThenCallbackstayEndIfPicture1.PSet(ff,v)NextffEndSubPrivateSubCommand3_Click()Picture1.ClsPicture1.Scale(-30,10)-(390,-10)Picture1.Line(-30,0)-(390,0)'XPicture1.Line(0,10)-(0,-10)'YFori=0To360Step30'X轴坐标Picture1.Line(i,0.25)-(i,0)Picture1.CurrentX=i-10:Picture1.CurrentY=0Picture1.PrintiNextiFori=-10To10Step2'Y轴坐标Picture1.Line(0,i)-(5,i)Picture1.CurrentX=-20:Picture1.CurrentY=i+1Picture1.PrintiNextiForff=0To360Step0.1f=ffIfff0ThenCallpushElseIff=f0Andffs+f0ThenCallpushstayElseIff=fs+f0Andffs+f0+f01ThenCallbackElseIff=fs+f0+f01Andf=360ThenCallbackstayEndIfPicture1.PSet(ff,a)NextffEndSubPrivateSubCommand4_Click()Picture1.ClsPicture1.Scale(-150,150)-(150,-150)Picture1.Line(-150,0)-(150,0)'XPicture1.Line(0,150)-(0,-150)'YFori=-150To150Step10'X轴坐标Picture1.Line(i,2)-(i,0)Picture1.CurrentX=i-5:Picture1.CurrentY=0Picture1.PrintiNextiFori=-150To150Step10'Y轴坐标Picture1.Line(0,i)-(4,i)Picture1.CurrentX=-13:Picture1.CurrentY=i+5Picture1.PrintiNextif0=f0*pafs=fs*paf01=f01*paForff=0To360Step0.1f=ff*paIfff0ThenCallpushElseIff=f0Andffs+f0ThenCallpushstayElseIff=fs+f0Andffs+f0+f01ThenCallbackElseIff=fs+f0+f01Andf=360ThenCallbackstayEndIfPicture1.PSet(-dsdf,s)NextffEndSubPrivateSubCommand5_Click()Picture1.ClsPicture1.Scale(-200,200)-(200,-200)Picture1.Line(-200,0)-(200,0)'XPicture1.Line(0,200)-(0,-200)'YFori=-200To200Step20'X轴坐标Picture1.Line(i,2)-(i,0)Picture1.CurrentX=i-10:Picture1.CurrentY=0Picture1.PrintiNextiFori=-200To200Step20'Y轴坐标Picture1.Line(0,i)-(5,i)Picture1.CurrentX=-10:Picture1.CurrentY=i+2Picture1.PrintiNextif0=f0*pafs=fs*paf01=f01*paForff=0To360Step0.1f=ff*pas0=70Ifff0ThenCallpushElseIff=f0Andffs+f0ThenCallpushstayElseIff=fs+f0Andffs+f0+f01ThenCallbackElseIff=fs+f0+f01Andf=2*piThenCallbackstayEndIfx=(s+s0)*Cos(f)-e*Sin(f)y=(s+s0)*Sin(f)+e*Cos(f)dxdf=-(s0+s)*Sin(f)-e*Cos(f)dydf=(s0+s)*Cos(f)-e*Sin(f)x1=x+rr*dydf/Sqr(dxdf^2+dydf^2)y1=y-rr*dxdf/Sqr(dxdf^2+dydf^2)Picture1.PSet(x,y)Picture1.PSet(x1,y1)Picture1.PSet(r0*Cos(f),r0*Sin(f))NextffEndSubPrivateSubForm_Load()pi=3.1415926pa=pi/180h=80f0=90fs=100f01=80fs1=90w=10e=40r0=80.623rr=10EndSubDimxBAsDouble'B点x轴坐标DimyBAsDouble'B点y轴坐标DimvxBAsDouble'B点速度x轴分量DimvyBAsDouble'B点速度y轴分量DimaxBAsDouble'B点加速度x轴分量DimayBAsDouble'B点加速度y轴分量DimxCAsDouble'C点x轴坐标DimyCAsDouble'C点y轴坐标DimvxCAsDouble'C点速度x轴分量DimvyCAsDouble'C点速度y轴分量DimaxCAsDouble'C点加速度x轴分量DimayCAsDouble'C点加速度y轴分量DimxDAsDouble'D点x轴坐标DimyDAsDouble'D点y轴坐标DimvxDAsDouble'D点速度x轴分量DimvyDAsDouble'D点速度y轴分量DimaxDAsDouble'D点加速度x轴分量DimayDAsDouble'D点加速度y轴分量DimxEAsDoubleDimyEAsDoubleDimvxEAsDoubleDimvyEAsDoubleDimaxEAsDouble'E点加速度x轴分量DimayEAsDouble'E点加速度y轴分DimxFAsDouble'F点x轴坐标DimyFAsDouble'F点y轴坐标DimvxFAsDouble'F点速度x轴分量DimvyFAsDouble'F点速度y轴分量DimaxFAsDouble'F点加速度x轴分量DimayFAsDouble'F点加速度y轴分量Diml1AsDouble'ab杆长Diml2AsDouble'bc杆长Diml3AsDouble'cd杆长Diml4AsDouble'

1 / 15
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功