基于AutoCAD, VB,Mathematica和Working model的凸轮设计与仿真_第1页
基于AutoCAD, VB,Mathematica和Working model的凸轮设计与仿真_第2页
基于AutoCAD, VB,Mathematica和Working model的凸轮设计与仿真_第3页
基于AutoCAD, VB,Mathematica和Working model的凸轮设计与仿真_第4页
基于AutoCAD, VB,Mathematica和Working model的凸轮设计与仿真_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

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

文档简介

1、基于AutoCAD, VB,Mathematica和Working model的凸轮设计与仿真 目录摘要1引言1凸轮设计要求2Excel 软件辅助设计2AutoCAD 凸轮轮廓线设计3VB编程作凸轮轮廓线并仿真4Mathematica 编程作凸轮轮廓线9Working Model凸轮仿真13各个软件比较15课题研究收获15参考文献16摘要凸轮是具有曲面轮廓的构件,一般多为原动件。当凸轮为原动件时,通常做等速的转动或移动,而从动件就按照预期的输出特性要求做连续或间隙的往复运动,移动或平面复杂运动。本文主要介绍用Excel计算凸轮轮廓线坐标数据,然后导入AutoCAD和Working model中

2、生成凸轮轮廓线。还介绍了用VB和Mathematica编程来设计凸轮轮廓线并对凸轮进行仿真。主要技术要求是熟悉凸轮设计基本原理及相关理论计算,能熟练使用Excel,AutoCAD和Working model等软件,熟悉VB和Mathematica编程语言,能将他们相结合起来应用到设计仿真中。关键词:凸轮,Excel,AutoCAD,Working model,VB和Mathematica,设计,仿真。引言盘形凸轮设计的主要任务是绘制凸轮的轮廓曲线, 传统设计方法分为图解法和解析法两种。其中图解法是根据从动件的位移曲线, 按“反转法”原理, 做出从动件在反转过程中所占据的一系列位置, 从而求得凸

3、轮轮廓曲线。图解法可用手工法和计算机辅助设计的方法进行。手工图解法设计凸轮的轮廓曲线误差较大, 故对于精度要求高的高速凸轮往往不能满足要求。计算机辅助作图的方法来作凸轮曲线需要足够多的轨迹上的点的坐标才能达到高的精度要求。但是求解大量点的坐标计算繁琐,所以我们就利用Excel强大的的表格数据处理功能来准确便捷的计算出足够多的点的坐标数据,然后将这些数据导入AutoCAD中生成凸轮轮廓线,我们还将数据导入Working Model中,这就可以对凸轮的运动做直观地观察。同时,我们还借助编程语言在计算机上编制程序来完成凸轮轮廓曲线的绘制和验证仿真,我们分别用VB和Mathematica进行编程并加以

4、比较。凸轮设计要求:凸轮基圆半径r0=40mm,行程h=20mm,偏距e=10mm,推程为简谐运动,推程角为0=120,远休止角s=30,回程运动为等加速等减速运动,回程角为0=120,近休止角s=90。Excel软件辅助设计用Excel计算出凸轮轮廓线上点的坐标(部分数据截图)AutoCAD凸轮轮廓线设计数据导入AutoCAD中生成凸轮轮廓线:由该图可直观的看出,AutoCAD是根据导入的点的坐标,用光滑的曲线将其一一连接得到凸轮轮廓曲线的。VB编程作凸轮轮廓线并仿真:1. VB程序模块Public s(200) As DoublePublic v(200) As DoublePublic

5、a(200) As DoublePublic s1(200), v1(200), a1(200)Public Const pi = 3.1415926Public 0, 1, 2, 3 运动角参数Public h, , rb, e, r, e1, r0 升程、角速度、基圆半径等Public Sub draw1()n = rb / 15: r = rb / n: e1 = e / n main.Picture1.Circle (35 * 50, 40 * 50), r * 50 画基圆 main.Picture1.Circle (35 * 50, 40 * 50), e1 * 50 画偏心圆En

6、d SubDim r0 As DoublePrivate Sub Command1_Click()0 = Val(Text3(0).Text) 初始值1 = Val(Text4.Text)2 = Val(Text3(1).Text)3 = 360 - 0 - 1 - 2h = Val(Text5.Text)r0 = Val(Text6.Text) 滚子半径rb = Val(Text2.Text) 基圆半径e = Val(Text1.Text) 偏心距Dim j As Integerj = 0计算推程的位移If op1dengsu(0).Value = True Then 等速运动 For i

7、= 0 To 0 Step 3 s(j) = h * i / 0 j = j + 1 Next iElse If op1dengjiajian(0).Value = True Then 等加速等减速 For i = 0 To 0 / 2 Step 3 s(j) = 2 * h * i 2 / 0 2 j = j + 1 Next i For i = 0 / 2 + 3 To 0 Step 3 s(j) = h - 2 * h(0 - i) 2 / 0 2 j = j + 1 Next iElse If op1yuxian(0).Value = True Then 余弦加速度 For i = 0

8、 To 0 Step 3 s(j) = h * (1 - Cos(pi * i / 0) / 2 j = j + 1 Next iElse If op1zhengxian(0).Value = True Then 正弦加速度 For i = 0 To 0 Step 3 s(j) = h * (1 - Sin(pi * i / 0) / 2 j = j + 1 Next iEnd If计算远停程位移For i = 3 To (0 + 1) Step 3s(j) = hj = j + 1Next i计算回程的位移If op2dengsu(1).Value = True Then 等速运动For i

9、 = 3 To (0 + 1 + 2) Step 3s(j) = h * (1 - i / 2)j = j + 1Next iElse If op2dengjiajian(1).Value = True Then 等加速等减速For i = 3 To (0 + 1 + 2 / 2) Step 3s(j) = h - 2 * h * i 2 / 2 2j = j + 1Next iFor i = (0 + 1 + 2 / 2) + 3 To (0 + 1 + 2) Step 3s(j) = 2 * h * (2 - i) 2 / 2 2j = j + 1Next iElse If op2yuxi

10、an(1).Value = True Then 余弦加速度For i = 3 To (0 + 1 + 2) Step 3s(j) = h * (1 + Cos(pi * i / 2) / 2j = j + 1Next iElse If op2zhengxian(1).Value = True Then 正弦加速度For i = 3 To (0 + 1 + 2) Step 3s(j) = h * (1 + Sin(pi * i / 2) / 2j = j + 1Next iEnd If近停程For i = (0 + 1 + 2) To (0 + 1 + 2 + 3) Step 5s(j) = r

11、0j = j + 1Next idraw1If Val(Text6.Text) = 0 ThenDraw with = 3Picture1.Line (35 * 50, (40 - r) * 50)-(35 * 50, 5 * 50)Turnoff timerTimer1.Interval = 250Timer1.Enabled = True 选择直动尖顶从动件动画Else If Val(Text6.Text) 0 ThenTurnoff timerx0 = 35 + e1: y0 = 40 - Sqr(r 2 - e1 2)For g = 2 To 70 画理论轮廓线m = g - 1X2

12、= 35 - (s(g) + Sqr(r 2 - e1 2) * Sin(5 * g * pi / 180) + e1 * Cos(5 * g * pi / 180)Y2 = 40 - (s(g) + Sqr(r 2 - e1 2) * Cos(5 * g * pi / 180) + e1 * Sin(5 * g * pi / 180)X1 = 35 - (s(m) + Sqr(r 2 - e1 2) * Sin(5 * m * pi / 180) + e1 * Cos(5 * m * pi / 180)Y1 = 40 - (s(m) + Sqr(r 2 - e1 2) * Cos(5 * m

13、 * pi / 180) + e1 * Sin(5 * m * pi / 180) Picture1.Line (x0 * 50, y0 * 50)-(X1 * 50, Y1 * 50) Picture1.Line (X1 * 50, Y1 * 50)-(X2 * 50, Y2 * 50)x0 = X2: y0 = Y2Next gTimer2.Interval = 250Timer2.Enabled = True 选择直动滚子从动件动画ElsePicture1.Current X = 20 * 50Picture1.Current Y = 62 * 50 Picture1.Print 重新选

14、择End IfEnd Sub Private Sub Timer1_Timer() 直动滚子从动件动画x0 = 35 + e1: y0 = 40 - Sqr(r 2 - e1 2)For g = 2 To 70m = g - 1X3 = e1 * Cos(5 * g * pi / 180)Y3 = -e1 * Sin(5 * g * pi / 180)X2 = 35 - (s(g) + Sqr(r 2 - e1 2) * Sin(5 * g * pi / 180) + e1 * Cos(5 * g * pi / 180)Y2 = 40 - (s(g) + Sqr(r 2 - e1 2) * C

15、os(5 * g * pi / 180) + e1 * Sin(5 * g * pi / 180)X1 = 35 - (s(m) + Sqr(r 2 - e1 2) * Sin(5 * m * pi / 180) + e1 * Cos(5 * m * pi / 180)Y1 = 40 - (s(m) + Sqr(r 2 - e1 2) * Cos(5 * m * pi / 180) + e1 * Sin(5 * m * pi / 180) Picture1.Line (62 + g * 0.6) * 50, 15 * 50)-(62 + g * 0.6) * 50, (15 - s(g) *

16、50) Picture1.Line (X3 + 35) * 50, (Y3 + 40) * 50)-(X2 * 50, Y2 * 50) Picture1.Line (x0 * 50, y0 * 50)-(X1 * 50, Y1 * 50) Picture1.Line (X1 * 50, Y1 * 50)-(X2 * 50, Y2 * 50)x0 = X2: y0 = Y2Next gIf g 70 ThenTurnoff timerEnd IfEnd Sub Private Sub Timer2_Timer() 直动滚子从动件动画X2 = 35 - (s(g) + Sqr(r 2 - e1

17、2) * Sin(5 * g * pi / 180) + e1 * Cos(5 * g * pi / 180)Y2 = 40 - (s(g) + Sqr(r 2 - e1 2) * Cos(5 * g * pi / 180) + e1 * Sin(5 * g * pi / 180) Picture1.Circle (X2 * 50, Y2 * 50), (r0 / rb * 15) * 50g = g + 1If g 71 ThenTurnoff timerEnd IfEnd SubPrivate Sub turnoff timer()Timer1.Enabled = FalseTimer2.

18、Enabled = FalseEnd Sub参数输入:形成轮廓线,验证仿真:用Mathematica编程作凸轮轮廓线locuspoint1=s,Sins2;ParametricPlotEvaluatelocuspoint1,s,-2,2 locuspoint2=IfNp/2s (3 N)/2,1,1+CossCoss,Sins;ParametricPlotEvaluatelocuspoint2,s,0,2 p NeedsMechanicalSystemsModeler2D CamPlotPoint2,locuspoint2,s,0,2,FrameTrue,AspectRatioAutomati

19、c Show%/.X21,Y2-2,Q20.5 OffGeneral:spell1alpha;beta;OnGeneral:spell1camprof=3 Cosalpha,3 Sinalpha+Sin2 alpha; ParametricPlotEvaluatecamprof,alpha,0,2,AspectRatioAutomaticground=1;cam=2;follower=3; SetBodiesBodyfollower,InitialGuess-3.5,4.0,0.0SetConstraintsRevolute21,Pointcam,0,Pointground,0,Revolut

20、e22,Pointfollower,0,Pointground,-3.5,4,RotationLock13,cam,2 Np T,CamToLine14,Pointcam,camprof,alpha,1.5,Linefollower,0.5,-1,6.5,-1 SolveMech.15 SolveMech.30 locuspoint=IfN/2s(3 N)/2,1,1+CossCoss,t,Sins; ParametricPlot3DEvaluatelocuspoint,s,0,2,t,0,2,PlotPoints35,2 NeedsMechanicalSystemsModeler3DTrue

21、 Show%/.X21,Y2-2,Z20.5,Eo2.7,Ei2.7,Ej20,Ek20 camsurf=IfN/2alpha(3 N)/2,1,1+Cosalpha Cosalpha,beta,Sinalpha;ground=1;cam=2;follower=3; SetBodiesBodyfollower,InitialGuess-2,0,2,1,0,0,0 SetConstraintsRevolute51,Linecam,0,0,2,0,Lineground,0,0,2,0,Revolute52,Linefollower,0,0,2,0,Lineground,-2,0,2,-2,2,2,

22、ProjectedAngle13,Vectorcam,0,0,1,Vectorground,0,0,1,Vectorground,0,-1,0,2N T,CamToSphere14,Pointcam,camsurf,alpha,1.5,beta,1,Pointfollower,2,1,0,0.5 SolveMech0.1 SolveMech.20 NeedsMechanicalSystemsModeler2D knotpoints=0,1.5,.75,.75,1,0,.707,-.707,0,-1,-.707,-.707,-1,0,-.75,.75,0,1.5; splinelocus=Spl

23、ineFitknotpoints,EndConditionsClosed ParametricPlotsplinelocuss,s,0,8,AspectRatioAutomatic CamToCircle14,Point2,splinelocuss,s,2.0,Point3,0,0,.2 data=PolarToXY/Table4-i,i Np,i,1,3,.2; splinelocus=SplineFitdata,EndConditions.106,-.994,.152,-.476 ParametricPlotsplinelocuss,s,0,10,AspectRatioAutomatic

24、splinearc=ArcLengthsplinelocus ground=1;cam=2;SetConstraintsCamToLine11,Pointcam,splinelocuss,s,2,Lineground,0,0,1,0,RotationLock12,cam,2NpT,Constraint3,splinearcs=Locationcam,splinelocussP1RightDoubleBracketSetGuessX24,Y22.5;SolveMech0,-0.2,-0.4 ansplinelocus=PolarToXY4-s,s Np ansplinearc=Integrals

25、 PlotEvaluateansplinearc-(ansplinear/.s1),splinearc5 (s-1),s,1,3 data=Join3.08599,0.61384,3.23358,1.33939,3.20411,2.14091,2.82843,2.82843,2.14092,3.20411,1.33939,3.23358,0.61384,3.08599,Table3 Cosi,Sini,i,Np/2,2 Np,3 Np/(2 24);len=Lengthdata;fourierdata=Fourier/Transposedata 2/N;fourierdataP1,1Right

26、DoubleBracket/=2;fourierdataP2,1RightDoubleBracket/=2; terms=10;fourierlocus=(TakeRe#1,terms.TableCosi s,i,0,terms-1+TakeIm#1,terms.TableSini s,i,0,terms-1&)/fourierdata; ShowGraphicsPointSize.018,Point/data,ParametricPlotEvaluatefourierlocus,s,0,2 p,DisplayFunctionIdentity,AspectRatioAutomatic locuspoint1=Involuteg1,0,0,4.0,5.0,0;locuspoint2=Involuteg2,0,0,5.6,7.0,Np ground=1;gear1=2;gear2=3;SetConstraintsRevolute21,Pointground,0,0,Pointgear1,0,0,RotationLock12,gear1,2 Np T,Revolute23,Pointground,12,0,Pointgear2,0,0,CamToCam14,Pointgear1,locuspoint1,g1

温馨提示

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

评论

0/150

提交评论