Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

MATLAB Code

KinematicAnalysis.m

%% RMD ME 350R Final Project Kinematic Analysis
% Maleah Calomeni & Isabel Herrera
% May 3, 2022

%% Front facing view (xz-plane)

% Vector Loop 1

% Position
f = 3.5; % (inches), link 6
g = 3.5; % (inches), link 7
theta7 = 90:120; % (deg)u
theta6 = acosd((-g./f).*cosd(theta7)); % (deg)
h = f.*sind(theta6)+g.*sind(theta7); % (inches), virtual link 8

% Velocity
omega6 = 1; % (rad/s)
omega7 = omega6; % (rad/s)
h_dot = omega6.*(f.*sind(theta6) + g.*sind(theta7)); % (inches/s)

% Acceleration
alpha6 = 0; % link 6 has constant angular velocity
alpha7 = (-f.*omega6^2.*cosd(theta6) - g.*omega7.*cosd(theta7))./(g.*sin(theta7)); % (rad/s^2)
h_doubledot = -f.*omega6.^2.*sind(theta6) - g.*omega7.^2.*sind(theta7) + g.*alpha7.*cosd(theta7); % (inches/s^2), vertical sliding velocity

% Vector Loop 2

% Position
a = 9.3; % (inches), link 2 (knife)
b = 3.1; % (inches), link 3
c = 3.1; % (inches), link 4
d = 7.5; % (inches), link 5
k = 17; % (inches), link 9 (virtual link)

theta5 = 90; % (deg)
theta8 = 90; % (deg)
theta9 = 90; % (deg)
theta1 = 0; % (deg)
theta2 = asind((d+h-k)./(a+b+c)); % (deg)
l = (a+b+c).*cosd(theta2); % (inches), link 1

% Velocity
omega2 = h_dot./((a+b+c).*cosd(theta2)); % (rad/s)
l_dot = -(a+b+c).*omega2.*sind(theta2); % (inches/s), horizontal sliding velocity

% Acceleration
alpha2 = ((a+b+c).*omega2.^2.*sind(theta2) + h_doubledot)./((a+b+c).*cosd(theta2)); % (rad/s^2)
l_doubledot = -(a+b+c).*omega2.^2.*cosd(theta2)-(a+b+c).*alpha2.*sind(theta2); % (inches/s^2)

% Plots
figure(1)
plot(theta7,theta2)
title('Angle of Knife vs. Crank Angle')
subtitle('xz-plane')
xlabel('Crank Angle (deg)')
ylabel('Angle of Knife Angle (deg)')

figure(2)
plot(theta7, omega2)
title('Angular Velocity of Knife vs. Crank Angle')
subtitle('xz-plane')
xlabel('Crank Angle (deg)')
ylabel('Angular Velocity of Knife (rad/s)')

figure(3)
plot(theta7, alpha2)
title('Angular Acceleration of Knife vs. Crank Angle')
subtitle('xz-plane')
xlabel('Crank Angle (deg)')
ylabel('Angular Acceleration of Knife (rad/s^2)')

%% Top down view (xy plane)

% Position
a = 9.3; % (inches), link 2 (knife)
b = 3.1; % (inches), link 3
c = 3.1; % (inches), link 4
m = 2.06; % (inches), link 10
n = 1.75; % (inches), link 11
p = 7.4; % (inches), link 12

theta11 = 90; % (deg)
theta12 = 90:120; % (deg)
theta4 = theta12 + 90; % (deg)
theta13 = 0; % (deg)

theta10 = asind((c.*cosd(theta4) + p.*sind(theta12) - n)/(m+a+b));
q = (m+a+b).*cosd(theta10)-c.*cosd(theta4)-p.*cos(theta12);

% Velocity
omega12 = 1; % (rad/s)
omega4 = omega12;

omega10 = (omega4.*(c.*cosd(theta4) + p.*cosd(theta12)))/(m+a+b);
q_dot = -(m+a+b).*omega10.*sind(theta10) + c.*omega4.*sind(theta4) + p.*omega12.*sind(theta12);

% Acceleration
alpha12 = 0; % link 12 has constant angular velocity
alpha4 = alpha12;

alpha10 = ((m+a+b).*omega10.^2.*sind(theta10) - c.*omega4.^2.*sind(theta4) - p.*omega12.^2.*sind(theta12))./((m+a+b).*cosd(theta10));
q_doubledot = -(m+a+b).*omega10.^2.*cosd(theta10) - (m+a+b).*alpha10.*sind(theta10) + c.*omega4.^2.*cosd(theta4) + p.*omega12.^2.*cosd(theta12);

% Plots
figure(4)
plot(theta12,theta10)
title('Angle of Knife vs. Crank Angle')
subtitle('xy-plane')
xlabel('Crank Angle (deg)')
ylabel('Angle of Knife Angle (deg)')

figure(5)
plot(theta12, omega10)
title('Angular Velocity of Knife vs. Crank Angle')
subtitle('xy-plane')
xlabel('Crank Angle (deg)')
ylabel('Angular Velocity of Knife (rad/s)')

figure(6)
plot(theta12, alpha10)
title('Angular Acceleration of Knife vs. Crank Angle')
subtitle('xy-plane')
xlabel('Crank Angle (deg)')
ylabel('Angular Acceleration of Knife (rad/s^2)')

Bill of Materials

ItemQuantity
Knife1
1/4" 24x30 board2
5 mm ball bearings2
5 mm metal rods2
Arduino Uno R32

TowerPro MG995 Servo Motor

1

Tiankongrc TD-8120MG 360º Servo Motor

1

EBL 9V Rechargeable Ni-MH Battery

1
11 mm wooden dowel2
5 mm wooden dowel 3
1/4" machine screw, washer, & nut10
3 mm machine screw, washer, & nut1
  • No labels