Department of Mechanical Engineering University of Bahrain
MENG373 Kinematics and Dynamics of Machines
KINEMATIC ANALYSIS OF PLANAR MECHANISMS
Page | 1
Page | 2
Page | 3
Page | 4
Page | 5
SLIDER-CRANK MECHANISM:
An application example is the slider-crank mechanism in an internal combustion engine.
The motion from piston 4 is transferred through connecting rod 3 to crank 2, which
rotates the crankshaft. This is a diesel engine, which means that one cycle,
combustion–exhaust–intake–compression, comprises two complete crank revolutions. If
all components of the cycle are equal in duration, then each will take 180°. In other
words, the stroke of the engine, the piston motion from its maximum upper position to its
lowest position, should correspond to 180° of the crank rotation. This is a kinematic
requirement of the mechanism. Another kinematic requirement is that the swing of the
connecting rod be such that it does not interfere with the walls of the cylinder. There are
other design requirements affecting kinematic and dynamic analysis: link dimensions
and shape. If one starts from point O and continues through points A and B, one will
come back again to O. The system of vectors thus makes a loop. The mathematical
representation of this requirement is that the sum of all vectors in the loop must be
equal to zero, i.e.,
FIGURE 2.5 Skeleton of slider-crank mechanism (a) and its vector representation (b).
Since each vector can be represented in the form:
Page | 6
Equation 2.12 becomes:
Now the problem is reduced to solving Equation 2.14. Equation 2.14 may be solved
using Newton Raphson method (MATLAB Command Window “ fsolve”).
Slider Crank Mechanism Example
Consider the slider crank mechanism shown in figure 2.5 above where:
th1=pi;r2= 20;r3=80;
plot the relationship between r1 versus th2 and th3 versus th2 for a complete
rotation of r2.
Plot the configuration diagrams for a complete rotation of r2.
Develop a movie for the system
Page | 7
Numerical Example(Slider Crank Mechanism)
%data x(1)=r1;x(2)=th3;
c=pi/180;
th1=pi;r2= 20;r3=80;
roots(1)=100;roots(2)=0;
th2=[0:10:360]*c;
n=length(th2);
for I=1:n
f=@(x)([x(1)*cos(th1)+r2*cos(th2(I))+r3*cos(x(2));...
x(1)*sin(th1)+r2*sin(th2(I))+r3*sin(x(2))]);
120
x(1)=roots(1);x(2)=roots(2); r1
th3
100
roots=fsolve(f,x)
80
r1(I)=roots(1); th3(I)=roots(2);
r1 & 3 deg
60
end
40
plot(th2/c,r1,'r',th2/c,th3/c,'b');grid;
20
xlabel('crank angle deg');
0
ylabel('r1 & \theta 3 deg');
-20
legend('r1','th3'); 0 50 100 150 200 250 300 350 400
crank angle deg
%Configuration diag
A0x=zeros(1,n);A0y=zeros(1,n);
Ax=r2*cos(th2);Ay=r2*sin(th2);
Bx=r1;By=zeros(1,n);
X=[A0x; Ax; Bx; A0x];Y=[A0y; Ay; By; A0y];
Page | 8
figure;plot(X,Y);grid; xlabel('x');ylabel('y');
axis('square');axis([-40 100 -70 70]); 60
figure; 40
for j=1:n 20
0
A0x =0; A0y=0;
y
-20
Ax =r2*cos(th2(j));Ay=r2*sin(th2(j));
-40
Bx=r1(j); By=0;
-60
XX=[A0x;Ax;Bx;A0x];
-40 -20 0 20 40 60 80 100
x
YY=[A0y;Ay;By;A0y]
plot(XX,YY);grid; axis('square'); 60
axis([-40 100 -70 70]); 40
M(j) = getframe;
20
end
0
y
xlabel('x'); ylabel('y');
-20
movie(M,5)
-40
-60
-40 -20 0 20 40 60 80 100
x
60
40
20
0
y
-20
-40
Page | 9
-60
-40 -20 0 20 40 60 80 100
x
Four-Bar Mechanism
Consider the four bar mechanism shown in Fig. 4.3 below:
Consider the loop closure associated with fig. 4.3(c). Equations 4.2-2 will be considered
in the following numerical example.
Page | 10
Four Bar Mechanism Example 1
th1= 0, r1 = 30 , r2 = 10 , r3 = 35 , r4 = 20
plot the relationship between th3 versus th2 and th4 versus th2 for a complete
rotation of r2.
Plot the configuration diagrams for a complete rotation of r2.
Develop a movie for the system
140
%data x(1)=th3;x(2)=th4; 3
120 4
clear all
100
c=pi/180;
3 & 4 deg
th1=0;r1=30;r2=10;r3=35;r4=20; 80
rP=r3/2;alfa=0/c; %Point P
60
roots(1)=40*c;%roots(1)=x(1)=th3 40
roots(2)=60*c;%roots(2)=x(2)=th4
th2=[0:10:(360)]*c; 20
n=length(th2); 0
0 100 200 300 400
crank angle deg
for I=1:n;
f=@(x)([r1*cos(th1)-r2*cos(th2(I))-r3*cos(x(1))+r4*cos(x(2));...
r1*sin(th1)-r2*sin(th2(I))-r3*sin(x(1))+r4*sin(x(2))]);
x(1)=roots(1);x(2)=roots(2);
roots=fsolve(f,x)
th3(I)=roots(1);
th4(I)=roots(2);
end 40
rP=r3/2;alfa=0/c;
figure;
plot(th2/c,th3/c,'r',th2/c,th4/c,'b');
Point P
grid;xlabel('crank angle deg'); 20
y
ylabel('\theta_3 & \theta_4 deg');
legend('\theta_3','\theta_4');
%Configuration diag
th1=th1*ones(1,n); 0
A0x=zeros(1,n);A0y=zeros(1,n);
B0x=r1*cos(th1);B0y=r1*sin(th1);
Ax=r2*cos(th2);Ay=r2*sin(th2); 0 20 40
% A0A+AB=r2+r3;To Get Coordinates of Point B
Bx=Ax+r3*cos(th3);By=Ay+r3*sin(th3); x
%Trajectory of point P
Px=Ax+rP*cos(th3+alfa);Py=Ay+rP*sin(th3+alfa);
X=[A0x; Ax; Bx;B0x; A0x];Y=[A0y; Ay; By;B0y;A0y];
Page | 11
figure;plot(X,Y);grid;
xlabel('x');
ylabel('y');
axis('square');
axis([-(r1+r2)/3 r1+r2+r3/3 -(r1+r2)/3 r1+r2+r3/3]);
hold on; plot(Px,Py,'P'); %Trajectory of point P
figure;
for j=1:n;
A0x =0; A0y=0;
B0x =r1*cos(th1(j));B0y=r1*sin(th1(j));
Ax =r2*cos(th2(j));Ay=r2*sin(th2(j));
% A0A+AB=r2+r3;To Get Coordinates of Point B
Bx=Ax+r3*cos(th3(j));By=Ay+r3*sin(th3(j));
XX=[A0x;Ax;Bx;B0x;A0x];
YY=[A0y;Ay;By;B0y;A0y];
plot(XX,YY);grid;
axis([-(r1+r2)/3 r1+r2+r3/3 -(r1+r2)/3 r1+r2+r3/3]);
M(j) = getframe; 50
end
xlabel('x'); 40
ylabel('y');
movie(M,5) 30
20
y
10
-10
0 20 40
x
Page | 12
Four Bar Mechanism Example 2
th1= 0, r1 = 30 , r2 = 10 , r3 = 35 , r4 = 20
plot the relationship between th3 versus th2 and th4 versus th2 for a complete
rotation of r2.
plot the relationship between ω3 versus th2 and ω4 versus th2 for a complete
rotation of r2.
plot the relationship between α3 versus th2 and α4 versus th2 for a complete
rotation of r2.
Plot the configuration diagrams for a complete rotation of r2.
Develop a movie for the system
%data x(1)=th3;x(2)=th4;
clear all;
c=pi/180;
th1=0;r1= 8;r2=3.5;r3=10;r4=9;th1=0;
w2=36;
% Guess th3=20;th4=60;
rP=r3*5;alfa=0/c;%Point P
roots(1)=20*c;%roots(1)=x(1)=th3
roots(2)=60*c;%roots(2)=x(2)=th4
th2=[0:10:(360)]*c;
n=length(th2);
for I=1:n;
f=@(x)([r1*cos(th1)-r2*cos(th2(I))-r3*cos(x(1))+r4*cos(x(2));...
r1*sin(th1)-r2*sin(th2(I))-r3*sin(x(1))+r4*sin(x(2))]);
x(1)=roots(1);x(2)=roots(2);
roots=fsolve(f,x)
th3(I)=roots(1);
th4(I)=roots(2);
end
figure;
plot(th2/c,th3/c,'r',th2/c,th4/c,'b');grid;
xlabel('crank angle deg');
ylabel('\theta_3 & \theta_4 deg');
legend('\theta_3','\theta_4');
Page | 13
%Velocity:w3=u(1);w4=u(2);
vroots(1)=0;%vroots(1)=u(1)=w3
vroots(2)=0;%vroots(2)=u(2)=w4
for II=1:n;
fvel=@(u)([-r2*w2*sin(th2(II))-
r3*u(1)*sin(th3(II))+r4*u(2)*sin(th4(II));...
r2*w2*cos(th2(II))+r3*u(1)*cos(th3(II))-
r4*u(2)*cos(th4(II))]);
u(1)=vroots(1);u(2)=vroots(2);
vroots=fsolve(fvel,u)
w3(II)=vroots(1);
w4(II)=vroots(2);
end
figure;
plot(th2/c,w3,'r',th2/c,w4,'b');grid;
xlabel('crank angle deg');
ylabel('\omega_3 & \omega_4 deg');
legend('\omega_3','\omega_4');
%acceleration:a3=acc(1);a4=acc(2);
aroots(1)=20;%aroots(1)=acc(1)=a3
aroots(2)=50;%aroots(2)=acc(2)=a4
for III=1:n;
facc=@(acc)([-r2*w2^2*cos(th2(III))-
r3*(acc(1)*sin(th3(III))+w3(III)^2*cos(th3(III)))+r4*(acc(2)*sin
(th4(III))+w4(III)^2*cos(th4(III)));...
-r2*w2^2*sin(th2(III))+r3*(acc(1)*cos(th3(III))-
w3(III)^2*sin(th3(III)))-r4*(acc(2)*cos(th4(III))-
w4(III)^2*sin(th4(III)))]);
acc(1)=aroots(1);acc(2)=aroots(2);
aroots=fsolve(facc,acc)
a3(III)=aroots(1);
a4(III)=aroots(2);
end
figure;
plot(th2/c,a3,'r',th2/c,a4,'b');grid;
xlabel('crank angle deg');
ylabel('\alpha_3 & \alpha_4 deg');
legend('\alpha_3','\alpha_4');
%Configuration diag
th1=th1*ones(1,n);
A0x=zeros(1,n);A0y=zeros(1,n);
B0x=r1*cos(th1);B0y=r1*sin(th1);
Page | 14
Ax=r2*cos(th2);Ay=r2*sin(th2);
% A0A+AB=r2+r3;To Get Coordinates of Point B
Bx=Ax+r3*cos(th3);By=Ay+r3*sin(th3);
%Trajectory of point P
Px=Ax+rP*cos(th3+alfa);Py=Ay+rP*sin(th3+alfa);
X=[A0x; Ax;Px;Bx;B0x; A0x];Y=[A0y; Ay;Py;By;B0y;A0y];
figure;plot(X,Y);grid;
xlabel('x');
ylabel('y');
axis('square'); axis([-(r1+r2)/3 r1+r2+r3*5 -(r1+r2)/3
r1+r2+r3*5]);
hold on;
plot(Px,Py,'P')%Trajectory of point P
figure;
for j=1:n
A0x =0;A0y=0;
B0x=r1*cos(th1(j));B0y=r1*sin(th1(j));
Ax =r2*cos(th2(j));Ay=r2*sin(th2(j));
% A0A+AB=r2+r3;To Get Coordinates of Point B
Bx=Ax+r3*cos(th3(j));By=Ay+r3*sin(th3(j));
XX=[A0x;Ax;Bx;B0x;A0x];
YY=[A0y;Ay;By;B0y;A0y];
plot(XX,YY);grid;
axis('square');
axis([-(r1+r2)/3 r1+r2+r3/3 -(r1+r2)/3 r1+r2+r3/3]);
M(j) = getframe;
end
xlabel('x');
ylabel('y');
movie(M,5)
140
3
120 4
100
& deg
4
80
3
60
40
20
0 100 200 300 400
crank angle deg
Page | 15
20
3
10
4
3 & 4 deg
-10
-20
-30
-40
0 100 200 300 400
crank angle deg
2000
3
1000 4
& deg
4
0
3
-1000
-2000
0 100 200 300 400
crank angle deg
60
50
40
30
y
20
10
0
0 20 40 60
x
Page | 16
10
y
5
0 5 10
x
Page | 17
Sample Quizzes & Tests
Sample 1
1 Compute the mobility and show its significance for the QRM shown below
3 marks
2 Draw the Right Hand Side Limiting Position 7 marks
Page | 18
Sample 2
For the mechanism shown in figure solve Questions 1 and 2:
Question 1 5 Marks
1.1 Determine the mobility of the mechanism and explain its significance 3 points
𝜔2
1.2 Draw the mechanism to a suitable scale for 2 = 60 deg 2 Marks
from which determine AB3= r3 and 3
Page | 19
Sample 2 Solution
Question 1 5 Marks
1.1 Determine the mobility of the mechanism and explain its significance
3 points
𝜔2
n=4, jL = 4 (3 R + 1 P) , jH = 0
m = 3(n-1) - 2jL – 1jH = 1
1.2 Draw the mechanism to a suitable scale for 2 = 60 deg 2 Marks
from which determine AB3= r3 and 3
A
AB3= r3 = 10.6 cm
3 = 310 deg
Page | 20
Page | 21
Solution using complex numbers
>> c=pi/180;r2=6;th2=60*c; r1y=3;th1y=270*c;
>> r1x=10;th1x=0; r3=-r2*exp(i*th2)+r1y*exp(i*th1y)+r1x*exp(i*th1x)
r3 = 7.0000 - 8.1962i
>> th3=angle(r3)/c=th3 = -49.5007
>> r1mag=abs(r3)=r1mag = 10.7785
Solutions of equations (2), (3), (4) and (5)
clear all
c=pi/180;
r2= 6;w2=10;r1x=10;r1y=-3;
th2=[60]*c;
f=@(x)([r2*cos(th2)+x(1)*cos(x(2))-r1x;...
r2*sin(th2)+x(1)*sin(x(2))-r1y]);
% x(1)=r3;x(2)=th3;
x(1)=8;x(2)=300*c;%guess values
roots=fsolve(f,x)
Page | 22
r3=roots(1)
th3=roots(2)
%th3=th3/c
%Velocity v(1)=dr3/dt, v(2)=w3
fv=@(v)([-r2*w2*sin(th2)+v(1)*cos(th3)-r3*v(2)*sin(th3);...
r2*w2*cos(th2)+v(1)*sin(th3)+r3*v(2)*cos(th3)]);
v(1)=5;v(2)=5;
rootsv=fsolve(fv,v)
%roots = [10.7785 5.4192] =[r3 th3] Answer
%rootsv = [56.5582 1.8582] =[d(r3)/dt d(th3)/dt] Answer
Sample 3
Question 1 13 marks
A four bar linkage A0 ABB0 having crank A0 A, coupler AB and follower BB0. Point C is located
on the coupler AB. When the crank A0 A rotates 360 deg CCW, the follower B0B oscillates
(rocks) about the revolute joint B0. The trajectories of points A, C and B are shown in the figure
below.
1.1 In the figure below, draw the mechanism at its extreme positions showing A0 A’B’B0 and
A0 A’’B’’B0 . Obtain the corresponding crank angles.
Locate point C at these positions. 7 marks
Page | 23
50
40
30
B trajectory
C trajectory
y-mms
20
A tajectory
10
0
A0
-10
-20
-20 -10 0 10 20 30 40 50 60
x-mms
1.2 Compute the time ratio 3 marks
1.3 Draw the mechanism for θ2=45 deg and determine θ4
Locate point C for θ2=45 deg 3 marks
Page | 24
50
40
30
B trajectory
C trajectory
y-mms
20
A tajectory
10
0
A0
-10
-20
-20 -10 0 10 20 30 40 50 60
x-mms
Sample 3 Solution (partial)
Question 1 13 marks
A four bar linkage A0 ABB0 having crank A0 A, coupler AB and follower BB0. Point C is located
on the coupler AB. When the crank A0 A rotates 360 deg CCW, the follower B0B oscillates
(rocks) about the revolute joint B0. The trajectories of points A, C and B are shown in the figure
below.
1.1 In the figure below, draw the mechanism at its extreme positions showing A0 A’B’B0 and
A0 A’’B’’B0 . Obtain the corresponding crank angles.
Locate point C at these positions. 7 marks
Page | 25
50
40
30
B trajectory
C trajectory
y-mms
20
A tajectory B''
B'
C'
10
C''
A'
0
A0 B0
A''
-10
-20
-20 -10 0 10 20 30 40 50 60
x-mms
1.2 Compute the time ratio 3 marks
Four Bar Mechanism
TR = Angle A’A0A’’/(360- 60Angle A’A0A’’) ≥ 1
50
1.3 Draw the mechanism for θ2=45 deg and determine θ4
Locate point C 40 3 marks
>> [th2' th4']/c1 30
ans =
y-axis
20
45.0000 57.8079
117.0000 93.8089 10
189.0000 -239.0113
261.0000 -240.8986 0
333.0000 -282.4799
405.0000 57.8079 -10
-20
-20 -10 0 10 20 30 40 50 60
x-axis
You may use the drawing tools.
Page | 26
Sample 4
For the mechanism shown in figure, determine
a The closure equation
2 Marks
b The angular displacement of link 3, 𝜃3 and the displacement of point D, r1.
3 Marks
c The angular velocity of link 3, 𝜃3̇ and the velocity of point D, 𝑟1̇
5 Marks
e
e
1
r r
1 1
e = 2 cm, r2 = 3 cm, r3 = 6 cm, ϴ2 = 60
degrees, ω2 = 10 rad/s CCW
Page | 27
Sample 4 Solution
Page | 28
clear all
%data x(1)=r1;x(2)=th3;
c=pi/180;
th1=0;r2= 3;r3=6;e=2;w2=10;
roots(1)=7;roots(2)=330*c;%roots(1)=r1;roots(2)=th3
th2=[60]*c;
n=length(th2);
for I=1:n
f=@(x)([x(1)*cos(th1)-r2*cos(th2(I))-
r3*cos(x(2));...
x(1)*sin(th1)+e-r2*sin(th2(I))-r3*sin(x(2))]);
x(1)=roots(1);x(2)=roots(2);
roots=fsolve(f,x)
r1(I)=roots(1);
th3(I)=roots(2);
end
plot(th2/c,r1,'X',th2/c,th3/c,'O');grid;
xlabel('crank angle deg');
ylabel('r1 & \theta 3 deg');
legend('r1','th3');
%Velocity v(1)=dr1/dt, v(2)=w3
fv=@(v)([-r3*v(2)*sin(th3)-v(1)-
r2*w2*sin(th2);r3*v(2)*cos(th3)+r2*w2*cos(th2)]);
v(1)=1;v(2)=0;
rootsv=fsolve(fv,v)
Results:
1 Numerical:
a Displacement
roots = 7.4701 6.1833 >> roots(2)/c = 354.2793 degrees
r1 = 7.4701 cm, th3 = 354.2793 degrees
b Velocity:
rootsv = -27.4834 -2.5125
𝑟1̇ = -27.4834 cm/s 𝜃3̇ = -2.5125 rad/s
Page | 29
2 Analytical:
a Displacement
>> r1=r2*cos(th2)+sqrt(r3^2-(e-r2*sin(th2))^2)
r1 = 7.4701 >> num=e-r2*sin(th2) = -0.5981
>> den=r1-r2*cos(th2) = 5.9701
>> th3=atan2(num,den) = -0.0998
>> th3=th3/c = -5.7207
>> th3=360+th3 = 354.2793 degrees
b Velocity:
>> th3dot = -r2*w2*cos(th2)/(r3*cos(th3))
th3dot 𝜃3̇ = -2.5125 rad/s
>> r1dot = r2*w2*(cos(th2)*tan(th3)-sin(th2))
r1dot = 𝑟1̇ = -27.4834 cm/s
400
350 r1
X: 60
Y: 354.3
300 th3
250
r1 & 3 deg
200
150
100
50 X: 60
Y: 7.47
0
58.5 59 59.5 60 60.5 61
crank angle deg
Page | 30
Page | 31
Page | 32
Page | 33
Page | 34
Page | 35
Solution of Closure Equation
>> c=pi/180;r1=1;th1=pi;
>> r2=1;th2=60*c;
>> r3=r1*exp(i*th1)+r2*exp(i*th2)
r3 = -0.5000 + 0.8660i
>> r3angle=angle(r3)/c= r3angle = 120.0000
>> r3mag=abs(r3)=r3mag = 1
Page | 36
Page | 37
Page | 38
Department of Mechanical Engineering University of Bahrain
MENG373 Kinematics and Dynamics of Machines
KINEMATIC ANALYSIS OF PLANAR MECHANISMS
PROBLEMS
1 Figure 1 shows a punch mechanism . If link 2 has length =20 cm, and link 3 has a
length = 60 cm,
FIGURE 1 The punch mechanism.
a Determine the turning positions and stroke.
b Develop a MATLAB code to show the relationship between th2 versus r1 and th2
versus th3
c Plot the configuration diagram for one cycle of th2
d develop a movie for the mechanism
Page | 39
2
A motor drives a film-advancing mechanism with constant velocity ω2 (Figure P2.8)
Link 2 is the driver. The path of point C should be as indicated, so that during the
engagement with the film point C moves along a straight line.
a. Find (by trial and error) such dimensions of the mechanism that the needed trajectory
of point C is achieved.
b. Animate the motion.
c. Plot the velocity and acceleration of point C over the cycle. Find the velocities and
accelerations during engagement and disengagement with the film. Does the velocity
remain constant during the engagement?
FIGURE 2 Film-advancing mechanism
Page | 40
3
A motor drives a carrier mechanism with constant velocity w (see Figure 2.26).The
path of point A should be such that at the lowest position the line AB is parallel to the
horizontal conveyor, and at the highest position the line AC should be parallel to the
inclined conveyor (so that the load can be transferred from one conveyor to another).
a. Find (by trial and error) such dimensions of the mechanism (for the assumed
positions of the conveyor belts) that the needed trajectory of point A is achieved.
(Hint: At extreme positions the motion of point A is reversed, which means that at
these positions the links DC and CB are collinear.)
b. Animate the motion.
c. Plot the velocity and acceleration of point A over the cycle. What are the
velocities and accelerations at the points of load transfer?
FIGURE 3 Material-handling mechanism.
Page | 41
4
FIGURE 4 Oscillating drive-arm mechanism
The oscillating drive-arm in Figure P2.9 has the maximum operating angle p/6. For a
relatively short guideway, the reciprocating output stroke is large and it follows a straight
line.
a Find (by trial and error) such dimensions of the mechanism that the needed trajectory
of the tracing point is achieved.
b Animate the motion.
c Plot the velocity and acceleration of point P over the cycle. What are the velocities
and accelerations at the end points of the stroke?
Page | 42