2007年4月25日 星期三

第七次作業


由題目可知
function dyad_draw(rho,theta,td,tdd)其中:


各桿之對應長度rho=[a, a+5, a-5]cm,a=(你的學號末一碼)+10;
各桿之對應起始角度theta=[0, 0, 0]度;
各桿之對應角速度為td=[0.2, 0.5, 0 .3]rad/s;
各桿之對應角加速度為tdd=[0, 0.1, 0.2]rad/s^2;


P7.1




a=6(學號)+10=16

各桿之對應長度rho=[16,21,11]cm





>> dyad_draw([16 21 11],[0 0 0],[0.2 0.5 0.3],[0 0.1 0.2])
%利用dyad_draw函式畫出三桿連成端桿的型式



ans =



3.2000 10.5000 3.3000








藍線為各桿之速度,紅色線為加速度,綠色為三桿合速度



P7.2




考慮t=[1 2 3 4 5]之端桿運動狀態:




axis equal;

dyad_draw([16,21,11],[0,0,0],[0.2,0.5,0.3],[0,0.1,0.2]);

pause(2);%顯示最初靜止狀態的圖示2秒

clf;

for t=1:5%t為時間的參數

axis equal;

dyad_draw([16,21,11],[0.2,0.5+t*0.1,0.3+t*0.2],[0.2,0.5+t*0.1,0.3+t*0.2],[0,0.1,0.2]);

pause(1);%畫出考慮時間t之後的運動情形

clf;

%利用消除前一個圖做成動畫

end;








第六次作業


P6.1



總桿數N=11+1(地面)+2*1(滑塊)=14

總結數J=6*(3-1)+3*1[連地結]+2*1[滑塊] =17

總連結度Σf=16*1+1*2[滑槽]=18



可動度M=3*(N-J-1)+Σf

=3*(14-17-1)+18

=6



>>[df] = gruebler(14,[16 0 1]);

df = 6



分析:

左邊的滑動結B可同時在桿軸2上移動且可對桿4轉動,視為連結度2的複式結。

而槽梢結H的部分,其運動結在滑槽中可同時做移動和旋轉,所以是連結度為2的複式結。

最後,右上角之滑塊E因為與地面接觸,視為一滑塊結,連結度為2,表示可同時作軸的旋轉及滑塊的移動,又因其與地面接觸,故總結數加1。





P6.2



由題目知:球結=3,筒結=2,旋轉結=1

總桿數N=7

總結數J=3+2+1=6

總連結度Σf=3*3+2*1+1*2=13



可動度M=3*(N-J-1)+Σf

=3*(7-6-1)+13

=13



>>[df] = gruebler(6,[2 0 0 3 1])

df = 13


分析:

由於球結的存在,旋轉方位產生共線之緣故,造成部分連桿會有自轉運動,因此減少一個自由度。

而本題中,球結與球結之間的聯結桿可以自轉,故具有一惰性自由度,所以可動度減為12。





function [df]=gruebler(nlink,jointype)

%

% [df]=gruebler(nlink,jointype)

% nlink:no. of total links

% jointype:row matrix for number of joints for each type,

% the order of elements is:

% 1 R-joint 2 slider 3 compound joint(sliding & rolling)

% 4 ball 5 cylinder 6 planar 7 cylinder rolling

% 8 cam 9 helix 10 ball & 11 point contact

% Example: df=gruebler(4,[4])

% Author:D.S.Fon Bime,NTU. Date:Jan. 30, 2007


code=[1 1 2 3 2 3 1 2 1 3 5];

n=length(jointype);

dim=3;if n>3, dim=6;end

;ff=0;njoint=0;

for i=1:n,

njoint=njoint+jointype(i);

ff=ff+jointype(i)*code(i);

end;

df=dim*(nlink-njoint-1)+ff;





P6.3



在一四連桿組中,若依其桿長可設定標示如下

.g最長桿之長度

.s最短桿之長度

.p,q中間長度桿之長度



(1) 葛拉索第一類型(葛拉索型機構)

當最短桿與最長桿之和小於其他兩桿之和

則至少有一桿可為旋轉桿

  s+g < p+q

(2) 葛拉索第二類型(非葛拉索型機構)

當最短桿與最長桿之和大於其他兩桿之和

則所有三個活動連桿必屬搖桿或稱參搖桿機構

  s+g  > p+q
(3) 葛拉索型之特殊狀況(或稱第三型)

  即最短桿與最長桿之和等於其他兩桿之和

s+g  = p+q





1.第一組:7+4 = 6+5(第三型)

>>ans = grashof(1,[4 5 6 7])

ans = Neutral Linkage



2.第二組:8+3.6 > 5.1+4.1(非葛拉索型)

>>ans = grashof(1,[3.6 4.1 5.1 8])

ans = Non-Grashof Linkage



3.第三組:6.6+3.1 < 5.4+4.7(葛拉索型)

>>ans = grashof(1,[3.1 4.7 5.4 6.6])

ans = Double-Crank Linkage



(葛拉索型)

.若鄰近最短桿之桿為基桿時,則此四連桿屬曲柄搖桿型。

.若最短桿為基桿時,則基桿兩端之連桿為雙曲柄型。此時輸入桿若為等轉速,

輸出雖然與輸入同方向,但其速率將會因角位移而產生變化。

.若與最短桿相對應之桿為基桿時,可以得到雙搖桿機構。



(非葛拉索型)

無論哪一桿作為基桿,此四連桿系均屬於雙搖桿型,因為任何桿均無法產生完整的迴轉運動。





若要將三組連桿皆改為葛拉索型,改變他們的長度以符合葛拉索機構之要求即可。





function ans=grashof(ground_no,linkage)

% Function to test the Grashof linkage

% Inputs:

% ground_no:the ground link number in the order

% linkage: row matrix for lengths of the 4 links

% in original assigned order.

% Example:ans=grashof(4,[4 4.2 2.6 2])

% Revised: March 4, 2006


ground=linkage(ground_no);

link=sort(linkage);% sorting the links

ig=find(linkage==link(1));

if link(1)+link(4)>link(3)+link(2),

ans='Non-Grashof Linkage';

elseif link(1)+link(4)==link(3)+link(2)

ans='Neutral Linkage';

elseif link(1)==ground,

ans='Double-Crank Linkage';

else

switch ig

case 1

im=3;

case 2

im=4;

case 3

im=1;

case 4

im=2;

end;

if ground==linkage(im)

ans='Double-Rocker Linkage';

else

ans='Crank-Rocker Linkage';

end;

end;

2007年4月10日 星期二

第五週作業

P5-1-1


L1=30;
L2=23;
L3=12;

r1=L1/6;
r2=L1/12;
r3=L2/10;

arm1x=[ r1 r1*cosd(240)+r1 r1*cosd(210)+r1 0 r1*cosd(150)+r1 r1*cosd(120)+r1 r1 11*r2 11*r2+r2*cosd(60) 11*r2+r2*cosd(30) L1 11*r2 L1 11*r2+r2*cosd(-30) 11*r2+r2*cosd(-60) 11*r2 r1];
arm1y=[-r1 r1*sind(240) r1*sind(210) 0 r1*sind(150) r1*sind(120) r1 r2 r2*sind(60) r2*sind(30) 0 0 0 r2*sind(-30) r2*sind(-60) -r2 -r1];
arm2x=[10*r2 11*r2+r2*cosd(150) 11*r2+r2*cosd(120) 11*r2 L1+L2-3*r2 L1+L2-3*r2+r2*cosd(60) L1+L2-3*r2+r2*cosd(30) L1+L2-2*r2 L1+L2-3*r2+r2*cosd(-30) L1+L2-3*r2+r2*cosd(-60) L1+L2-3*r2 11*r2 11*r2+r2*cosd(240) 11*r2+r2*cosd(210) 10*r2];
arm2y=[0 r2*sind(150) r2*sind(120) r2 r2 r2*sind(60) r2*sind(30) 0 r2*sind(-30) r2*sind(-60) -r2 -r2 r2*sind(240) r2*sind(210) 0 ];
palmx=[L1+L2-2*r2 L1+L2-r2 L1+L2+L3-2*r2 L1+L2-r2 L1+L2-2*r2];
palmy=[0 r3 0 -r3 0 ];

line(arm1x,arm1y);
line(arm2x,arm2y,'color','r');
line(palmx,palmy,'color','k');
axis equal;






P5-1-2


function body(L1,L2,L3,theta1,theta2,theta3);
%function body(L1,L2,L3,theta1,theta2,theta3)
%輸入:
% L1:上臂長,L2:下臂長,L3:手掌長
% theta1為上手臂之水平角度(順時針),theta2為下手臂對上手臂的角度(逆時針),theta3為手掌對下手臂之夾角


arm1x=[ r1 r1*cosd(240)+r1 r1*cosd(210)+r1 0 r1*cosd(150)+r1 r1*cosd(120)+r1 r1 11*r2 11*r2+r2*cosd(60) 11*r2+r2*cosd(30) L1 11*r2 L1 11*r2+r2*cosd(-30) 11*r2+r2*cosd(-60) 11*r2 r1];
arm1y=[-r1 r1*sind(240) r1*sind(210) 0 r1*sind(150) r1*sind(120) r1 r2 r2*sind(60) r2*sind(30) 0 0 0 r2*sind(-30) r2*sind(-60) -r2 -r1];
arm2x=[10*r2 11*r2+r2*cosd(150) 11*r2+r2*cosd(120) 11*r2 L1+L2-3*r2 L1+L2-3*r2+r2*cosd(60) L1+L2-3*r2+r2*cosd(30) L1+L2-2*r2 L1+L2-3*r2+r2*cosd(-30) L1+L2-3*r2+r2*cosd(-60) L1+L2-3*r2 11*r2 11*r2+r2*cosd(240) 11*r2+r2*cosd(210) 10*r2];
arm2y=[0 r2*sind(150) r2*sind(120) r2 r2 r2*sind(60) r2*sind(30) 0 r2*sind(-30) r2*sind(-60) -r2 -r2 r2*sind(240) r2*sind(210) 0 ];
palmx=[L1+L2-2*r2 L1+L2-r2 L1+L2+L3-2*r2 L1+L2-r2 L1+L2-2*r2];
palmy=[0 r3 0 -r3 0 ];

line(arm1x,arm1y);
line(arm2x,arm2y,'color','r');
line(palmx,palmy,'color','k');
axis equal

clf

x1=(arm1x-r1)*cosd(-theta1)-arm1y*sind(-theta1);
y1=(arm1x-r1)*sind(-theta1)+arm1y*cosd(-theta1);
%將上臂連桿以座標原點順時針旋轉
theta2=180+theta1-theta2;
x2=x1(12)+(arm2x-11*r2)*cosd(-theta2)-arm2y*sind(-theta2);
y2=y1(12)+(arm2x-11*r2)*sind(-theta2)+arm2y*cosd(-theta2);
%將上、下臂以手肘為旋轉點,下臂逆時針旋轉
theta3=180+theta2-theta3;
x3=x2(8)+(palmx-L1-L2+2*r2)*cosd(-theta3)-palmy*sind(-theta3);
y3=y2(8)+(palmx-L1-L2+2*r2)*sind(-theta3)+palmy*cosd(-theta3);
%手掌以手腕為旋轉點,逆時針旋轉
line(x2,y2,'color','r');
line(x3,y3,'color','k');
axis equal;
axis([-30 30 -30 30]);


P5-1-3

body(30,23,12,90,-45,-30);







P5-1-4

L1=30;
L2=23;
L3=12;

r1=L1/6;
r2=L1/12;
r3=L2/10;

arm1x=[ r1 r1*cosd(240)+r1 r1*cosd(210)+r1 0 r1*cosd(150)+r1 r1*cosd(120)+r1 r1 11*r2 11*r2+r2*cosd(60) 11*r2+r2*cosd(30) L1 11*r2 L1 11*r2+r2*cosd(-30) 11*r2+r2*cosd(-60) 11*r2 r1];
arm1y=[-r1 r1*sind(240) r1*sind(210) 0 r1*sind(150) r1*sind(120) r1 r2 r2*sind(60) r2*sind(30) 0 0 0 r2*sind(-30) r2*sind(-60) -r2 -r1];
arm2x=[10*r2 11*r2+r2*cosd(150) 11*r2+r2*cosd(120) 11*r2 L1+L2-3*r2 L1+L2-3*r2+r2*cosd(60) L1+L2-3*r2+r2*cosd(30) L1+L2-2*r2 L1+L2-3*r2+r2*cosd(-30) L1+L2-3*r2+r2*cosd(-60) L1+L2-3*r2 11*r2 11*r2+r2*cosd(240) 11*r2+r2*cosd(210) 10*r2];
arm2y=[0 r2*sind(150) r2*sind(120) r2 r2 r2*sind(60) r2*sind(30) 0 r2*sind(-30) r2*sind(-60) -r2 -r2 r2*sind(240) r2*sind(210) 0 ];
palmx=[L1+L2-2*r2 L1+L2-r2 L1+L2+L3-2*r2 L1+L2-r2 L1+L2-2*r2];
palmy=[0 r3 0 -r3 0 ];

line(arm1x,arm1y);
line(arm2x,arm2y,'color','r');
line(palmx,palmy,'color','k');
axis equal;

clf

theta1=linspace(-90,-75,10);
theta2=linspace(-45,-35,10);
theta3=linspace(-30,-10,10);

for n=1:10;
x1=(arm1x-r1)*cosd(-theta1(n))-arm1y*sind(-theta1(n));
y1=(arm1x-r1)*sind(-theta1(n))+arm1y*cosd(-theta1(n));
theta2(n)=180+theta1(n)-theta2(n);
x2=x1(12)+(arm2x-11*r2)*cosd(-theta2(n))-arm2y*sind(-theta2(n));
y2=y1(12)+(arm2x-11*r2)*sind(-theta2(n))+arm2y*cosd(-theta2(n));
theta3(n)=180+theta2(n)-theta3(n);
x3=x2(8)+(palmx-L1-L2+2*r2)*cosd(-theta3(n))-palmy*sind(-theta3(n));
y3=y2(8)+(palmx-L1-L2+2*r2)*sind(-theta3(n))+palmy*cosd(-theta3(n));
line(x1,y1);
line(x2,y2,'color','r');
line(x3,y3,'color','k');
axis equal;
axis([-30 30 -30 30]);
pause(1);
clf;
end;

手臂連桿的轉動





P5-2-1

手指分為三節
將手腕視為一桿,一端為定點,
加上手指的連結點,總桿數是4
所以自由度為3;




P5-2-2

function palm(P);
%function palm(P)
%輸入手掌長度P來觀察手指的旋轉運動
%L1 L2 L3分別為指尖、第二指節、第三指節
%R1 R2 R3分別為其半徑

axis equal;
P=17;
L1=P*2/17;
L2=P*2.5/17;
L3=P*5/17;
R1=L1*0.5/2;
R2=L2*0.6/2.5;
R3=L3*0.8/5;

%右手手指順時針旋轉的極限
fbx=[0.05*cosd(270:-5:-90),R3*cosd(270) R3*cosd(225) R3*cosd(180) R2*cosd(180) R2*cosd(135) R2*cosd(90) R2*cosd(45) R2*cosd(0) R3*cosd(0) R3*cosd(-45) R3*cosd(-90)];
fby=[0.05*sind(270:-5:-90),R3*sind(270) R3*sind(225) R3*sind(180) L3-R2+R2*sind(180) L3-R2+R2*sind(135) L3-R2+R2*sind(90) L3-R2+R2*sind(45) L3-R2+R2*sind(0) R3*sind(0) R3*sind(-45) R3*sind(-90)];
fmx=[0.05*cosd(270:-5:-90) R2*cosd(270) R2*cosd(225) R2*cosd(180) R1*cosd(180) R1*cosd(135) R1*cosd(90) R1*cosd(45) R1*cosd(0) R2*cosd(0) R2*cosd(-45) R2*cosd(-90)];
fmy=[0.05*sind(270:-5:-90) R2*sind(270) R2*sind(225) R2*sind(180) L2-R1+R1*sind(180) L2-R1+R1*sind(135) L2-R1+R1*sind(90) L2-R1+R1*sind(45) L2-R1+R1*sind(0) R2*sind(0) R2*sind(-45) R2*sind(-90)];
ftx=[0.05*cosd(270:-5:-90) R1*cosd(270) R1*cosd(225) R1*cosd(180) R1*cosd(180) R1*cosd(180) R1*cosd(135) R1*cosd(90) R1*cosd(45) R1*cosd(0) R1*cosd(0) R1*cosd(-45) R1*cosd(-90)];
fty=[0.05*sind(270:-5:-90) R1*sind(270) R1*sind(225) R1*sind(180) L1+R1*sind(180) L1+R1*sind(180) L1+R1*sind(135) L1+R1*sind(90) L1+R1*sind(45) L1+R1*sind(0) R1*sind(0) R1*sind(-45) R1*sind(-90)];

line(fbx,fby);
fmyY=fmy+L3-R2;
line(fmx,fmyY,'color','r');
ftyY=fty+L3+L2-R1-R2;
line(ftx,ftyY,'color','k');

%右手手指逆時針旋轉的極限
fb=line(fbx,fby);
rotate(fb,[0 0 1],90,[0 0 0]);
fmx=fmx+(L3-R2)*cosd(180);
fmy=fmy+(L3-R2)*sind(180);
fm=line(fmx,fmy,'color','r');
rotate(fm,[0 0 1],210,[(L3-R2)*cosd(180) 0 0]);
ftx=ftx+(L3-R2)*cosd(180)+(L2-R1)*cosd(-60);
fty=fty+(L3-R2)*sind(180)+(L2-R1)*sind(-60);
ft=line(ftx,fty,'color','k');
rotate(ft,[0 0 1],-100,[(L3-R2)*cosd(180)+(L2-R1)*cosd(-60) (L3-R2)*sind(180)+(L2-R1)*sind(-60) 0]);






P5-2-3

將球丟離開手中速度為V
因為手指相對於手掌,其實只有做張開的動作
也就是,以連接手指各關節為圓心做伸展運動
假設此時為等速的展開
可視為只有法線加速度去改變方向
所以切線方向速度固定為V