您好,欢迎访问三七文档
偏置直动滚子推杆盘形凸轮机构设计推程运动规律:余弦加速度运动回程运动规律:正弦加速度运动凸轮机构的推杆在近休,推程,远休及回程段的凸轮转角近休凸轮转角推程凸轮转角远休凸轮转角回程凸轮转角0°~45°45°~210°210°~260°260°~360°偏置直动滚子推杆盘形凸轮机构已知参数初选基圆半径ro/mm偏距e/mm滚子半径rr/mm推杆行程h/mm许用压力角许用最小曲率半径[Pmina][a1][a2]20+10143030°70°0.3rr推杆运动规律1)推程运动规律:余弦加速度运动推程运动方程式:s=h[1-cos(πδ/δ0)]/2,v=πhωsin(πδ/δ0)/(2δ0),a=π2hω2cos(πδ/δ0)/(2δ02)2)回程运动规律:正弦加速度运动回程运动方程式:s=h[1-(δ/δ0’)+sin(2πδ/δ0’)/(2π)v=hω[cos(2πδ/δ0’-1)]/δ0’a=-2πhω2sin(2πδ/δ0’)/(δ0’2)滚子中心坐标:x=(s+s0)sinδ+ecosδy=(s+s0)cosδ-ecosδ其中实际轮廓曲线坐标:其中计算压力角:计算曲率半径:计算程序符号的表示含义:r0初选基圆半径x理论轮廓曲线的x坐标y理论轮廓曲线的y坐标X实际轮廓曲线的x坐标Y实际轮廓曲线的x坐标p曲率半径s推杆位移rr滚子半径a压力角paamin许用最小曲率半径pamin实际曲率半径的最小值a1max回程前压力角的最大值a2max回程后压力角的最大值e偏距h推杆行程a1推程许用压力角a2回程程许用压力角dar0每次修正r0所加的长度N计算点数k1近休角k2推程角k3远休角k4回程角kamin实际曲率半径最小值所对应的角度k1max回程前压力角的最大值所对应的角度k2max回程后压力角的最大值所对应的角度子程序1计算最大压力角:function[amax,kmax]=yalijiao1(a,N1,b)amax=0;kmax=0;amax=max(a);fori=1:N1ifa(i)==amaxkmax=i*b;endendend子程序2计算最小曲率半径:function[pamin,kamin]=qulv(p,b,N)pamin=0;kamin=0;fori=1:N-1p(i)=abs(p(i));endpamin=min(p);fori=1:N-1pamin=min(p)ifp(i)==paminkamin=i*b;endendend子程序3计算回程前的压力角及修正r0:function[A,r0]=haha(r0,rr,e,h,a1,dar0,N,k1,k2,k3,k4)N1=(k1+k2)/360*N;eta=pi/180;%化为弧度while(1)s0=(r0^2-e^2)^(1/2);symsksdkdsd2kd2sn1=k1/360*N;k11=linspace(0,k1,n1);s1=k11./k11.*0;x1=e.*cos(k11.*pi/180)+(s0+s1).*sin(k11.*pi/180);y1=(s0+s1).*cos(k11.*pi/180)-e.*sin(k11.*pi/180);n2=k2/360*N;k22=linspace(k1,k1+k2,n2);s2=(h/2).*(1-cos(pi.*(k22-k1)/k2));x2=e.*cos(k22.*pi/180)+(s0+s2).*sin(k22.*pi/180);y2=(s0+s2).*cos(k22.*pi/180)-e.*sin(k22.*pi/180);x=[x1,x2];y=[y1,y2];k=[k11,k22];s=[s1,s2];dx=diff(x)./diff(k);dk=k(1:end-1);dy=diff(y)./diff(k);dk=k(1:end-1);ds=diff(s)./diff(k);dk=k(1:end-1);ds(N1)=0;fori=1:N1f(i)=(ds(i)-e)/(sqrt(r0^2-e^2)+s(i));a(i)=atan(f(i));%计算a压力角A(i)=abs(a(i))/eta;ifA(i)a1r0=r0+dar0;break;endendifi==N1break;endendend子程序4计算回程后的压力角及修正r0:function[A,r0]=hahaha(r0,rr,e,h,a2,dar0,N,k1,k2,k3,k4)N2=(k3+k4)/360*N;b=360/N;eta=pi/180;%化为弧度while(1)s0=(r0^2-e^2)^(1/2);symsksdkdsd2kd2sn3=k3/360*N;k33=linspace(k1+k2,k1+k2+k3,n3);s3=k33./k33.*h;x3=e*cos(k33*pi/180)+(s0+h).*sin(k33*pi/180);y3=(s0+h).*cos(k33*pi/180)-e*sin(k33*pi/180);n4=k4/360*N;k44=linspace(k1+k2+k3,k1+k2+k3+k4,n4+1);s4=h.*(1-(k44-k1-k2-k3)./k4+sin(2*pi.*(k44-k1-k2-k3)./k4)/(2*pi));x4=e.*cos(k44*pi/180)+(s0+s4).*sin(k44*pi/180);y4=(s0+s4).*cos(k44*pi/180)-e*sin(k44*pi/180);x=[x3,x4];y=[y3,y4];k=[k33,k44];s=[s3,s4];dx=diff(x)./diff(k);dk=k(1:end-1);dy=diff(y)./diff(k);dk=k(1:end-1);ds=diff(s)./diff(k);dk=k(1:end-1);ds(N2)=0;fori=1:N2f(i)=(ds(i)-e)/(sqrt(r0^2-e^2)+s(i));a(i)=atan(f(i));%计算a压力角A(i)=abs(a(i))/eta;ifA(i)a2r0=r0+dar0;break;endendifi==N2break;endendend子程序5计算曲率半径,并修正r0,计算理论轮廓曲线坐标和实际轮廓曲线的坐标及曲率半径,拖杆位移:function[x,y,X,Y,p,s,r0]=qulvvv(r0,rr,e,h,paamin,dar0,N,k1,k2,k3,k4)eta=pi/180;%化为弧度i=1;while(1)s0=(r0^2-e^2)^(1/2);symsksdkdsd2kd2sn1=k1/360*N;k11=linspace(0,k1,n1);s1=k11./k11.*0;x1=e.*cos(k11.*pi/180)+(s0+s1).*sin(k11.*pi/180);y1=(s0+s1).*cos(k11.*pi/180)-e.*sin(k11.*pi/180);n2=k2/360*N;k22=linspace(k1,k1+k2,n2);s2=(h/2).*(1-cos(pi.*(k22-k1)/k2));x2=e.*cos(k22.*pi/180)+(s0+s2).*sin(k22.*pi/180);y2=(s0+s2).*cos(k22.*pi/180)-e.*sin(k22.*pi/180);n3=k3/360*N;k33=linspace(k1+k2,k1+k2+k3,n3);s3=k33./k33.*h;x3=e*cos(k33*pi/180)+(s0+h).*sin(k33*pi/180);y3=(s0+h).*cos(k33*pi/180)-e*sin(k33*pi/180);n4=k4/360*N;k44=linspace(k1+k2+k3,k1+k2+k3+k4,n4);s4=h.*(1-(k44-k1-k2-k3)./k4+sin(2*pi.*(k44-k1-k2-k3)./k4)/(2*pi));x4=e.*cos(k44*pi/180)+(s0+s4).*sin(k44*pi/180);y4=(s0+s4).*cos(k44*pi/180)-e*sin(k44*pi/180);x=[x1,x2,x3,x4];y=[y1,y2,y3,y4];k=[k11,k22,k33,k44];s=[s1,s2,s3,s4];dx=diff(x)./diff(k);dk=k(1:end-1);dy=diff(y)./diff(k);dk=k(1:end-1);ds=diff(s)./diff(k);dk=k(1:end-1);d2x=diff(dx)./diff(dk);d2y=diff(dy)./diff(dk);d2y(N)=0;dy(N)=0;dx(N)=0;d2x(N)=0;while(1)p(i)=(dx(i)^2+dy(i)^2)^(3/2)/(dx(i)*d2y(i)-dy(i)*d2x(i));%计算曲率半径pp(i)=abs(p(i))ifpp(i)-rrpaaminr0=r0+dar0;i=1;break;elseforii=1:Nsino(ii)=dx(ii)/(dx(ii)^2+dy(ii)^2)^0.5;coso(ii)=(-1)*dy(ii)/(dx(ii)^2+dy(ii)^2)^0.5;X(ii)=x(ii)-rr*coso(ii);%定义实际轮廓线的X座标Y(ii)=y(ii)-rr*sino(ii);%定义实际轮廓线的Y座endendi=i+1;ifi==Nbreak;endendifi==Nbreak;endendend主程序function[r0,x,y,X,Y,p,s,a,pamin,kamin,a1max,k1max,a2max,k2max]=zuizhong(r0,rr,e,h,a1,a2,paamin,dar0,N,k1,k2,k3,k4)N1=(k1+k2)/360*N;N2=(k3+k4)/360*N;b=360/N;eta=pi/180;%化为弧度a11=0;a22=0;s=0;pamin=0;kamin=0;a1max=0;k1max=0;a2max=0;k2max=0;while(1)while(1)[a11,r0]=haha(r0,rr,e,h,a1,dar0,N,k1,k2,k3,k4);%计算符合推程许可压力角的修正的r0r1=r0;[a22,r0]=hahaha(r0,rr,e,h,a2,dar0,N,k1,k2,k3,k4);%计算符合回程许可压力角的修正的r0r2=r0;ifr0~=r1break;else[x,y,X,Y,p,s,r0]=qulvvv(r0,rr,e,h,paamin,dar0,N,k1,k2,k3,k4);%计算满足最小许可曲率半径条件的修正的r0,计算实际轮廓曲线坐标和理论轮廓曲线坐标,及曲率半径r3=r0;ifr0~=r2break;endendifr0==r3break;endendifr0==r3break;endend[paminkamin]=qulv(p,b,N);[a1maxk1max]=yalijiao1(a11,N1,b);[a2maxk2max]=yalijiao1(a22,N2,b);a=[a11a22];figure(1);plot(x,y);holdon;t=linspace(0,2*pi,N);x=r0*cos(t);y=r0*sin(t);plot(0,0,'*',x,y,X,Y);title('凸轮的理论轮廓曲线');axis([-70,70,-70,70]);axissquare;end只需输入[r0,x,y,X,Y,p,s,a,pamin,kamin,a1max,k1max,a2max,k2max]=zuizhong(20,14,10,30,40,70,4.2,1,72
本文标题:MATLAB大作业
链接地址:https://www.777doc.com/doc-4703705 .html