How to plot Trajectories of simple mechanism
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi,
I have been trying to find trajectory equation of simple mechanism's motion. As you see from figure below that short links are r, long links are 2r, 60 degree between them and each movement about to 45 degree. I'd like to calculate trajectory from mathematical equation
댓글 수: 0
채택된 답변
Roger Stafford
2016년 9월 24일
The trajectory you speak of is, in effect, one of the two points of intersection of two circles of radius 2*r whose centers are at the respective circumference points of the two circles in your diagram. I gave the solution to such a problem in the ‘Answers’ forum entry at:
http://www.mathworks.com/matlabcentral/answers/105971
In that answer the P1 and P2 for you would be the column vectors of the coordinates of your two circumference points, P1 on the left circle and P2 on the right circle. The solution Q1 which is off to the left side as you move from P1 to P2 would be your desired trajectory point.
댓글 수: 2
Roger Stafford
2016년 9월 25일
Here is code for generating your "trajectory" points. The display here with the plot function may not be what you want, so you’ll have to adjust that according to your needs.
Note that the code provides for the general case where r1 and r2 may be different. In your case they are equal and you could simplify some of the expressions where r1-r2 occurs.
n = 100; % Number of desired points
t1 = linspace(3/4*pi,11/4*pi,n); % Angle on left circle
t2 = linspace(5/4*pi,-3/4*pi,n); % Angle on right circle
R = 1; % Radius of circles
p1 = [-R+R*cos(t1);R*sin(t1)]; % Points on left circle
p2 = [+R+R*cos(t2);R*sin(t2)]; % Points on right circle
r1 = 2*R; r2 = 2*R; % Lengths of connecting bars
Q = zeros(2,n); % Allocate space for “trajectory” points
for k = 1:n
P1 = p1(:,k);
P2 = p2(:,k);
P21 = P2-P1;
d2 = sum((P21).^2);
P0 = (P1+P2)/2+(r1+r2)*(r1-r2)/2/d2*P21;
Q0 = sqrt(((r1+r2)^2-d2)*(d2-(r1-r2)^2))/2/d2*[0,-1;1,0]*P21;
Q(:,k) = P0+Q0; % Get k-th trajectory point at upper intersection
end
plot(p1(1,:),p1(2,:),’w.’,p2(1,:),p2(2,:),’w.’,Q(1,:),Q(2,:),’y.’)
axis equal
추가 답변 (0개)
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!