2007年4月29日 星期日

作業六

第一部分
某一平面組合機構如下圖,其中包括兩滑塊元件一與地固定,另一分於固定於兩桿。青色者則為滑槽。試

6.1.1 標出桿號及結數,並計算共計有多少連桿及結數。
如圖所示



6.1.2利用古魯伯公式,計算此機構之可動度,請列出其計算方法。
由公式得知
M=3*(N-J-1)+FN=12 J=15 
F為12個旋轉結+1個滑動結+2個滑槽結F=12*1+1*1+2*2=17 M=-12+17=5 
所以自由度為5

6.1.3請利用function[df]=gruebler()函數計算其對應之可動度。

使用function gruebler我們可以在裡面輸入旋轉結12、滑動結1、滑槽結2可得gruebler(12,[12 1 2])自由度為5

6.1.4討論此機構中滑塊及滑槽對可動度之影響

滑槽的自由度為2,可旋轉並可延滑槽方向移動。
第2桿處的滑塊,自由度為2,可旋轉並可延x方向移動F處滑塊,自由度為2,可旋轉並可延滑塊方向移動








第二部份
下面為一個立體機構,分別由兩個旋轉結,一個筒結及三個球結組成。試說明:
· 利用古魯伯公式如何計算整個機構之自由度,可以動嗎?
· 請利用function[df]=gruebler()函數計算其對應之可動度,並相互印證。
· 這裡有所謂楕性自由度嗎?其對整個機構之影響如何?

6.2.1各結之自由度如何?
如圖


1.4為旋轉結,自由度1,為能滑動的圓柱體。
6為圓柱結,自由度2 ,為不能滑動的圓柱體。
2,3,5為球結,自由度3 。

6.2.2利用古魯伯公式如何計算整個機構之自由度,可以動嗎?

M=6(N-J-1)+f=6(6-6-1)+13
M=7 
可算出其自由度為7在減掉惰性自由度可得
M=7-2=5


6.2.3請利用function[df]=gruebler()函數計算其對應之可動度,並相互印證。

gruebler(6,[2 0 0 3 1])
可得自由度為7
減掉惰性自由度可得M=5

6.2.4這裡有所謂楕性自由度嗎?其對整個機構之影響如何?
M=6(7-7-1)+Σf=8
故機構可動
以gruebler函數算之,
gruebler(7,[3 0 0 3 1])
自由度為8
惰性自由度為4,
所以整體自由度為8-4=4。

第三部份
假設有三組四連桿,設第一桿為固定桿,各桿長度分別如下:
1. 第一組:桿1-桿4分別為7,4,6,5cm
2. 第二組:桿1-桿4分別為8,3.6,5.1,4.1cm
3. 第三組:桿1-桿4分別為5.4,3.1,6.6,4.7cm

6.3.1何謂葛拉索機構及非葛拉索機構?

在一四連桿當中,
令四桿的桿長為g(最長桿的長度)
s(最短桿的長度)
p,q(中間長度之兩桿的長度)
則當s+g<p+q時,為葛拉索第一類型至少有一桿可為旋轉桿。
s+g>p+q,為葛拉索第二類型為三搖桿運動。
s+g=p+q,為葛拉索第三類型連桿有兩種形式可繞一圈旋轉。
(一三型為葛索拉機構,第二行為非葛索拉)
6.3.2試問各組應屬何種機構?其迴轉情況會如何?
一:7+4=6+5,故屬於葛拉索第三類型桿,即中立連桿組二:8+3.6>5.1+4.1,故屬於葛拉索第二類桿,即非葛拉索連桿三:6.6+3.1<5.4+4.7,其屬於葛拉索第一類桿



6.3.3試用grashof()函數檢驗上述三組的連桿組合。


一:grashof(1,[7 4 6 5])
為Neutral Linkage
二:grashof(1,[8 3.6 5.1 4.1])
為Non-Grashof Linkage
三:grashof(1,[5.4 3.1 6.6 4.7])
為Crank-Rocker Linkage

6.3.4上述三組連桿若要成為葛拉索機構,則應如何改善?

從上述的分析,我們知道一跟三是葛拉索機構,第二組則為非葛拉索型,若要將其改成葛拉索型機構,只要將葛拉索機構中最長與最短之和小於另外兩桿之和即可變成一個葛拉索機構。

2007年4月28日 星期六

作業七

本人4/19有上課


題目設有三桿相連結成端桿(dyad)之型式。請利用網路講義中之函數dyad及dyad_draw作分析。
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;

1. 當t=[1 2 3 4 5]秒時,此端桿之對應方位如何?




運用function ground,anchor,dyad,dyad_draw的結合運用(在老師的課程網頁中都有詳細的敘述),這題中我們需要再建立一個function,但是只要多一個變數,再加上其關係式即可。我的新的function設定為dyad_drawtime,多了一個變數t,而我加在function dyad_draw的程式碼如下:

theta2=theta+td*t+tdd*t^2/2
%設theta2來連接t和theta的關係
td2=td+t*tdd
[vec,data] = dyad(rho,180/pi*theta2,td2,tdd);
%theta2要從弧度換角度
x=[0;cumsum(real(data(:,1)))];y=[0;cumsum(imag(data(:,1)))];
%建立一個for迴圈
for i=1:length(x)-1
linkshape([x(i) y(i)],[x(i+1) y(i+1)],1);
axis equal;
end

因為老師網頁中的function 有畫出加速度與時間的關係,所以我們把下列程式碼刪除
for k=1:length(rho)
x0=x(k+1);y0=y(k+1);
vx=x0+real(data(k,2));vy=y0+imag(data(k,2));
ax=x0+real(data(k,3));ay=y0+imag(data(k,3));
line([x0 vx],[y0 vy],'marker','s','linewidth',2);
line([x0 ax],[y0 ay],'marker','s','color','r','linewidth',3)
end
sdata=sum(data);
ss=[real(sdata(1)) imag(sdata(1))];
vv=[real(sdata(2)) imag(sdata(2))];
aa=[real(sdata(3)) imag(sdata(3))];
line([0 ss(1)],[0 ss(2)],'linestyle',':','linewidth',2)
line([ss(1) ss(1)+vv(1)],[ss(2) ss(2)+vv(2)],...
'marker','d','color','g','linewidth',3)
line([ss(1) ss(1)+aa(1)],[ss(2) ss(2)+aa(2)],...
'marker','d','color','m','linewidth',3)
axis equal;grid on

在螢幕上輸入
ground(0,0,5,0)
anchor(-5,0,0,0)
for t=1:5
dyad_drawtime([10 15 5],[0 0 0],[0.2,0.3,0.4],[0,0.1,0.2],t)
%座號的末一位是零
end
axis equal
即可得到端桿一到五秒的變化圖

2. 繪出三桿之結點之速度,加速度與時間t之關係。



把上述刪除的加入,即可得到速度加速度與時間的關係,為了使畫面更清晰,可刪除function中畫linkshape的程式,但是本圖中為了表示使各連桿加速度與速度清楚標示,暫且不刪除

3. 能作出此時間區段之動畫嗎?


b49611010 7.1.3


在視窗中輸入for t=1:0.1:5
%從一秒跑到六秒每格0.1秒停一次
axis offaxis ([-20 30 -10 20])
%設定座標範圍
ground(0,0,5,0)
anchor(-5,0,0,0)
dyad_drawtime([10 15 5],[0 0 0],[0.2,0.3,0.4],[0,0.1,0.2],t)
pause(0.1)
if t<5
end
end



2007年4月12日 星期四

作業五

5.1.1



%設上手臂長30cm
L1=30
%用line將每一點連起來
arm1x=[0 (-4)*sind(30) (-4)*sind(45) (-4)*sind(60) -4 -5 -5*cosd(30) -5*cosd(45) -5*cosd(60) 0 5*cosd(60) 5*cosd(45) 5*cosd(30) 5 4 4*cosd(30) 4*cosd(45) 4*cosd(60) 0]
arm1y=-L1+[ -4 -4*cosd(30) -4*cosd(45) -4*cosd(60) 0 L1 5*sind(30)+L1 5*sind(45)+L1 5*sind(60)+L1 L1+5 5*sind(60)+L1 5*sind(45)+L1 5*sind(30)+L1 L1 0 -4*sind(30) -4*sind(45) -4*sind(60) -4]
line(arm1x,arm1y);
axis equal

%設下手臂長25
L2=25
arm2x=[ -4 4*cosd(150) 4*cosd(135) 4*cosd(120) 0 L2 L2+3*cosd(60) L2+3*cosd(45) L2+3*cosd(30) L2+3 L2+3*cosd(30) L2+3*cosd(45) L2+3*cosd(60) L2 0 (-4)*sind(30) (-4)*sind(45) (-4)*sind(60) -4]
arm2y=-L1+[ 0 4*sind(150) 4*sind(135) 4*sind(120) 4 3 3*sind(60) 3*sind(45) 3*sind(30) 0 -3*sind(30) -3*sind(45) -3*sind(60) -3 -4 -4*cosd(30) -4*cosd(45) -4*cosd(60) 0]
line(arm2x,arm2y);
axis equal

%設手掌8cm
L3=8
palmx=L2+[ -3 3*cosd(150) 3*cosd(135) 3*cosd(120) 0 L3 L3+5*cosd(60) L3+5*cosd(45) L3+5*cosd(30) L3+5 L3+5*cosd(30) L3+5*cosd(45) L3+5*cosd(60) L3 0 (-3)*sind(30) (-3)*sind(45) (-3)*sind(60) -3]
palmy=-L1+[ 0 3*sind(150) 3*sind(135) 3*sind(120) 3 5 5*sind(60) 5*sind(45) 5*sind(30) 0 -5*sind(30) -5*sind(45) -5*sind(60) -5 -3 -3*cosd(30) -3*cosd(45) -3*cosd(60) 0]
line(palmx,palmy);
axis equal


5.1.2


%設計一個function輸入L1L2L3 和旋轉角度
function body(L1,L2,L3,theta1,theta2,theta3)
arm1x=[0 (-4)*sind(30) (-4)*sind(45) (-4)*sind(60) -4 -5 -5*cosd(30) -5*cosd(45) -5*cosd(60) 0 5*cosd(60) 5*cosd(45) 5*cosd(30) 5 4 4*cosd(30) 4*cosd(45) 4*cosd(60) 0]
arm1y=-L1+[ -4 -4*cosd(30) -4*cosd(45) -4*cosd(60) 0 L1 5*sind(30)+L1 5*sind(45)+L1 5*sind(60)+L1 L1+5 5*sind(60)+L1 5*sind(45)+L1 5*sind(30)+L1 L1 0 -4*sind(30) -4*sind(45) -4*sind(60) -4]
line(arm1x,arm1y);
axis equal

arm2x=[ -4 4*cosd(150) 4*cosd(135) 4*cosd(120) 0 L2 L2+3*cosd(60) L2+3*cosd(45) L2+3*cosd(30) L2+3 L2+3*cosd(30) L2+3*cosd(45) L2+3*cosd(60) L2 0 (-4)*sind(30) (-4)*sind(45) (-4)*sind(60) -4]
arm2y=[ 0 4*sind(150) 4*sind(135) 4*sind(120) 4 3 3*sind(60) 3*sind(45) 3*sind(30) 0 -3*sind(30) -3*sind(45) -3*sind(60) -3 -4 -4*cosd(30) -4*cosd(45) -4*cosd(60) 0]
line(arm2x,arm2y);
axis equal

palmx=[ -3 3*cosd(150) 3*cosd(135) 3*cosd(120) 0 L3 L3+5*cosd(60) L3+5*cosd(45) L3+5*cosd(30) L3+5 L3+5*cosd(30) L3+5*cosd(45) L3+5*cosd(60) L3 0 (-3)*sind(30) (-3)*sind(45) (-3)*sind(60) -3]
palmy=[ 0 3*sind(150) 3*sind(135) 3*sind(120) 3 5 5*sind(60) 5*sind(45) 5*sind(30) 0 -5*sind(30) -5*sind(45) -5*sind(60) -5 -3 -3*cosd(30) -3*cosd(45) -3*cosd(60) 0]
line(palmx,palmy);
axis equal
clf

axis equal
%將座標調到適當範圍
AXIS([-70 70 -70 40]);
x1=arm1x*cosd(90-theta1)-arm1y*sind(90-theta1);
y1=arm1x*sind(90-theta1)+arm1y*cosd(90-theta1);
line(x1,y1)
theta2=180-(theta2-theta1);
x2=arm2x*cosd(-theta2)-arm2y*sind(-theta2)-L1*sind(theta1-90);
y2=arm2x*sind(-theta2)+arm2y*cosd(-theta2)-L1*cosd(theta1-90);
line(x2,y2)
theta3=theta3-theta2-180
x3=palmx*cosd(theta3)-palmy*sind(theta3) -L1*sind(theta1-90)+L2*cosd(theta2);
y3=palmx*sind(theta3)+palmy*cosd(theta3) -L1*cosd(theta1-90)-L2*sind(theta2);
line(x3,y3)

5.1.3




%在視窗中輸入(30cm,25cm,8cm,120度, 120度, 120度)
body(30,25,8,120,120,120)


5.1.4
http://www.youtube.com/watch?v=8CUKsS9slEQ

L1=30
L2=25
L3=8
arm1x=[0 (-4)*sind(30) (-4)*sind(45) (-4)*sind(60) -4 -5 -5*cosd(30) -5*cosd(45) -5*cosd(60) 0 5*cosd(60) 5*cosd(45) 5*cosd(30) 5 4 4*cosd(30) 4*cosd(45) 4*cosd(60) 0]
arm1y=-L1+[ -4 -4*cosd(30) -4*cosd(45) -4*cosd(60) 0 L1 5*sind(30)+L1 5*sind(45)+L1 5*sind(60)+L1 L1+5 5*sind(60)+L1 5*sind(45)+L1 5*sind(30)+L1 L1 0 -4*sind(30) -4*sind(45) -4*sind(60) -4]
line(arm1x,arm1y);
axis equal

arm2x=[ -4 4*cosd(150) 4*cosd(135) 4*cosd(120) 0 L2 L2+3*cosd(60) L2+3*cosd(45) L2+3*cosd(30) L2+3 L2+3*cosd(30) L2+3*cosd(45) L2+3*cosd(60) L2 0 (-4)*sind(30) (-4)*sind(45) (-4)*sind(60) -4]
arm2y=[ 0 4*sind(150) 4*sind(135) 4*sind(120) 4 3 3*sind(60) 3*sind(45) 3*sind(30) 0 -3*sind(30) -3*sind(45) -3*sind(60) -3 -4 -4*cosd(30) -4*cosd(45) -4*cosd(60) 0]
line(arm2x,arm2y);
axis equal

palmx=[ -3 3*cosd(150) 3*cosd(135) 3*cosd(120) 0 L3 L3+5*cosd(60) L3+5*cosd(45) L3+5*cosd(30) L3+5 L3+5*cosd(30) L3+5*cosd(45) L3+5*cosd(60) L3 0 (-3)*sind(30) (-3)*sind(45) (-3)*sind(60) -3]
palmy=[ 0 3*sind(150) 3*sind(135) 3*sind(120) 3 5 5*sind(60) 5*sind(45) 5*sind(30) 0 -5*sind(30) -5*sind(45) -5*sind(60) -5 -3 -3*cosd(30) -3*cosd(45) -3*cosd(60) 0]
line(palmx,palmy);
axis equal
clf

%角度從下列度數範圍每10度增加
theta1=linspace(-90,-75,10)
theta2=linspace(-45,-35,10)
theta3=linspace(-30,-10,10)
axis equal

% n跑十次
for n=1:10;
AXIS([-10 40 -20 40]);
axis equal
x1=arm1x*cosd(90-theta1(n))-arm1y*sind(90-theta1(n));
y1=arm1x*sind(90-theta1(n))+arm1y*cosd(90-theta1(n));
line(x1,y1)
theta2(n)=180-(theta2(n)-theta1(n));
x2=arm2x*cosd(-theta2(n))-arm2y*sind(-theta2(n))-L1*sind(theta1(n)-90);
y2=arm2x*sind(-theta2(n))+arm2y*cosd(-theta2(n))-L1*cosd(theta1(n)-90);
line(x2,y2)
theta3(n)=theta3(n)-theta2(n)-180
x3=palmx*cosd(theta3(n))-palmy*sind(theta3(n)) -L1*sind(theta1(n)-90)+L2*cosd(theta2(n));
y3=palmx*sind(theta3(n))+palmy*cosd(theta3(n)) -L1*cosd(theta1(n)-90)-L2*sind(theta2(n));
line(x3,y3)
axis equal
pause(0.5)
clf
end


5.2.1





%以連桿畫出手指的形狀
L1=10
L2=8
L3=7


linkshape([0,0],[-L1,0])
linkshape([-L1,0],[-L1-L2,0])
linkshape([-L1-L2,0],[-L1-L2-L3,0])


5.2.2

http://www.youtube.com/watch?v=A6O1RhBqZCA
%做一個funtion輸入手掌的尺寸
%假設四隻手指在同一個水平上
%輸入每隻手指的尺寸
function finger(palm)
%食指
%輸入每節和手掌的關係式
L1=palm/3.5
L2=palm/3-1
L3=palm/3-2
linkshape([0,0],[-L1,0])
linkshape([-L1,0],[-L1-L2,0])
linkshape([-L1-L2,0],[-L1-L2-L3,0])
%設每個關節從零度跑到90度每次跑8度
theta1=linspace(0,90,8)
theta2=linspace(0,90,8)
theta3=linspace(0,90,8)
for n=1:8
axis equal
AXIS([-5 30 -10 20]);

x1=-L1*cosd(theta1(n))
y1=L1*sind(theta1(n))
linkshape([0,0],[x1,y1])
theta2(n)=theta1(n)+theta2(n)
x2=x1-L2*cosd(theta2(n))
y2=y1+L2*sind(theta2(n))
linkshape([x1,y1],[x2,y2])
theta3(n)=theta2(n)+theta3(n)
x3=x2-L3*cosd(theta3(n))
y3=y2+L3*sind(theta3(n))
linkshape([x2,y2],[x3,y3])
axis equal
pause(0.3)
clf
end


%中指
L1=palm/3
L2=palm/3-1
L3=palm/3-2
linkshape([0,0],[-L1,0])
linkshape([-L1,0],[-L1-L2,0])
linkshape([-L1-L2,0],[-L1-L2-L3,0])

theta1=linspace(0,90,8)
theta2=linspace(0,90,8)
theta3=linspace(0,90,8)
for n=1:8
axis equal
AXIS([-5 30 -10 20]);

x1=-L1*cosd(theta1(n))
y1=L1*sind(theta1(n))
linkshape([0,0],[x1,y1])
theta2(n)=theta1(n)+theta2(n)
x2=x1-L2*cosd(theta2(n))
y2=y1+L2*sind(theta2(n))

linkshape([x1,y1],[x2,y2])

theta3(n)=theta2(n)+theta3(n)
x3=x2-L3*cosd(theta3(n))
y3=y2+L3*sind(theta3(n))
linkshape([x2,y2],[x3,y3])
axis equal
pause(0.3)
clf
end
%無名指
L1=palm/3.5
L2=palm/3.5
L3=palm/3.5
linkshape([0,0],[-L1,0])
linkshape([-L1,0],[-L1-L2,0])
linkshape([-L1-L2,0],[-L1-L2-L3,0])

theta1=linspace(0,90,8)
theta2=linspace(0,90,8)
theta3=linspace(0,90,8)
for n=1:8
axis equal
AXIS([-5 30 -10 20]);

x1=-L1*cosd(theta1(n))
y1=L1*sind(theta1(n))
linkshape([0,0],[x1,y1])
theta2(n)=theta1(n)+theta2(n)
x2=x1-L2*cosd(theta2(n))
y2=y1+L2*sind(theta2(n))

linkshape([x1,y1],[x2,y2])

theta3(n)=theta2(n)+theta3(n)
x3=x2-L3*cosd(theta3(n))
y3=y2+L3*sind(theta3(n))
linkshape([x2,y2],[x3,y3])
axis equal
pause(0.3)
clf
end
%小指

L1=palm/4
L2=palm/4
L3=palm/4
linkshape([0,0],[-L1,0])
linkshape([-L1,0],[-L1-L2,0])
linkshape([-L1-L2,0],[-L1-L2-L3,0])

theta1=linspace(0,90,8)
theta2=linspace(0,90,8)
theta3=linspace(0,90,8)
for n=1:8
axis equal
AXIS([-5 30 -10 20]);

x1=-L1*cosd(theta1(n))
y1=L1*sind(theta1(n))
linkshape([0,0],[x1,y1])
theta2(n)=theta1(n)+theta2(n)
x2=x1-L2*cosd(theta2(n))
y2=y1+L2*sind(theta2(n))

linkshape([x1,y1],[x2,y2])

theta3(n)=theta2(n)+theta3(n)
x3=x2-L3*cosd(theta3(n))
y3=y2+L3*sind(theta3(n))
linkshape([x2,y2],[x3,y3])
axis equal
pause(0.3)
clf
end

5.2.3
假設我們知道每隊的手指長L1,L2,L3
知道角加速度a1,a2,a3
那麼切線加速度即為a*L
法線加速度為w*w*L
藉由此關係式可以求出來切線法線加速度