2007年5月29日 星期二

第十一次作業

我有上本週(5/24)的課。


P11-1


◎某凸輪開始時先在0-100∘區間滯留,然後提升後在200至260∘區間滯留,其高度(衝程)為5公分,其餘由260∘至360∘則為返程。升程採用等加速度運動,返程之運動型式自定。設刻度區間為10°,試繪出其高度、速度及加速度與凸輪迴轉角度間之關係。



利用function plot_dwell(ctheta,s,pattern,range)
%ctheta = 凸輪角度,度數
%s = 從動件衝程
%pattern = 運動的型式,二元素之列矩陣,其代碼如下:
% 1:等速運動uniform
% 2:抛物線parabolic
% 3:簡諧simpleharmonic
% 4:擺線cycloidal
% 5:多項式polynomial motion
%range = 升程及返程之範圍,三元素列矩陣
% e.g.[90 180 240]升程始於90度,止於180度;返程始
% 於240 度,止於360。



返程為等速運動

>> plot_dwell([0:10:360],5,[2 1],[100 260 260]);




返程為等加速度運動

>> plot_dwell([0:10:360],5,[2 2],[100 260 260]);




返程為簡諧運動

>> plot_dwell([0:10:360],5,[2 3],[100 260 260]);




返程為擺線運動

>> plot_dwell([0:10:360],5,[2 4],[100 260 260]);




返程為多項式運動

>> plot_dwell([0:10:360],5,[2 5],[100 260 260]);





P11-2

◎設凸輪之半徑為15公分,以順時針方向旋轉,其從動件為梢型,垂直接觸,長為10公分,從動件之運動係依照第二項之運動型式。試繪出此凸輪之工作曲線。


利用function [x,y]=pincam(cth,r0,s,e,L,range,pattern,cw)


%輸入參數:
%cth = 凸輪角度,度數
%r0 = 凸輪基圓半徑
%s = 從動件衝程
%e = 偏置量
%L = 從動件長度
%range = 升程及返程之範圍,三元素列矩陣
% e.g.[90 180 240]升程始於90度,止於180度;返程
% 於240 度,止於360。
%pattern = 運動的型式,二元素之列矩陣,其代碼如下:
% 1:等速運動uniform
% 2:抛物線parabolic
% 3:簡諧simpleharmonic
% 4:擺線cycloidal
% 5:多項式polynomial motion
%cw = 凸輪轉動方向(反時鐘為正,順時鐘為負)



>> [x y]=pincam([0:10:360],15,5,0,10,[100 260 260],[2 3],-1);




◎要讓凸輪產生迴轉,我將函式pincam稍作修改如下:


function [x,y]=pincam_rotate(cth,r0,s,e,L,range,pattern,cw)
%Find the pin type cam with an offsect e
%Inputs:
% cth:angle of cam, degrees
% r0:radius of base circle
% e:offset
% s:stroke
% L:length of pin
% 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]=pincam([10 60],5,2,1,10,[90 180 240],[4 3],-1)

figure(1);
clf;
th=cth*pi/180;
s0=sqrt(r0*r0-e*e);

for n=1:10:360;
m=n*pi/180;
for i=1:length(cth)
t=th(i)*cw;
A=[cos(t-m) -sin(t-m);sin(t-m) cos(t-m)];
[ym,yy,yyy]=dwell(cth(i),range,pattern);
x0=s0+ym*s;
Sx=[0 x0 x0+L;e e e];
X=A\Sx;
x(i)=X(1,2);y(i)=X(2,2);
end;
line(X(1,1:2),X(2,1:2));
line(X(1,2:3),X(2,2:3),'linewidth',3,'color','red')
hold on;
plot([0 x],[0 y],'ro',x,y,'k-')
pause(0.5);
clf;
axis([-50 50 -50 50]);
end;




假設返程為簡諧運動

>> [x y]=pincam_rotate([0:10:360],15,5,0,10,[100 260 260],[2 3],-1);


沒有留言: