function [x,y]=swingrollercam(cth,r0,re,s,a,range,pattern,cw)
其中之輸入參數定義如下:
cth:凸輪角度,度數 r0:凸輪基圓半徑 re:滾子半徑 a:凸輪軸與從動件軸間距 s:從動件衝程 cw:凸輪轉動方向(反時鐘為正,順時鐘為負) pattern = 運動的型式,二元素之列矩陣,其代碼如下: 1:等速運動uniform 2:抛物線parabolic 3:簡諧simple harmonic 4:擺線cycloidal 5:多項式polynomial motion e.g. [4 3]:升程為擺線運動cycloidal;返程為簡諧運動harmonic motion range =升程及返程之範圍,三元素列矩陣 e.g.[90 180 240]升程始於90 度, 止於180度;返程始於240 度,止於360。
程式內容:程式呼叫dwell.m外,尚呼叫 circ.m函數,求得圓之座標。
function [x,y]=swingrollercam(cth,r0,re,s,a,range,pattern,cw) % Find the cam curve for a swing roller as fig. 8.35 %Inputs: % cth:angle of cam, degrees % r0:radius of base circle % re:radius of the roller % a:distance between two axes of cam and roller % A0:initial inclined angle of roller arm, radians % s:stroke % cw:rotation direction of cam(-counterclockwise,+clockwise %pattern = denote the type of motion used(a 3 element-row matrix) % 1:uniform 2:parabolic 3:simple harmonic 4: cycloidal % 5:polynomial motion % example [4 3] %range =the degrees the specific motion starts, eg.[90 180 240] % Example: [x y]=swingrollercam(0:10:360,5,2,2,10,[90 180 240],[4 3],-1) figure(1); clf; th=cth*pi/180; A0=asin(r0/a); m=a*cos(A0); [x0,y0]=circ(re,20); for i=1:length(cth) t=th(i)*cw; B=[cos(t) -sin(t);sin(t) cos(t)]; [ym,yy,yyy]=dwell(cth(i),range,pattern); AA=A0+ym*s/m; Sx=[0 a-m*cos(AA)+x0 a;0 m*sin(AA)+y0 0]; X=B\Sx; x(i)=X(1,2);y(i)=X(2,2); line(X(1,1:2),X(2,1:2)); line(X(1,2:3),X(2,2:3),'linewidth',1.5,'color','red') line([X(1,:) X(1,1)],[X(2,:) X(2,1)]); end hold on; line([0 a a-m*cos(A0) 0],[0 0 m*sin(A0) 0],'linewidth',3,'color','blue') plot([0 x],[0 y],'bo',x,y,'k-') [x,y]=circ(r0,50); plot(x,y,'r-') axis equal function [x,y]=circ(rr,nn) t=0:2*pi/nn:2*pi; x=[0 rr*cos(t) 0];y=[0 rr*sin(t) 0];
執行例
>>[x y]=swingrollercam(0:10:360,5,1,2,8,[90 180 240],[4 3],-1);
No comments:
Post a Comment