天天看點

matlab平面五杆機構運動學仿真

平面連杆機構是由若幹剛性構件用低副聯接而 成.

其運動設計方法主要是圖解法

解析法

圖譜法

和模型實驗法等

.

随着數值計算方法的發展和計算 機的普及應用,

解析法已成為各類平面連杆機構運

動設計的一種有效方法

.Matlab

Simulink

是一 種即拖即用的方框式子產品化仿真工具箱,

隻需編制

較少的腳本檔案或

M

檔案就可實作複雜的動态仿 真,

l0 = 200*sqrt(3)+125*sqrt(2);

delta0 = 0;

l1 = 100;

delta1 = 30/180*pi;

l2 = 300;

delta2 = 150/180*pi;

l3 = 250;

delta3 = 45/180*pi;

l4 = 125*sqrt(2)-100;

delta4 = 90/180*pi;

%% 

line1 = 0:1:l0;

x0 = line1*cos(delta0);

y0 = line1*sin(delta0);

% figure(1)

% plot(x0,y0,'LineWidth',3)

line1 = 0:1:l1;

x1 = line1*cos(delta1);

y1 = line1*sin(delta1);

% figure(2)

% plot(x1,y1,'LineWidth',3)

line2 = 0:1:l2;

x2 = line2*cos(pi-delta2)+x1(end);

y2 = -line2*sin(pi-delta2)+y1(end);

% figure(3)

% plot(x2,y2,'LineWidth',3)

line3 = 0:1:l3;

x3 = line3*cos(delta3)+x2(end);

y3 = line3*sin(delta3)+y2(end);

% figure(4)

% plot(x3,y3,'LineWidth',3)

% % plot(x0,y0,x1,y1,x2,y2,x3,y3)

line4 = 0:1:l4;

x4 = line4*cos(delta4)+x3(end);

y4 = -line4*sin(delta4)+y3(end);

% figure(5)

% plot(x4,y4,'LineWidth',3)

figure(11)

plot(x0,y0,x1,y1,x2,y2,x3,y3,x4,y4,'LineWidth',3)

legend('맷0','맷1','맷2','맷3','맷4')

xlim([0 600])

ylim([-200 200])

%% 

sim('untitled1.mdl')

delta0 = 0;

delta1 = yout(end,1);

delta2 = yout(end,2);

delta3 = yout(end,3);

delta4 = yout(end,4);

%% 

line1 = 0:1:l0;

x0 = line1*cos(delta0);

y0 = line1*sin(delta0);

% figure(1)

% plot(x0,y0,'LineWidth',3)

line1 = 0:1:l1;

x1 = line1*cos(-delta1);

y1 = line1*sin(-delta1);

% figure(2)

% plot(x1,y1,'LineWidth',3)

% figure(222)

% plot(x3,y3,x2,y2,x0,y0,x1,y1,'LineWidth',3)

line2 = 0:1:l2;

x2 = -line2*cos(delta2)+x1(end);

y2 = -line2*sin(delta2)+y1(end);

% figure(3)

% plot(x2,y2,'LineWidth',3)

line3 = 0:1:l3;

x3 = -line3*cos(pi/2-delta3)+x2(end);

y3 = line3*sin(delta3)+y2(end);

% figure(4)

% plot(x3,y3,'LineWidth',3)

% % plot(x0,y0,x1,y1,x2,y2,x3,y3)

% line4 = 0:1:l4;

% x4 = line4*cos(-delta4)+x3(end);

% y4 = line4*sin(-delta4)+y3(end);

x4 = linspace(x3(end),x0(end),30);

y4 = linspace(y3(end),y0(end),30);

% figure(5)

% plot(x4,y4,'LineWidth',3)

figure(12)

plot(x0,y0,x1,y1,x2,y2,x3,y3,x4,y4,'LineWidth',3)

xlim([0 600])

ylim([-200 200])

繼續閱讀