牛头刨床matlab程序

机械原理课设

牛头刨床常见的六杆机构,采用解析法进行运动特性分析,用matalb实现

function main1
% 输入已知数据
clear;
clc;
l1 =0.100;
l3 =0.545;
l4=0.145;
l6=0.35;
l61=0.635;
w1=6.37;
alpha1=0;
D2H=pi/180;
H2D=180/pi;
 
for m=1:3601          %表示theta1的角度 范围0——2pi
o1(m)=pi*(m-1)/1800;
o31(m)=atan((l6+l1*sin(o1(m)))/(l1*cos(o1(m))));   %由theta1算出theta3的角度
if o31(m)>=0
o3(m)=o31(m);
else o3(m)=pi+o31(m);
end
 
s3(m)=(l1*cos(o1(m)))/cos(o3(m));              
o4(m)=pi-asin((l61-l3*sin(o3(m)))/l4);
se(m)=l3*cos(o3(m))+l4*cos(o4(m));            %机构4连接点与中垂线的距离
if o1(m)==pi/2              %机构的奇点
    o3(m)=pi/2;
    s3(m)=l1+l6;
end
 
if o1(m)==3*pi/2
    o3(m)=pi/2;
    s3(m)=16-l1;
end
 
%转换数组
A1=[cos(o3(m)),-s3(m)*sin(o3(m)),0,0;sin(o3(m)),s3(m)*cos(o3(m)),0,0;0,-l3*sin(o3(m)),-l4*sin(o4(m)),-1;0,l3*cos(o3(m)),l4*cos(o4(m)),0];
B1=w1*[-l1*sin(o1(m));l1*cos(o1(m));0;0];
D1=A1\B1;
E1(:,m)=D1;
ds(m)=D1(1);
w3(m)=D1(2);
w4(m)=D1(3);
ve(m)=D1(4);
 
A2=[cos(o3(m)),-s3(m)*sin(o3(m)),0,0;sin(o3(m)),s3(m)*cos(o3(m)),0,0;0,-l3*sin(o3(m)),-l4*sin(o4(m)),-1;0,l3*cos(o3(m)),l4*cos(o4(m)),0];
B2=-[w3(m)*sin(o3(m)),(-ds(m)*sin(o3(m))-s3(m)*w3(m)*cos(o3(m))),0,0;w3(m)*cos(o3(m)),(ds(m)*cos(o3(m))-s3(m)*w3(m)*sin(o3(m))),0,0;0,-l3*w3(m)*cos(o3(m)),-l4*w4(m)*cos(o4(m)),0;0,-l3*w3(m)*sin(o3(m)),-l4*w4(m)*sin(o4(m)),0]*[ds(m);w3(m);w4(m);ve(m)];
C2=w1*[-l1*w1*cos(o1(m));-l1*w1*sin(o1(m));0;0];
B=B2+C2;
D2=A2\B;
E2(:,m)=D2;
dds(m)=D2(1);
a3(m)=D2(2);
a4(m)=D2(3);
ae(m)=D2(4);
end
 
o1D=o1.*H2D;          %弧度转化为角度
y=[o3.*H2D;o4.*H2D];
w=[w3;w4];
a=[a3;a4];
 
figure(1);
subplot(221);
yyaxis left
plot(o1D,y);
ylabel('\it\theta3,\theta4');
yyaxis right
plot(o1D,se);
ylabel('Se')
xlabel('\it\theta1');
title('位置线图');
axis auto;
 
subplot(222);
yyaxis left
plot(o1D,w);
ylabel('\it\omega3,\omega4');
yyaxis right
plot(o1D,ve);
ylabel('Ve');
xlabel('\it\theta1');
title('速度线图');
axis auto;
 
subplot(212);
yyaxis left
plot(o1D,a);
ylabel('\it\alpha3,\alpha4');
yyaxis right
plot(o1D,ae);
ylabel('\it\alphaE');
xlabel('\it\theta 1');
title('加速度线图');
axis auto;
 

MATLAB生成的运动图线

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值