Skip to content

Commit

Permalink
Initial commit R2015a. Version 4p1.
Browse files Browse the repository at this point in the history
  • Loading branch information
smiller01985 committed Oct 29, 2019
0 parents commit 709d033
Show file tree
Hide file tree
Showing 273 changed files with 247,277 additions and 0 deletions.
Binary file added Examples/2D/Ball_Bearing/Images/planar_joint.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
109 changes: 109 additions & 0 deletions Examples/2D/Ball_Bearing/Scripts_Data/sm_ball_bearing_testrig_param.m
@@ -0,0 +1,109 @@
% Copyright 2018 The MathWorks, Inc.

% Bearing geometry
bearing.D = 0.1; % Outer diameter (m)
bearing.d = 0.04; % Inner diameter (m)
bearing.b = 0.02; % Width (m)
bearing.rsh = 0.002; % Chamfer radius (m)
bearing.nth = 35; % Half of sweep angle of race channel (deg)
bearing.ball.rad = 0.0075; % Radius of ball (m)

% Create the cross section profile for the races in the bearing.
% These calculations assume that the ball is exactly between the outer
% radius and the inner radius of the bearing.

temp_outer_race_profile = Extr_Data_Block_NotchCircle(...
bearing.b,...
(bearing.D/4-bearing.d/4-bearing.ball.rad*cosd(bearing.nth)),...
bearing.ball.rad,...
bearing.nth,...
bearing.rsh);
bearing.outer_race.xc = rot90(temp_outer_race_profile + ...
repmat([0 (bearing.D+bearing.d)/4+bearing.ball.rad*cosd(bearing.nth)],size(temp_outer_race_profile,1),1),2);

temp_inner_race_profile = flipud(temp_outer_race_profile).*repmat([1 -1],size(temp_outer_race_profile,1),1);

bearing.inner_race.xc = rot90(temp_inner_race_profile + ...
repmat([0 (bearing.D+bearing.d)/4-bearing.ball.rad*cosd(bearing.nth)],size(temp_inner_race_profile,1),1),2);
%{
Extr_Data_Custom(...
[bearing.outer_race.xc;
bearing.inner_race.xc;
bearing.inner_race.xc(1,:);
bearing.outer_race.xc(end,:)]);
%}

% Inner and outer race parameters
bearing.outer_race.rho = 7000;
bearing.outer_race.clr = [0.8 0.8 0.5];
bearing.outer_race.opc = 1;

bearing.outer_race.mark_clr = [0.6 0.6 0.4];
bearing.outer_race.mark_opc = 1;
bearing.outer_race.mark_xc = ...
[1.08 1; 1.08 -1; 1.12 -1; 1.12 1].* ...
repmat([(bearing.D+bearing.d)/4+bearing.ball.rad bearing.b*0.51],4,1);

bearing.inner_race.rho = 7000;
bearing.inner_race.clr = [0.8 0.8 0.5];
bearing.inner_race.opc = 1;

bearing.inner_race.mark_clr = [0.6 0.6 0.4];
bearing.inner_race.mark_opc = 1;
bearing.inner_race.mark_xc = ...
[0.90 1; 0.90 -1; 0.97 -1; 0.97 1].* ...
repmat([(bearing.D+bearing.d)/4-bearing.ball.rad bearing.b*0.51],4,1);

% Ball parameters
bearing.ball.rho = 7000;
bearing.ball.cage_b = 1e-8;
bearing.ball.clr = [0.6 0.6 0.6];
bearing.ball.opc = 1;
bearing.ball.mark.clr = [0.9 0.9 0.9];
bearing.ball.mark.opc = 1;

% Cage parameters
bearing.cage.height = bearing.ball.rad*(cosd(bearing.nth))*2*0.5;
bearing.cage.rad_i = bearing.ball.rad*1.001;
bearing.cage.rad_o = bearing.cage.rad_i*1.1;
bearing.cage.thk = (bearing.cage.rad_o-bearing.cage.rad_i)*2;
bearing.cage.loop_xc = [...
bearing.cage.rad_o -bearing.cage.height/2;
bearing.cage.rad_o bearing.cage.height/2;
bearing.cage.rad_i bearing.cage.height/2;
bearing.cage.rad_i -bearing.cage.height/2];

bearing.cage.web.outerang = ...
360/8/2-atan2d(bearing.cage.rad_o,(bearing.D+bearing.d)/4+bearing.cage.height/2);
bearing.cage.web.innerang = ...
360/8/2-atan2d(bearing.cage.rad_o,(bearing.D+bearing.d)/4-bearing.cage.height/2);
bearing.cage.web.centerang = ...
360/8/2-atan2d(bearing.cage.rad_o,(bearing.D+bearing.d)/4);

bearing.cage.web.outerrad = sqrt( ...
((bearing.D+bearing.d)/4+bearing.cage.height/2)^2 + bearing.cage.rad_o^2);
bearing.cage.web.innerrad = sqrt( ...
((bearing.D+bearing.d)/4-bearing.cage.height/2)^2 + bearing.cage.rad_o^2);
bearing.cage.web.centerrad = (bearing.cage.web.outerrad+bearing.cage.web.innerrad)/2;

bearing.cage.web_xc = ...
[[cosd(linspace(-bearing.cage.web.outerang,bearing.cage.web.outerang,25))' ...
sind(linspace(-bearing.cage.web.outerang,bearing.cage.web.outerang,25))']* ...
bearing.cage.web.outerrad;
[cosd(linspace(bearing.cage.web.innerang,-bearing.cage.web.innerang,25))' ...
sind(linspace(bearing.cage.web.innerang,-bearing.cage.web.innerang,25))']* ...
bearing.cage.web.innerrad] ...
-repmat([bearing.cage.web.centerrad 0],2*25,1);

bearing.cage.rho = 7000;
bearing.cage.clr = [1 1 1]*0.9;
bearing.cage.opc = 1;


% Contact force parameters
bearing.ball.k = 1e5;
bearing.ball.b = 1e3;
bearing.ball.muk = 0.7;
bearing.ball.mus = 0.9;
bearing.ball.vth = 1e-2;
bearing.ball.preload = 5;
@@ -0,0 +1,51 @@
% Code to plot simulation results from sm_ball_bearing_testrig
%% Plot Description:
%
% The plot below shows speeds relative to the inner race.
%
% Copyright 2018 The MathWorks, Inc.

% Generate simulation results if they don't exist
if ~exist('simlog_sm_ball_bearing_testrig', 'var')
sim('sm_ball_bearing_testrig')
end

% Reuse figure if it exists, else create new figure
if ~exist('h1_sm_ball_bearing_testrig', 'var') || ...
~isgraphics(h1_sm_ball_bearing_testrig, 'figure')
h1_sm_ball_bearing_testrig = figure('Name', 'sm_ball_bearing_testrig');
end
figure(h1_sm_ball_bearing_testrig)
clf(h1_sm_ball_bearing_testrig)

temp_colororder = get(gca,'defaultAxesColorOrder');

% Get simulation results
simlog_t = simlog_sm_ball_bearing_testrig.Ball_Bearing.Planar.Rz.w.series.time;
simlog_wOR = simlog_sm_ball_bearing_testrig.Ball_Bearing.Planar.Rz.w.series.values('rpm');
simlog_wCa = simlog_sm_ball_bearing_testrig.Ball_Bearing.Revolute_Inner_Cage.Rz.w.series.values('rpm');
simlog_cOut = logsout_sm_ball_bearing_testrig.get('cage_output');
simlog_trq = logsout_sm_ball_bearing_testrig.get('torque');

% Plot results
simlog_handles(1) = subplot(2, 1, 1);
plot(simlog_t, simlog_wOR, simlog_t, simlog_wCa, 'LineWidth', 1)
hold off
grid on
title('Speed Relative to Inner Race')
ylabel('Speed (RPM)')
legend({'Outer Race','Cage'},'Location','Best');

simlog_handles(2) = subplot(2, 1, 2);
plot(simlog_cOut.Values.Time, simlog_cOut.Values.Data, 'LineWidth', 1)
title('Normal Force on Balls from Outer Race')
ylabel('Force (N)')
grid on
xlabel('Time (s)')

linkaxes(simlog_handles, 'x')

% Remove temporary variables
clear simlog_t simlog_handles
clear simlog_trq simlog_wOR simlog_wCa simlog_cOut temp_colororder

Binary file not shown.
15 changes: 15 additions & 0 deletions Examples/2D/Ball_Bearing/startup_sm_ball_bearing_testrig.m
@@ -0,0 +1,15 @@
% Copyright 2018 The MathWorks, Inc.

addpath(pwd)
addpath([pwd filesep 'Libraries']);
addpath([pwd filesep 'Scripts_Data']);
addpath([pwd filesep 'Images']);
addpath([pwd filesep 'Animations']);

% Documentation excluded for zip file on File Exchange
if(exist([pwd filesep 'html' filesep 'html'],'dir'))
addpath([pwd filesep 'html' filesep 'html']);
end

sm_ball_bearing_testrig_param
sm_ball_bearing_testrig
Binary file added Examples/2D/Cam_Follower/Cam_Follower.slx
Binary file not shown.
49 changes: 49 additions & 0 deletions Examples/2D/Cam_Follower/Cam_Parameters.m
@@ -0,0 +1,49 @@
% CAM PARAMETERS
% Copyright 2014-2018 The MathWorks, Inc.

Cam_PARAM.Cam.Radius_rev = 2; % cm
Cam_PARAM.Cam.Radius_tip = 1; % cm
Cam_PARAM.Cam.Dist_ctrs = 2; % cm
Cam_PARAM.Cam.Thickness = 1; % cm
Cam_PARAM.Cam.Theta1 = acos((Cam_PARAM.Cam.Radius_rev-Cam_PARAM.Cam.Radius_tip)/Cam_PARAM.Cam.Dist_ctrs)*180/pi;

Cam_PARAM.Roller.Radius = 0.75; % cm
Cam_PARAM.Roller.Thickness = 2; % cm

%Extr_Data_Ring(1.5,0,0,90,'plot')

Cam_PARAM.Follower.Spring_k = 10; % N/m
Cam_PARAM.Follower.Damper_b = 1; % N/(m/s)

Cam_PARAM.Follower.Length = 7.25; % cm
Cam_PARAM.Follower.Shaft_Rad = 0.3; % cm

Cam_PARAM.Follower.Housing.Length = 2; % cm
Cam_PARAM.Follower.Housing.Rad = 0.5; % cm

Cam_PARAM.ContactCF.Stiffness = 1e3;
Cam_PARAM.ContactCF.Damping = 10;
Cam_PARAM.ContactCF.Filter = 1e-4;

Cam_PARAM.Rocker.Pushrod.Offset= 3;
Cam_PARAM.Rocker.Pushrod.End_rad = 1;
Cam_PARAM.Rocker.Pushrod.Thickness = 1;
Cam_PARAM.Rocker.Center.Rad = 1.25;
Cam_PARAM.Rocker.Valve.Offset = 6;
Cam_PARAM.Rocker.Valve.End_rad = 0.5;
Cam_PARAM.Rocker.Pivot_rad = 0.5;
Cam_PARAM.Rocker.Pivot_len = 2;
Cam_PARAM.Rocker.Pivot_camsh_offset = 10;


Cam_PARAM.Valve.Stem.Radius = 0.15;
Cam_PARAM.Valve.Stem.Length = 10;
Cam_PARAM.Valve.Head.Radius = 1;
Cam_PARAM.Valve.Head.Height = 0.5;
Cam_PARAM.Valve.Head.Thickness = 0.1;

extr1 = Extr_Data_Ellipse(Cam_PARAM.Valve.Head.Radius,Cam_PARAM.Valve.Head.Height,180,270,1);
extr2 = extr1+repmat([Cam_PARAM.Valve.Head.Radius -Cam_PARAM.Valve.Stem.Length],size(extr1,1),1);
extr3 = [0 0;extr2;extr2(end,:)+[0 -Cam_PARAM.Valve.Head.Thickness]];
Cam_PARAM.Valve.Extr_Data = flipud([0 0;extr3+repmat([Cam_PARAM.Valve.Stem.Radius 0],size(extr3,1),1);[0 extr3(end,2)]]);
clear extr1 extr2 extr3
14 changes: 14 additions & 0 deletions Examples/2D/Cam_Follower/Help/Cam_Follower_Contact.html
@@ -0,0 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--Copyright 2018 The MathWorks, Inc.-->
<html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"><head>
<!--[if gte mso 9]><xml>
<mso:CustomDocumentProperties>
<mso:_dlc_DocId msdt:dt="string">FV3TYEPWNNQC-24-73778</mso:_dlc_DocId>
<mso:_dlc_DocIdItemGuid msdt:dt="string">2f4411c5-fd1b-4000-9527-a7c93fba170f</mso:_dlc_DocIdItemGuid>
<mso:_dlc_DocIdUrl msdt:dt="string">http://sharepoint/marketing/product/da/physmod/ecl/_layouts/15/DocIdRedir.aspx?ID=FV3TYEPWNNQC-24-73778, FV3TYEPWNNQC-24-73778</mso:_dlc_DocIdUrl>
</mso:CustomDocumentProperties>
</xml><![endif]-->
</head><body bgColor="FFFFFF"><html>
<title>Cam Follower Contact Forces</title>
<img vspace="5" hspace="5" src="Cam_Follower_Contact_Help_IMAGE.png" alt="">
</body></html>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Examples/2D/Cam_Follower/UI/Cam_Follower_UI.fig
Binary file not shown.

0 comments on commit 709d033

Please sign in to comment.