MATLAB Script of Position Analysis

In order to predict the motion and path of the 8-bar transporting mechanism, we wrote MATLAB Script to determine the position of a fixed point on the linkages during a full rotation. We modeled the 8-bar mechanism as a simple 4-bar, seeing that the remaining linkages were extensions of the same length and orientation as the original four. the 8-bar mechanism proved to travel the same path as the simulated 4-bar, however, we did have to tune the link lengths in Solidworks to ensure that there was no interference. Our final path simulation is shown below, as well as the MATLAB script that calculated it. The script calls four-bar mechanism position MATLAB functions that includes offset angle as an input. 

% RMD Final Project Code

a = 1.5 ; % link 1

b = 3.0622; % link 2

c = 3.495; % link 3

d = 3.33; % link 4 - grnd

AP = 4.86; % link 5 - long triangle

tang = 30.77323242; % ternary angle

link6 = sqrt(b^2 + AP^2 -2*b*AP*cosd(tang));

links123456 = [a b c d AP link6]

offset = 153;

n = 360;

    theta11 = zeros(1,n+1);

    theta22 = zeros(1,n+1);

    theta33 = zeros(1,n+1);

    theta44 = zeros(1,n+1);


cntr = 1;

for i = 0:1:n

    theta11(cntr) = 0;

    theta22(cntr) = i;

    theta33(cntr) = fourbarpost3dwt1([a b c d],offset,i,-1);

    theta44(cntr) = fourbarpost4dwt1([a b c d],offset,i,-1);

    x(cntr) = -a*cosd(theta22(cntr)) - AP*cosd(theta33(cntr) - tang);

    y(cntr) = a*sind(theta22(cntr)) + AP*sind(theta33(cntr) - tang);

    cntr = cntr + 1 ;

end


plot(x,y) 

title('Problem 2')

xlabel('x')

ylabel('y')



To find theta 3 and theta 4 of the four bar mechanism: