凸轮廓线设计MATLAB程序

凸轮轮廓及其综合1. 凸轮机构从动件的位移凸轮是把一种运动转化为另一种运动的装置凸轮的廓线和从动件一起实现运动形式的转换凸轮通常是为定轴转动,凸轮旋转运动可被转化成摆动、直线运动或是两者的结合凸轮机构设计的内容之一是凸轮廓线的设计定义一个凸轮基圆rb作为最小的圆周半径从动件的运动方程如下:L()=rb+s()设凸轮的推程运动角和回程运动角均为β,从动件的运动规律均为正弦加速度运动规律,则有:s()=h(-sin(2π/β)) 0≤≤βs()=h-h(-sin(2π(-β/β)) β≤≤2βs()=0 2β≤≤2π上式是从动件的位移,h是从动件的最大位移,并且0≤β≤π如果假设凸轮的旋转速度ω=d/dt是个常量,则速度υ、加速度a和瞬时加速度j(加速度对时间求异)分别如下:速度:υ()=(1-cos(2π/β)) 0≤≤βυ()=-(1-cos(2π(-β)/β) β≤≤2βυ()=0 2β≤≤2π加速度:a()=sin(2π/β)) 0≤≤βa()=-sin(2π(-β)/β) β≤≤2βa()=0 2β≤≤2π瞬时加速度:j()=cos(2π/β)) 0≤≤βj()=-cos(2π(-β)/β) β≤≤2βj()=0 2β≤≤2π定义无量纲位移S=s/h、无量纲速度V=υ/ωh、无量纲加速度A=a/hω3和无量纲瞬时加速度J=j/hω3。
若β=60°,则如下程序可以对以上各个量进行计算beta=60*pi/180;phi=linspace(0,beta,40);phi2=[beta+phi];ph=[phi phi2]*180/pi;arg=2*pi*phi/beta;arg2=2*pi*(phi2-beta)/beta;s=[phi/beta-sin(arg)/2/pi 1-(arg2-sin(arg2))/2/pi];v=[(1-cos(arg))/beta-(1-cos(arg2))/beta];a=[2*pi/beta^2*sin(arg)2*pi/beta^2*sin(arg2)];j=[4*pi^2/beta^3*cos(arg)4*pi^2/beta^3*cos(arg2)]:subplot(2,2,1)plot(ph,s,ˊKˊ)xlabel(ˊCam angle(degrees)ˊ)ylabel(ˊDisplacement(S)ˊ)g=axis; g(2)=120; axis(g)subplot(2,2,2)plot(ph,v,ˊkˊ,[0 120],[0 0],ˊk--ˊ)xlabel(ˊCam angle(degrees)ˊ)ylabel(ˊVelocity(V)ˊ)g=axis; g(2)=120; axis(g)subplot(2,2,3)plot(ph,a,ˊkˊ,[0 120],[0 0],ˊk--ˊ)xlabel(ˊCam angle(degrees)ˊ)ylabel(ˊAcceleration(A)ˊ)g=axis;g(2)=120;axis(g)subplot(2,2,4)plot(ph,j,ˊkˊ,[0 120],[0 0],ˊk--ˊ)xlabel(ˊCam angle(degrees)ˊ)ylabel(ˊJerk(J)ˊ)g=axis;g(2)=120;axis(g)2 平底盘形从动作参考下图得到如下关系:在(x,y)坐标系中,凸轮轮廓的坐标为Rx和Ry,刀具的坐标为Cx和Cy:Rx=Rcos( θ+) Ry=Rsin( θ+)Cx=Ccos( γ+) Cy=Ccos( γ+)其中,R= θ=arctanc= =arctanrc是刀具的半径,且dL/d=V()/ω。
为了画出凸轮的轮廓曲线,创建函数CarmProfile,用来计算L()和dL/d,创建函数ContourFlat,用来计算Rx,Ry,Cx,Cyfunction[L,dLdphi]= CarmProfile(phi,rb,h,beta)arg=2*pi*phi/beta;L=rb+h*(phi/beta-sin(arg)/2/pi);dLdphi=(h/beta)*(1-cos(arg));L=[L fliplr(L)];dLdphi= [dLdphi- dLdphi];函数ContourFlat是function[Rx,Ry,Cx,Cy]=ContourFlat(phi,rb,h,beta,rc)[L,dLdphi]=Camprofile(phi,rb,h,beta);theta=atan2(dLdphi,L);R=L./cos(theta);ph=[phi beta+phi];Ry=R.*sin(theta+ph);Rx=R.*cos(theta+ph);gama=atan(dLdphi./(L+rc));C=(L+rc)/cos(gama);Cy=C.*sin(gama+ph);Cx=C.*cos(gama+ph);若令β=60°,rb=3.0和h=0.5,则程序清单是:beta=60*pi/180;rb=3;h=0.5;rc=0.5;n=23;phi=linspace(0,beta,n);ph=[phi beta+phi];[Rx,Ry,Cx,Cy]=ContourFlat(phi,rb,h,beta,rc);ang=linspace(2*beta,2*pi,40);plot(Rx,Ry,ˊkˊ,rb*cos(ang),rb*sin(ang),ˊkˊ,0,0,ˊk+ˊ,Cx(1:5:2*n),Cy(1:5:2*n),ˊk+ˊ)axis equalphd=linspace(0,2*pi,50);[x,phx]=meshgrid(Cx(1:5:2*n),phd);y=meshgrid(Cy(1:5:2*n),phd);hold onplot(x+rc.*cos(phx),y+rc.*sin(phx),ˊk--ˊ)title(ˊCam contour for cycloidal motion of flat-face followerˊ)3.偏置滚子从动件由图可得到如下关系。
凸轮轮廓在(x,y)的坐标是Rx和Ry,刀具的坐标是Cx和Cy;Rx=Rcos( ψ++γ) Ry=Rcos( ψ++γ)Cx=Ccos( ψ++δ) Cy=Ccos( ψ++δ )其中,R2=(F-rfcosα)2+rf2cos2α ψ=arctan(m/L)C2=cx2+cy2 α=arctancx=F+(rc-rf)cosα γ= arctancy=(rc-rf)sinα δ=arctan(cy/cx)F2=m2+L2凸轮的基圆半径是:L(0)=rb=从=2β+Δ开始,其中,Δ=arctan为了显示这些结果,首先创建函数ContourRoller来计算Rx,Ry,Cx,Cy: function[Rx,Ry,Cx,Cy]=ContourRoller(phi,rb,h,beta,rc,m,rf)[L,dLdphi]=CamProfile(phi,rb,h,beta);F2=m^2+L.^2;F=sqrt(f2);psi=atan2(m,L);alpha=atan2(L.*dLdphi,F2-m*dLdphi);gamma=atan2(rf*sin(alpha),F-rf*cos(alpha));ph=[phi beta+phi];R=sqrt((F-rf*cos(alpha)).^2+(rf*sin(alpha)).^2);Ry=R.*sin(psi+gamma+ph);Rx=R.*cos(psi+gamma+ph);cx=F+(rc-rf)*cos(alpha);cy=(rc-rf)*sin(alpha);delta=atan2(cy,cx);c=sqrt(cx.^2+cy.^2);Cy=C.*sin(psi+delta+ph);Cx=C.*cos(psi+delta+ph);若令β=60°,rb=3.0,h=0.5,rc=0.5,rf=0.375,m=0.375,则程序清单是:beta=60*pi/180;rb=3;h=0.5;rc=0.5;rf=0.375;m=.375;n=23;phi=linspace(0,beta,n);ph=[phi beta+phi];[Rx,Ry,Rx,Ry]=ContourRoller(o,rb,h,beta,rc,m,rf);rb=sqrt(Rx(1)^2+Ry(1)^2);delta=atan2(Ry(1),Rx(1));[Rx,Ry,Cx,Cy]=ContourRoller(phi,rb,h,beta,rc,m,rf);ang=linspace(2*beta+delta,2*pi+delta,40);plot(Rx,Ry,ˊkˊ,Rx(1)*cos(ang)),Rx(1)*sin(ang),ˊkˊ,0,0,ˊk+,Cx(1:5:2*n), …Cy(1:5:2*n),ˊk+ˊ)axis equalphd=linspace(0,2*pi,50);[x,phx]=meshgrid(Cx(1:5:2*n),phd);y=meshgrid(Cy(1:5:2*n),phd);hold onplot(x+rc.*cos(phx),y+rc.*sin(phx),ˊk--ˊ)title(ˊCam contour for cycloidal motion of an offset roller followerˊ)4.凸轮的曲率半径凸轮轮廓的曲率半径如下给出:ρ=凸轮轮廓应该是这样的:从动件的曲率半径总是大于凸轮轮廓的最小曲率半径,有意义的是最小曲率半径。
使用第1节中对无量纲位移、速度、加速度和瞬时加速度的定义,曲率半径可表示如下:ρ/h=为了确定最小的曲率半径(无量纲的),利用曲率半径与β的对称关系创建函数CamCurvature在0≤≤β区间是有效的function RadiusCurve=CamCurvature(phi,beta,rbh)arg=2*pi*phi/beta;S=phi/beta-sin(arg)/2/pi;V=(1-cos(arg)) /beta;A=2*pi/beta^2*sin(arg);RadiusCurve=((rbh+S)^2+V^2)^1.5/((rbh+S)^2+2*V^2-(rbh+S)*A);那么对于rb/h和β的任意值,程序清单是:rbh=input(ˊEnter ratio rb/h:ˊ);beta=input(ˊEnter angle beta(degrees):ˊ)*pi/180);options=optimset(ˊdisplayˊ,ˊoffˊ);phimin=fminbnd(ˊCamCurvatureˊ,0,beta,options,beta,rbh);rmin=CamCurvature(phimin,beta,rbh);disp([ˊWhen beta=ˊnum2str(beta*180/pi)ˊdegrees and rb/h=ˊ…num2str(rbh)ˊthe mininmun radius of curvature for aˊ])disp([ˊcycloidal cam profile is=ˊnum2str(rmin)ˊh,which occurs atˊ…num2str(phimin*180/pi)ˊdegrees.ˊ])程序执行后,在MATLAB命令窗口中显示如下信息:Enter ratio rb/h:4Enter angle beta(degrees):80When beta=80 degrees and rb/h=4 the minimum radius of curvature for acycloidal cam profile is=2.9777h,which occurs at 58.8421degrees.参考文献:[美]Edward B. Magrab 等著,高会生,李新叶,胡智奇 等译. MATLAB原理与工程应用. 北京:电子工业出版社,2002年。