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

上传人:b****4 文档编号:3127561 上传时间:2022-11-17 格式:DOCX 页数:10 大小:15.74KB
下载 相关 举报
牛头刨床运动仿真matlab程序.docx_第1页
第1页 / 共10页
牛头刨床运动仿真matlab程序.docx_第2页
第2页 / 共10页
牛头刨床运动仿真matlab程序.docx_第3页
第3页 / 共10页
牛头刨床运动仿真matlab程序.docx_第4页
第4页 / 共10页
牛头刨床运动仿真matlab程序.docx_第5页
第5页 / 共10页
点击查看更多>>
下载资源
资源描述

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

《牛头刨床运动仿真matlab程序.docx》由会员分享,可在线阅读,更多相关《牛头刨床运动仿真matlab程序.docx(10页珍藏版)》请在冰豆网上搜索。

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

牛头刨床运动仿真matlab程序

附录

牛头刨床主运动机构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计算牛头刨床机构位移,角速度,角加速度

forn1=1:

459;

theta1(n1)=-2*pi+5.8199+(n1-1)*hd;

ll=[l1,l3,l4,l6,l61];

[theta,omega,alpha]=six_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=(n1-1)*2*pi/360;

subplot(2,2,1);%绘角位移及位移线图

plot(t,theta3*du,'r-.');

gridon;

holdon;

axisauto;

[haxes,hline1,hline2]=plotyy(t,theta4*du,t,sE);

gridon;

holdon;

xlabel('时间/s')

axes(haxes

(1));

ylabel('角位移/\circ')

axes(haxes

(2));

ylabel('位移/m')

holdon;

gridon;

text(1.15,-0.15,'\theta_3')

text(3.40,0.27,'\theta_4')

text(2.25,-0.15,'s_E')

subplot(2,2,2);%绘角速度及速度线图

plot(t,omega3,'r-.');

gridon;

holdon;

axisauto;

[haxes,hline1,hline2]=plotyy(t,omega4,t,vE);

gridon;

holdon;

xlabel('时间/s')

axes(haxes

(1));

ylabel('角速度/rad\cdots^{-1}')

axes(haxes

(2));

ylabel('速度/m\cdots^{-1}')

holdon;

gridon;

text(3.1,0.35,'\omega_3')

text(2.1,0.1,'\omega_4')

text(5.5,0.45,'v_E')

subplot(2,2,3);%绘角加速度及加速度线图

plot(t,alpha3,'r-.');

gridon;

holdon;

axisauto;

[haxes,hline1,hline2]=plotyy(t,alpha4,t,aE);

gridon;

holdon;

xlabel('时间/s')

axes(haxes

(1));

ylabel('角加速度/rad\cdots^{-2}')

axes(haxes

(2));

ylabel('加速度/m\cdots^{-2}')

holdon;

gridon;

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);%牛头刨床机构

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(theta3(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)*1000-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)=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));

holdon;

k=3:

4;

plot(x(k),y(k));

holdon;

k=5:

9;

plot(x(k),y(k));

holdon;

k=10:

15;

plot(x(k),y(k));

holdon;

k=16:

17;

plot(x(k),y(k));

holdon;

gridon;

axis([-5006000650]);

title('牛头刨床运动仿真');

gridon;

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),'o');

holdon;

gridon;

xlabel('mm')

ylabel('mm')

axis([-4006000650]);

%4牛头刨床机构运动仿真

figure

(2)

m=moviein(20);

j=0;

forn1=1:

5:

360

j=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(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*1000*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(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)=x(10);

y(15)=y(10);x(16)=0;

y(16)=0;

x(17)=0;

y(17)=l6*1000;

k=1:

2;

plot(x(k),y(k));

holdon;

k=3:

4

plot(x(k),y(k));

holdon;

k=5:

9;

plot(x(k),y(k));

holdon;

k=10:

15;

plot(x(k),y(k));

holdon;

k=16:

17;

plot(x(k),y(k));

holdon;

gridon;

axis([-5006000650]);

title('牛头刨床运动仿真');

gridon;

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),'o');

axisequal;

m(j)=getframe;

end

movie(m)

2.子函数six_bar文件

function[theta,omega,alpha]=six_bar(theta1,omega1,alpha1,ll)

l1=ll

(1);

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

当前位置:首页 > 农林牧渔 > 林学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1