?? angle.asv
字號:
L0=0;L(1)=0;L(2)=3.72;L(3)=1.62;L(4)=1.05;x0=5.5;xf=3;z0=0;zf=0;m=0;%挖掘機參數
af=atan((z0-zf)./(x0-xf));%判斷所給直線的角度
%while 23*pi/180<=beita<=149.5*pi/180 | -51*pi/180<afa<75*pi/180
t=0:0.1:25;
x=x0-0.1*t.*cos(af);%速度為0.1m/s
z=z0-0.1*t.*sin(af);
y=0;
sita1=atan(y./x);
sita4=0;
gama=atan(z./x);
afa=acos((x.^2+z.^2+L(2)^2-(L(3)+L(4))^2)./(2*sqrt(x.^2+z.^2)*L(2)))+gama;%動臂轉角
beita=acos(((L(2)^2+(L(3)+L(4))^2)-x.^2-z.^2)./(2*L(2)*(L(3)+L(4))));%斗桿與動臂夾角
%end
%for i=1:1:length(beita)
for i=1:1:length(beita)
if 23*pi/180<beita(i)&180<beita(i)<149.5*pi/180 & -51*pi/180<afa(i)&afa(i)<75*pi/180
m=m+1;
end
end
for i1=1:1:m
afa0(i1)=afa(i1);
beita0(i1)=beita(i1);
end
n=0.1:0.1:m/10;
subplot(2,2,1)
theta11=afa0./pi*180+beita0./pi*180;
plot(n,theta11)
title('挖掘機回轉角度與斗桿轉動角度之和')
xlabel('時間(秒)')
ylabel('角度(度)')
grid
subplot(2,2,2)
theta22=afa0./pi*180;
plot(n,theta22)
title('挖掘機動臂轉動角度曲線')
xlabel('時間(秒)')
ylabel('角度(度)')
grid
subplot(2,2,3)
theta33=beita0./pi*180;
plot(n,theta33)
title('挖掘機斗桿轉動角度曲線')
xlabel('時間(秒)')
ylabel('角度(度)')
grid
%end
subplot(2,2,4)
theta44=sita1./pi*180;
plot(theta22,theta33)
title('挖掘機鏟斗轉動角度曲線')
xlabel('時間(秒)')
ylabel('角度(度)')
grid
%鏟斗與斗桿的相對轉角為零!
%該程序已經驗證過beita和afa的正確性,2005.3.14
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -