You are on page 1of 13

Intro to Mechanical Design: HW 2

4.12a.
Repeat Problem 4-11 except solve by the vector loop method. Plot position
of end of link 3 if L3 = 10 for one revolution of crank.

Solution
The green curve shows the trajectory of point P.
Positions of Inverted Slider-Crank for One Revolution of Crank

12

Point A
Point B
Point P

10

y Position

8
6
4
2
0
-2

-4

-2

4
x Position

10

12

A Matlab code that solves the problem is given below.


% Inverted Slider-Crank Linkage Solver
% Uses vector loop approach to solve for positions
% of inverted slider-crank linkage
clear all; close all; clc
a
c
d
p

=
=
=
=

2;
4;
6;
10;

%
%
%
%

Crank length
Rocker length
Distance between pins
Length to point P

theta2 = zeros(361,1); theta3 = zeros(361,1); theta4 = zeros(361,1);


xa = zeros(361,1); ya = zeros(361,1);
xb = zeros(361,1); yb = zeros(361,1);
xp = zeros(361,1); yp = zeros(361,1);
for i = 1:361
theta2(i) = (i-1)*pi/180;
P = a*sin(theta2(i));
Q = a*cos(theta2(i)) - d;
R = -c;
S = R - Q; T = 2*P; U = Q + R;
theta4(i) = 2*atan((-T + sqrt(T^2 - 4*S*U))/(2*S));
theta3(i) = theta4(i) - pi/2;
xa(i) = a*cos(theta2(i));
ya(i) = a*sin(theta2(i));
xb(i) = c*cos(theta4(i)) + d;
yb(i) = c*sin(theta4(i));
xp(i) = xa(i) + p*cos(theta3(i)); yp(i) = ya(i) + p*sin(theta3(i));
end
figure; hold on; axis([-2 10 -2 12]); grid on; axis equal
plot(xa,ya,'LineWidth',2,'Color','b')
plot(xb,yb,'LineWidth',2,'Color','r')
plot(xp,yp,'LineWidth',2,'Color','g')
plot([0 xa(30) xb(30) d],[0 ya(30) yb(30) 0],'LineWidth',5,'Color','k')
title('Positions of Inverted Slider-Crank for One Revolution of Crank')
legend('Point A','Point B','Point P')
xlabel('x Position'); ylabel('y Position')

Problem 4.20
Figure P4-7 shows a power hacksaw, used to cut metal. Link 5 pivots at O5
and its weight forces the sawblade against the workpiece while the linkage
moves the blade (link 4) back and forth on link 5 to cut the part. It is an
offset crank-slider mechanism. The dimensions are shown in the figure.
For one revolution of driving link 2 of the hacksaw mechanism on the
cutting stroke, find and plot the horizontal stroke of the sawblade as a
function of the angle of link 2.

Solution
The plot of the position of the hacksaw blade as a function of crank angle is
shown below.
Position of Hacksaw Blade for One Revolution of Crank
240

Point B

220

y Position (mm)

200
180
160
140
120
100
80
0

60

120

180
240
Crank Angle (deg)

300

360

The Matlab code necessary to solve the problem is shown below.


% Offset Slider-Crank Linkage Solver
% Uses vector loop approach to solve for positions
% of offset slider-crank linkage
clear all; close all; clc

a = 75;
b = 170;
c = 45;

% Crank length (mm)


% Coupler length (mm)
% Offset of slider (mm)

theta2 = zeros(361,1); theta3 = zeros(361,1);


xa = zeros(361,1); ya = zeros(361,1);
d = zeros(361,1);
for i = 1:361
theta2(i) = (i-1)*pi/180;
theta3(i) = asin((c - a*sin(theta2(i)))/b);
d(i) = a*cos(theta2(i)) + b*cos(theta3(i));
xa(i) = a*cos(theta2(i));

ya(i) = a*sin(theta2(i));

end
figure; hold on; axis([0 360 75 250]); grid on
set(gca,'XTick',0:60:360)
plot(theta2*180/pi,d,'LineWidth',2,'Color','b')
title('Position of Hacksaw Blade for One Revolution of Crank')
legend('Point B')
xlabel('Crank Angle (deg)'); ylabel('y Position (mm)')

Problem 4.22
For the walking-beam mechanism of Figure P4-9, calculate and plot the x
and y components of the position of the coupler point P for one complete
revolution of the crank O2A. Hint: Calculate them first with respect to the
ground link O2O4, and then transform them into the global XY coordinate
system (i.e., horizontal and vertical in the figure). Scale the figure for any
additional information needed.

Solution
We calculate the positions of point P in the usual way, noting that we use
the positive solutions for 3 and 4

B+ B24 AC
tan 4 =
2
2A

( )

tan

3 E+ E 24 DF
=
2
2D

( )

instead of the negative solutions we used earlier. The angle between O2O4
and horizontal is found by measuring its horizontal distance in the diagram,
which is 1. The crank length is given as 1, but its length in the diagram is
0.5, so we obtain a scaling factor of 2. The angle between O2O4 and
horizontal is then
2
=cos1
=25.72
2.22
The transformation between the local and global coordinate systems is
accomplished through
'
'
x=x cos y sin
'

'

y=x sin + y cos


A plot of the displacement of point P is given below.
useful plotting techniques are shown in the code!

Note that several

2.5

Positions of Fourbar Walking Beam Mechanism for one Rev of Crank


Coupler
Point A
Point B
Point P

2
1.5

y Position

1
0.5
0
-0.5
-1
-1.5
-2
-2.5

-1

x Position

% Fourbar Linkage Solver


% Uses vector loop approach to solve for positions
% of fourbar linkage.
clear all; close all; clc
a = 1;
% Crank length
b = 2.06; % Coupler length
c = 2.33; % Rocker length
d = 2.22; % Distance between pins
p = 3.06; % Length to point P
delta = 31*pi/180; % angle to point P
beta = acos(2.0/d); % angle of O2O4 from horizontal
K1 = d/a; K2 = d/c; K3 = (a^2 - b^2 + c^2 + d^2)/(2*a*c);
K4 = d/b;
K5 = (c^2 - d^2 - a^2 - b^2)/(2*a*b);
theta2 = zeros(361,1);
theta3 = zeros(361,1);
theta4 = zeros(361,1);
xa = zeros(361,1); ya = zeros(361,1);
xb = zeros(361,1); yb = zeros(361,1);
xp = zeros(361,1); yp = zeros(361,1);
xbp = zeros(361,1); ybp = zeros(361,1);
xpp = zeros(361,1); ypp = zeros(361,1);
xap = zeros(361,1); yap = zeros(361,1);
for i = 1:361
theta2(i) = (i-1)*pi/180;
A = K3 - K1 - (K2 - 1)*cos(theta2(i));
B = -2 * sin(theta2(i));
C = K3 + K1 - (K2 + 1)*cos(theta2(i));
D = K5 - K1 + (K4 + 1)*cos(theta2(i));
E = B;
F = K5 + K1 + (K4 - 1)*cos(theta2(i));
theta3(i) = 2*atan((-E + sqrt(E^2 - 4*D*F))/(2*D));
theta4(i) = 2*atan((-B + sqrt(B^2 - 4*A*C))/(2*A));
xa(i) = a*cos(theta2(i));
ya(i) = a*sin(theta2(i));

xb(i) = c*cos(theta4(i)) + d;
yb(i) = c*sin(theta4(i));
xp(i) = xa(i) + p*cos(theta3(i)+delta);
yp(i) = ya(i) + p*sin(theta3(i)+delta);
% Transform
xap(i) =
yap(i) =
xbp(i) =
ybp(i) =
xpp(i) =
ypp(i) =
end

coordinates into new frame


xa(i)*cos(beta) - ya(i)*sin(beta);
xa(i)*sin(beta) + ya(i)*cos(beta);
xb(i)*cos(beta) - yb(i)*sin(beta);
xb(i)*sin(beta) + yb(i)*cos(beta);
xp(i)*cos(beta) - yp(i)*sin(beta);
xp(i)*sin(beta) + yp(i)*cos(beta);

ang = 300;
figure; hold on; axis([-2 3 -2.5 2.5]); grid on; axis equal
patch([xap(ang) xbp(ang) xpp(ang)],[yap(ang) ybp(ang) ypp(ang)],[0.9 1 1])
plot(xa,ya,'LineWidth',2,'Color','b')
plot(xbp,ybp,'LineWidth',2,'Color','r')
plot(xpp,ypp,'LineWidth',3,'Color','m')
legend('Coupler','Point A','Point B','Point P')
xlabel('x Position'); ylabel('y Position')
title('Positions of Fourbar Walking Beam Mechanism for one Rev of Crank')
plot([0 xap(ang) xbp(ang) d*cos(beta)],...
[0 yap(ang) ybp(ang) d*sin(beta)],'LineWidth',2,'Color','k')
plot(0,0,'o','Markersize',10,'MarkerFaceColor','k','Color','k')
plot(d*cos(beta),d*sin(beta),'o','Markersize',10,...
'MarkerFaceColor','k','Color','k')

Problem 4.23
For the linkage in Figure P4-10, calculate and plot the angular displacement
of links 3 and 4 and the path coordinates of point P with respect to the
angle of the input crank O2A for one revolution.

Solution
This is an ordinary fourbar linkage, so we can use the program given in
class to calculate its position. In fact, its dimensions are the same as for
problem 4.22, so much of the program will remain unchanged.
Positions of Fourbar Linkage for one Rev of Crank

3.5
3
2.5

y Position

2
1.5
1
0.5
0
Coupler
Point A
Point B
Point P

-0.5
-1
-1.5

-1

1
x Position

Angle of Links 3 and 4 for one Rev of Crank

200

Link 3
Link 4

180

Angle of Link 3 and 4 (deg)

160
140
120
100
80
60
40
20
0

60

120

180
240
Crank Angle (deg)

300

360

Below is a Matlab program that will perform the necessary calculations and
create the desired plots.
% Fourbar Linkage Solver
% Uses vector loop approach to solve for positions
% of fourbar linkage.
clear all; close all; clc
a = 1;
% Crank length
b = 2.06; % Coupler length
c = 2.33; % Rocker length
d = 2.22; % Distance between pins
p = 3.06; % Length to point P
delta = -31*pi/180; % angle to point P
K1 = d/a; K2 = d/c; K3 = (a^2 - b^2 + c^2 + d^2)/(2*a*c);
K4 = d/b;
K5 = (c^2 - d^2 - a^2 - b^2)/(2*a*b);
theta2 = zeros(361,1);
theta3 = zeros(361,1);
theta4 = zeros(361,1);
xa = zeros(361,1); ya = zeros(361,1);
xb = zeros(361,1); yb = zeros(361,1);
xp = zeros(361,1); yp = zeros(361,1);
for i = 1:361
theta2(i) = (i-1)*pi/180;
A = K3 - K1 - (K2 - 1)*cos(theta2(i));
B = -2 * sin(theta2(i));
C = K3 + K1 - (K2 + 1)*cos(theta2(i));
D = K5 - K1 + (K4 + 1)*cos(theta2(i));
E = B;
F = K5 + K1 + (K4 - 1)*cos(theta2(i));
theta3(i) = 2*atan((-E - sqrt(E^2 - 4*D*F))/(2*D));
theta4(i) = 2*atan((-B - sqrt(B^2 - 4*A*C))/(2*A));
xa(i) = a*cos(theta2(i));

ya(i) = a*sin(theta2(i));
xb(i) = c*cos(theta4(i)) + d;
yb(i) = c*sin(theta4(i));
xp(i) = xa(i) + p*cos(theta3(i)+delta);
yp(i) = ya(i) + p*sin(theta3(i)+delta);
end
ang = 60;
figure; hold on; axis([-2 3 -1.5 3.5]); grid on; axis equal
patch([xa(ang) xb(ang) xp(ang)],[ya(ang) yb(ang) yp(ang)],[0.9 1 1])
plot(xa,ya,'LineWidth',2,'Color','b')
plot(xb,yb,'LineWidth',2,'Color','r')
plot(xp,yp,'LineWidth',3,'Color','m')
legend('Coupler','Point A','Point B','Point P')
xlabel('x Position'); ylabel('y Position')
title('Positions of Fourbar Linkage for one Rev of Crank')
plot([0 xa(ang) xb(ang) d],...
[0 ya(ang) yb(ang) 0],'LineWidth',2,'Color','k')
plot(0,0,'o','Markersize',10,'MarkerFaceColor','k','Color','k')
plot(d,0,'o','Markersize',10,...
'MarkerFaceColor','k','Color','k')
figure
hold on; axis([0 360 0 200]); grid on
set(gca,'XTick',0:60:360)
plot(theta3*180/pi,'LineWidth',2,'Color','m')
plot(theta4*180/pi,'LineWidth',2,'Color','b')
title('Angle of Links 3 and 4 for one Rev of Crank')
xlabel('Crank Angle (deg)'); ylabel('Angle of Link 3 and 4 (deg)')
legend('Link 3','Link 4')

10

Problem 4.25
For the linkage in Figure P4-12, find its limit (toggle) positions in terms of
the angle of link O2A referenced to the line of centers O2O4 when driven
from link O2A. Then calculate and plot the angular displacement of links 3
and 4 and the path coordinates of point P between those limits, with respect
to the angle of the input crank O2A over its possible range of motion
referenced to the line of centers O2O4.

Solution
Other than the fact that the linkage is not Grashof, this problem is similar to
the preceding two exercises. The first problem will be to find the two toggle
positions. These are shown in the figure below:
b

c
a

2
d

We can use the law of cosines to calculate the extreme values of 2.


cos 2 =

a 2+ d 2( c +b )2 0.7852 +0.5442 ( 0.356+0.950 )2


=
=0.929
2 ad
2

2 =

a + d ( c +b ) 0.785 + 0.544 ( 0.9500.356 )


=
=0.655
2 ad
2
cos

2=158.3

=49.1

Thus, we will do the calculations between 49.1 and 158.3. To keep the
Matlab code simple, let us round to the range 50 and 158.

11

Positions of Fourbar Linkage for one Rev of Crank

1.8

Point A
Point B
Point P

1.6
1.4

140
Angle of Link 3 and 4 (deg)

y Position

Link 3
Link 4

160

1.2
1
0.8
0.6
0.4

120
100

0.2

80
60
40
20

0
-0.2

Angle of Links 3 and 4 for one Rev of Crank

180

-1

-0.5

x Position

0.5

-20
50

60

70

80

90
100
110 120
Crank Angle (deg)

130

140

150

% Fourbar Linkage Solver


% Uses vector loop approach to solve for positions
% of fourbar linkage.
clear all; close all; clc
a
b
c
d
p

=
=
=
=
=

0.785;
0.356;
0.950;
0.544;
1.090;

%
%
%
%
%

Crank length
Coupler length
Rocker length
Distance between pins
Length to point P

K1 = d/a; K2 = d/c; K3 = (a^2 - b^2 + c^2 + d^2)/(2*a*c);


K4 = d/b;
K5 = (c^2 - d^2 - a^2 - b^2)/(2*a*b);
theta2min = 50;
theta2max = 158;
theta2ran = theta2max theta2 = zeros(109,1);
theta3 = zeros(109,1);
theta4 = zeros(109,1);
xa = zeros(109,1); ya =
xb = zeros(109,1); yb =
xp = zeros(109,1); yp =

theta2min;

zeros(109,1);
zeros(109,1);
zeros(109,1);

for i = 1:theta2ran + 1
theta2(i) = (i+theta2min - 1)*pi/180;
A = K3 - K1 - (K2 - 1)*cos(theta2(i));
B = -2 * sin(theta2(i));
C = K3 + K1 - (K2 + 1)*cos(theta2(i));
D = K5 - K1 + (K4 + 1)*cos(theta2(i));
E = B;
F = K5 + K1 + (K4 - 1)*cos(theta2(i));
theta3(i) = 2*atan((-E - sqrt(E^2 - 4*D*F))/(2*D));
theta4(i) = 2*atan((-B - sqrt(B^2 - 4*A*C))/(2*A));
xa(i) = a*cos(theta2(i));
ya(i) = a*sin(theta2(i));
xb(i) = c*cos(theta4(i)) + d;
yb(i) = c*sin(theta4(i));
xp(i) = xa(i) + p*cos(theta3(i));
yp(i) = ya(i) + p*sin(theta3(i));
end

12

figure; hold on; axis([-1 1.5 -0.2 1.8]); grid on; axis equal
plot(xa,ya,'LineWidth',2,'Color','b')
plot(xb,yb,'LineWidth',2,'Color','r')
plot(xp,yp,'LineWidth',3,'Color','m')
legend('Point A','Point B','Point P','Location','Northwest')
xlabel('x Position'); ylabel('y Position')
title('Positions of Fourbar Linkage for one Rev of Crank')
ang = 1;
plot([0 xa(ang) xb(ang) d],[0 ya(ang) yb(ang) 0],'LineWidth',2,'Color','k')
plot([xa(ang) xp(ang)],[ya(ang) yp(ang)],'LineWidth',3,'Color','k')
plot(0,0,'o','Markersize',10,'MarkerFaceColor','k','Color','k')
plot(d,0,'o','Markersize',10,'MarkerFaceColor','k','Color','k')
ang = theta2ran+1;
plot([0 xa(ang) xb(ang) d],[0 ya(ang) yb(ang) 0],'LineWidth',2,'Color','g')
plot([xa(ang) xp(ang)],[ya(ang) yp(ang)],'LineWidth',3,'Color','g')
figure
hold on; axis([theta2min theta2max -20 180]); grid on
plot(theta2*180/pi,theta3*180/pi,'LineWidth',2,'Color','m')
plot(theta2*180/pi,theta4*180/pi,'LineWidth',2,'Color','b')
title('Angle of Links 3 and 4 for one Rev of Crank')
xlabel('Crank Angle (deg)'); ylabel('Angle of Link 3 and 4 (deg)')
legend('Link 3','Link 4','Location','Northwest')

13

You might also like