MATLAB Code

MATLAB Code

 

Figure 1. Link Lengths

We used position analysis using MATLAB. In the code, we could adjust the link lengths and determine the position of point P. By changing the link lengths, we could find our desired motion output of point P. The code produced the following two graphs shown as Figures 2 and 3. The first graph shows the length of R3 versus theta. The second graph shows the position of the point P for each full rotation of the rotary wheel. 

Figures 2 and 3. R3 length vs. Theta, and Position of point P.

From the resulting position plot in Figure 3, the tip of the monkey arm, point P, would have 3 inches of vertical clearance. The ladder was then designed off of this clearance. The motion of point P emulates the back and forth climbing motion that we desired. The two arms needed to be 180 degrees out of phase so that two arms could be used instead of four. This also meant that only one arm would hold the weight at once.


 

Begin Code:

clear all;
%%Change these parameters to get a desired motion of monkey hand
%%Desired motion should be primarily vertical, and move out of the
%%way of the ladder while "reaching"
L1=2.5; %% Length of ground link (shoulder pivot to wheel axis)
L2=1.5; %% Radius of wheel
L3=6; %% Length of arm
AP=5; %% Length of hand coming out of arm
thetaA=120*pi/180; %% Angle of hand in respect to arm
phi= -20*pi/180; %% angle of gound link in reference to vertical
theta2= [0:0.1:2*pi];
theta1= 0.*theta2+pi/2+phi; %%ground link is vertical if phi=0
theta3= atan2((L1.*sin(theta1)-L2.*sin(theta2)),L1.*cos(theta1)-L2.*cos(theta2));
r3=(L1.*cos(theta1)-L2.*cos(theta2))./cos(theta3); %% changing link length R3 is from wheel pivot to shoulder slider
%%Position of point P which is interacting with ladder (end of arm)
Px=L2.*cos(theta2)+L3.*cos(theta3)+AP.*cos(theta3-(pi-thetaA));
Py=L2.*sin(theta2)+L3.*sin(theta3)+AP.*sin(theta3-(pi-thetaA));
figure(1)
plot(180/pi.*theta2,180/pi.*theta3)
xlabel('Theta 2')
ylabel('Theta 3')
figure(2)
plot(180/pi.*theta2, r3)
xlabel('Theta 2')
ylabel('Length of r3')
figure(3)
plot(Px,Py)
xlabel('Px (in)')
ylabel('Py (in)')
axis([-5 10 0 15])