收藏 分享(赏)

牛头刨床运动仿真matlab程序.doc

上传人:HR专家 文档编号:7233938 上传时间:2019-05-10 格式:DOC 页数:9 大小:40KB
下载 相关 举报
牛头刨床运动仿真matlab程序.doc_第1页
第1页 / 共9页
牛头刨床运动仿真matlab程序.doc_第2页
第2页 / 共9页
牛头刨床运动仿真matlab程序.doc_第3页
第3页 / 共9页
牛头刨床运动仿真matlab程序.doc_第4页
第4页 / 共9页
牛头刨床运动仿真matlab程序.doc_第5页
第5页 / 共9页
点击查看更多>>
资源描述

1、附录牛头刨床主运动机构 MATLAB 程序由主程序 six_bar_main 和子函数 six_bar两部分组成。1.主程序 six_bar_main 文件%1.输入已知数据clear;l1=0.125;l3=0.600;l4=0.150;l6=0.275;l61=0.575;omega1=1;alpha1=0;hd=pi/180;du=180/pi;%2.调用子函数 six_bar 计算牛头刨床机构位移,角速度,角加速度for n1=1:459;theta1(n1)=-2*pi+5.8199+(n1-1)*hd;ll=l1,l3,l4,l6,l61;theta,omega,alpha=six

2、_bar(theta1(n1),omega1,alpha1,ll); s3(n1)=theta(1);theta3(n1)=theta(2);theta4(n1)=theta(3);sE(n1)=theta(4);v2(n1)=omega(1);omega3(n1)=omega(2);omega4(n1)=omega(3);vE(n1)=omega(4);a2(n1)=alpha(1);alpha3(n1)=alpha(2);alpha4(n1)=alpha(3);aE(n1)=alpha(4);end%3.位移、角速度、角加速度、和牛头刨床图形输出figure(3);n1=1:459;t=(

3、n1-1)*2*pi/360;subplot(2,2,1); %绘角位移及位移线图plot(t,theta3*du,r-.);grid on;hold on;axis auto;haxes,hline1,hline2=plotyy(t,theta4*du,t,sE);grid on;hold on;xlabel(时间/s)axes(haxes(1);ylabel(角位移/circ)axes(haxes(2);ylabel(位移/m)hold on;grid on;text(1.15,-0.15,theta_3)text(3.40,0.27,theta_4)text(2.25,-0.15,s_E

4、)subplot(2,2,2); %绘角速度及速度线图plot(t,omega3,r-.);grid on;hold on;axis auto;haxes,hline1,hline2=plotyy(t,omega4,t,vE);grid on;hold on;xlabel(时间/s)axes(haxes(1);ylabel(角速度/radcdots-1)axes(haxes(2);ylabel(速度/mcdots-1)hold on;grid on;text(3.1,0.35,omega_3)text(2.1,0.1,omega_4)text(5.5,0.45,v_E)subplot(2,2,

5、3); %绘角加速度及加速度线图plot(t,alpha3,r-.);grid on;hold on;axis auto;haxes,hline1,hline2=plotyy(t,alpha4,t,aE);grid on;hold on;xlabel(时间/s)axes(haxes(1);ylabel(角加速度/radcdots-2)axes(haxes(2);ylabel(加速度/mcdots-2)hold on;grid on;text(1.5,0.3,alpha_3)text(3.5,0.51,alpha_4)text(1.5,-0.11,a_E)subplot(2,2,4); %牛头刨

6、床机构n1=20;x(1)=0;y(1)=0;x(2)=(s3(n1)*1000-50)*cos(theta3(n1);y(2)=(s3(n1)*1000-50)*sin(theta3(n1);x(3)=0;y(3)=16*1000;x(4)=l1*1000*cos(theta1(n1);y(4)=s3(n1)*1000*sin(theta3(n1);x(5)=(s3(n1)*1000+50)*cos(theta3(n1);y(5)=(s3(n1)*1000+50)*sin(theta3(n1);x(6)=13*1000*cos(theta3(n1);y(6)=13*1000*sin(thet

7、a3(n1);x(7)=13*1000*cos(theta3(n1)+14*1000*cos(theta4(n1);y(7)=13*1000*sin(theta3(n1)+14*1000*sin(theta4(n1);x(8)=13*1000*cos(theta3(n1)+14*1000*cos(theta4(n1)-900;y(8)=161*1000;x(9)=13*1000*cos(theta3(n1)+14*1000*cos(theta4(n1)+600;y(9)=161*1000;x(10)=(s3(n1)*1000-50)*cos(theta3(n1);y(10)=(s3(n1)*1

8、000-50)*sin(theta3(n1);x(11)=x(10)+25*cos(pi/2-theta3(n1);y(11)=y(10)-25*sin(pi/2-theta3(n1);x(12)=x(11)+100*cos(theta3(n1);y(12)=y(11)+100*sin(theta3(n1);x(13)=x(12)-50*cos(pi/2-theta3(n1);y(13)=y(12)+50*sin(pi/2-theta3(n1);x(14)=x(10)-25*cos(pi/2-theta3(n1);y(14)=y(10)+25*sin(pi/2-theta3(n1);x(15)

9、=x(10);y(15)=y(10);x(16)=0;y(16)=0;x(17)=0;y(17)=16*1000;k=1:2;plot(x(k),y(k);hold on;k=3:4;plot(x(k),y(k);hold on;k=5:9;plot(x(k),y(k);hold on;k=10:15;plot(x(k),y(k);hold on;k=16:17;plot(x(k),y(k);hold on;grid on;axis(-500 600 0 650);title(牛头刨床运动仿真);grid on;xlabel(mm)ylabel(mm)plot(x(1),y(1),o);plo

10、t(x(3),y(3),o);plot(x(4),y(4),o);plot(x(6),y(6),o);plot(x(7),y(7),o);hold on;grid on;xlabel(mm)ylabel(mm)axis(-400 600 0 650);%4 牛头刨床机构运动仿真figure(2)m=moviein(20);j=0;for n1=1:5:360j=j+1;clf;x(1)=0;y(1)=0;x(2)=(s3(n1)*1000-50)*cos(theta3(n1); y(2)=(s3(n1)*1000-50)*sin(theta3(n1);x(3)=0;y(3)=l6*1000 x

11、(4)=l1*1000*cos(theta1(n1);y(4)=s3(n1)*1000*sin(theta3(n1);x(5)=(s3(n1)*1000+50)*cos(theta3(n1);y(5)=(s3(n1)*1000+50)*sin(theta3(n1);x(6)=l3*1000*cos(theta3(n1);y(6)=l3*1000*sin(theta3(n1);x(7)=l3*1000*cos(theta3(n1)+l4*1000*cos(theta4(n1);x(7)=l3*1000*cos(theta3(n1)+l4*1000*cos(theta4(n1);y(7)=l3*1

12、000*sin(theta3(n1)+l4*1000*sin(theta4(n1);x(8)=l3*1000*cos(theta3(n1)+l4*1000*cos(theta4(n1)-900;y(8)=l61*1000;x(9)=l3*1000*cos(theta3(n1)+l4*1000*cos(theta4(n1)+600;y(9)=l61*1000;x(10)=(s3(n1)*1000-50)*cos(theta3(n1);y(10)=(s3(n1)*1000-50)*sin(theta3(n1);x(11)=x(10)+25*cos(pi/2-theta3(n1);y(11)=y(1

13、0)-25*sin(pi/2-theta3(n1);x(12)=x(11)+100*cos(theta3(n1);y(12)=y(11)+100*sin(theta3(n1);x(13)=x(12)-50*cos(pi/2-theta3(n1);y(13)=y(12)+50*sin(pi/2-theta3(n1);x(14)=x(10)-25*cos(pi/2-theta3(n1);y(14)=y(10)+25*sin(pi/2-theta3(n1);x(15)=x(10);y(15)=y(10);x(16)=0;y(16)=0;x(17)=0;y(17)=l6*1000;k=1:2;plot

14、(x(k),y(k);hold on;k=3:4plot(x(k),y(k);hold on;k=5:9;plot(x(k),y(k);hold on;k=10:15;plot(x(k),y(k);hold on;k=16:17;plot(x(k),y(k);hold on;grid on;axis(-500 600 0 650);title(牛头刨床运动仿真);grid on;xlabel(mm);ylabel(mm);plot(x(1),y(1),o);plot(x(3),y(3),o);plot(x(4),y(4),o);plot(x(6),y(6),o);plot(x(7),y(7),

15、o);axis equal;m(j)=getframe;endmovie(m)2.子函数 six_bar 文件functiontheta,omega,alpha=six_bar(theta1,omega1,alpha1,ll)l1=ll(1);l3=ll(2);l4=ll(3);l6=ll(4);l61=ll(5);%1 计算角位移和线位移s3=sqrt(l1*cos(theta1)*(l1*cos(theta1)+(l6+l1*sin(theta1)*(l6+l1*sin(theta1);theta3=acos(l1*cos(theta1)/s3);theta4=pi-asin(l61-l3

16、*sin(theta3)/l4);sE=l3*cos(theta3)+l4*cos(theta4);theta(1)=s3;theta(2)=theta3;theta(3)=theta4;theta(4)=sE;%2 计算角速度和线速度A=sin(theta3),s3*cos(theta3),0,0; %从动件位置参数矩阵-cos(theta3),s3*sin(theta3),0,0;0,l3*sin(theta3),l4*(theta4),1;0,l3*cos(theta3),l4*cos(theta4),0;B=l1*cos(theta1);l1*sin(theta1);0;0% 原动件位

17、置参数矩阵omega=A(omega1*B);v2=omega(1); %滑块 2 的速度omega3=omega(2); %构件 3 的角速度omega4=omega(3); %构件 4 的角速度vE=omega(4) %构件 5 的速度%3 计算角加速度和加速度A=sin(theta3),s3*cos(theta3),0,0; %从动件位置参数矩阵cos(theta3),-s3*sin(theta3),0,0;0,l3*sin(theta3),l4*(theta4),1;0,l3*cos(theta3),l4*cos(theta4),0;At=omega3*cos(theta3),(v2*

18、cos(theta3)-s3*omega3*sin(theta3),0,0;-omega3*sin(theta3),(-v2*sin(theta3)-s3*omega3*cos(theta3),0,0;0,l3*omega3*cos(theta3),l4*omega4*cos(theta4),0;0,-l3*omega3*sin(theta3),-l4*omega4*sin(theta4),0; Bt=-l1*omega1*sin(theta1);-l1*omega1*cos(theta1);0;0;alpha=A(-At*omega+omega1*Bt); %机构从动件的加速度矩阵a2=alpha(1); %a2 表示滑块 2 的加速度alpha3=alpha(2); %alpha3 表示杆件 3 的角加速度alpha4=alpha(3); %alpha4 表示杆件 4 的角加速度aE=alpha(4); %构件 5 的加速度

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 企业管理 > 管理学资料

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报