Kinematic Analysis of a Four Bar Linkage
by Roberto Lot
Pasquale De Luca - date 20/04/04
> restart:
> mylib :="LIBS": libname := mylib,libname: with(MBsymba):
Vector Loop
definition of he vectors
> AB := make_VECTOR(rotate('Z',q),a1,0,0): show(AB); crank
> BC := make_VECTOR(rotate('Z',theta[2]),a2,0,0): show(BC); coupler
> DC := make_VECTOR(rotate('Z',theta[3]),a3,0,0): show(DC); rocker
> AD := make_VECTOR(ground,a4,0,0): show(AD); frame
closing the vector loop: definition of a closure vector
> closure := AD + DC - BC - AB: show(closure);
this expression must be null
>
{Xcomp(closure) , Ycomp(closure) };
we find the solution with respect to the variables
theta[2]
and
theta[3]
which depend on the generalized coordinate
q
(rotation of the crank)
> solution := solve(%, {theta[2],theta[3]} ):
we extract the solutions
> theta[2] := subs(solution,theta[2]);
> theta[3] := subs(solution,theta[3]);
Numerical Solution
numerical results for specified length [m]
a1 = crank length
a2 = coupler length
a3 = rocker length
>
dataset := [a1=0.1, a2=0.4, a3=0.25, a4=0.30 ];
crank, coupler and rocker
num_sol := subs(dataset, solution):
numerical solution, depending on q
> theta[2] := subs(dataset, theta[2]);
> theta[3] := subs(dataset, theta[3]);
Plot of the mechanism
> A := origin(ground):
> B := A + AB: show(B):
> C := B + BC: show(C):
>
D2 := A + AD: show(D2):
Note: Maple reserves D for differential operator
>
vertex := [ [Xcomp(A),Ycomp(A)],
[Xcomp(B),Ycomp(B)],
[Xcomp(C),Ycomp(C)],
[Xcomp(D2),Ycomp(D2)] ]:
coupler angle against crank angle
> plot(theta[2], q=0..2*Pi, labels=[q, "[rad]"], title="theta[2] vs. q");
rocker angle against crank angle
> plot(theta[3], q=0..2*Pi, labels=[q, "[rad]"], title="theta[3] vs. q");
Animation of the Mechanism
Substitute in values for problem
>
q:=2*Pi*t;
vertex := subs(dataset,vertex):
>
with(plots):
with(plottools):
Generate frames for the animation
>
for t from 0 to 29/30 by 1/30 do
crank AB
crank || (30*t) := plot(
{subs(dataset,[ [Xcomp(A)+0.01*cos(2*Pi*t),Ycomp(A)+0.01*sin(2*Pi*t)], [Xcomp(B),Ycomp(B)] ])}, color=black, thickness=3):
coupler BC
coupler || (30*t) := plot(
{subs(dataset,[ [Xcomp(B),Ycomp(B)], [Xcomp(C),Ycomp(C)] ])}, color=black, thickness=3):
rocker DC
rocker || (30*t) := plot(
{subs(dataset,[ [Xcomp(C),Ycomp(C)], [Xcomp(D2),Ycomp(D2)] ])}, color=black, thickness=3):
pin joints
in A:
revj_A || (30*t) := disk(
subs(dataset,[Xcomp(A),Ycomp(A)]), 0.01, color=yellow
);
in B:
revj_B || (30*t) := disk(
subs(dataset,[Xcomp(B),Ycomp(B)]), 0.01, color=yellow
);
in C:
revj_C || (30*t) := disk(
subs(dataset,[Xcomp(C),Ycomp(C)]), 0.01, color=yellow
);
in D
revj_D || (30*t) := disk(
subs(dataset,[Xcomp(D2),Ycomp(D2)]), 0.01, color=yellow
);
total
total || (30*t) := display (
{crank || (30*t), coupler || (30*t), rocker || (30*t), revj_A || (30*t), revj_B || (30*t), revj_C || (30*t), revj_D || (30*t)});
od:
t:='t';
Display the animation.
> display([total || (0..29)], insequence=true, scaling=constrained);