11/8/06

五連桿齒輪解析

機動學中之公式7.30形成一矩陣,經簡化為:AW=C之型式。再以MATLAB指令W=A\C解出桿3、4、5之角速度。程式內容參見f5link()。其中之呼叫參數說明如下:

function [omega,theta,incta]=f5link(r1,R2,R4,r5,theta2,omega2)


輸入:r1、r5為第一(地桿)及第五桿之長度。
R2、R4為成對之齒輪半徑。
   omega2為桿2之驅動角速度,rad/s。
   theta2各桿2之對應角度。
輸出:omega為桿2、3、4、5之角速度。
   theta為桿2、3、4、5之水平角度。
   Incta為桿3與桿4成一直線時,桿3、4、5之初始角度。

利用下面之程式可以直接進行求解:


function [omega,theta,incta]=f5link(r1,R2,R4,r5,tha2,w2)
% Program 7.2
% Solve the angular velocities of a 5-link system
% Input:
% r1,r5: the length of ground and the 5th links.
% R2,R4: radius of the gear pair%
% tha2: angular position of link 2, degrees
% w2: angular velocity of link 2, rad/s
% Output:
% omega:the ang. velocitis of links, rad/s
% theta:the angles of links, degrees
% incta:initial positions of links, degrees
% omega=[omega3 omega4 omega5], in rad/s
% Example [omega,theta,incta]=f5link(8,3,3.5,6,60,10)
d2r=pi/180;th2=tha2*d2r;
r3=R2+R4;
if r3+r5<=r5,
theta='Not available';
incta=0;
return
end
r34=r3+R4;
cos5=(r34*r34-r5*r5-r1*r1)/(2*r1*r5);
cos3=(r1+r5*cos5)/r34;
th50=acos(cos5);
th30=acos(cos3);th40=th30;
incta=[th30 th40 th50]/d2r;
%============================================
% To solve the angular position of each links
rr=R4/R2;
func_1=1; func_2=1;
% Force next WHILE statement to be true
th5=th50;th4=th40;
while abs(func_1)>0.01 | abs(func_2)>0.01,
% Evaluate loop equations
th3=th30+(th2+rr*(th4-th40))/(1+rr);
func_1=r3*cos(th3)+R4*cos(th4)-r5*cos(th5)-r1;
func_2=r3*sin(th3)+R4*sin(th4)-r5*sin(th5);
F=[-func_1; -func_2];
% Evaluate partial derivatives
A=[-r3*sin(th3)*rr-R4*sin(th4) r5*sin(th5);...
r3*cos(th3)*rr+R4*cos(th4) -r5*cos(th5)];
% Solve 2 equations in 2 unknowns with Cramer's rule
delta=A\F;
% Make new guess for both theta3 and theta4
th4=th4+delta(1);
th5=th5+delta(2);
end;
theta=[0 th2 th3 th4 th5]/d2r;
%============================================
% Calculate the angular velocities of links
% Set up the 3x3 maxtrix A
A=[-r3*sin(th3) -R4*sin(th4) r5*sin(th5);...
r3*cos(th3) R4*cos(th4) -r5*cos(th5);...
1+rr -rr 0];
C=[0 0 w2]';
W=A\C; %Matrix division, or solution of AW=C
omega=[w2,W'];



執行例一:


設 r1=8 cm、R2=3 cm、R4=3.5 cm、r5= 6cm,θ2= 60度,ω2=10 rad/s

>> [w,theta,incta]=f5link(8,3,3.5,6,60,10)
w =   10.0000 2.7194 -3.5211 1.8456
theta = 0 60.0000 52.1875 13.8419 95.8522
incta = 36.8699 36.8699 90.0000


故ω3=2.7194 rad/s,ω4= -3.5211 rad/s, ω5= 1.8456 rad/s

執行例二:


設r1=50 cm、R2=12 cm、R4=14 cm、r5= 50cm,θ2= 30度,ω2=10 rad/s

>> [omega ,theta,incta]=f5link(50,12,14,50,30,10)
omega = 10.0000 2.4549 -4.0123 0.4351
theta = 0 30.0000 73.5832 54.0023 133.5048
incta =   66.4218 66.4218 132.8436


故ω3= 2.4549 rad/s,ω4=-4.0123 rad/s, ω5= 0.4351 rad/s

本程式中,實際上綜合f5link_init()函式之內容,並進行作位置解,將公式7.18及7.19利用疊代法求得各桿之對應角度。其後再利公式7.30之矩陣除法求得各桿之角速度。在求解過程中,桿2之角度及角速度均必須為已知值。

No comments:

Post a Comment