Skip to content

Commit

Permalink
Initial commit R2022b.
Browse files Browse the repository at this point in the history
  • Loading branch information
smiller01985 committed Oct 13, 2022
1 parent 5660fc5 commit d1236bf
Show file tree
Hide file tree
Showing 42 changed files with 65 additions and 26 deletions.
Binary file modified Libraries/CFL_Core/Libraries/Contact_Forces_Lib.slx
Binary file not shown.
Binary file modified Libraries/CFL_Core/Libraries/Parts_Lib.slx
Binary file not shown.
12 changes: 12 additions & 0 deletions Libraries/CFL_Core/Scripts_Data/CFL_activeVariantBlock.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function blk = CFL_activeVariantBlock(variant_sub_name)
% Code to return path to block which is the active variant.

% Copyright 2022 The MathWorks, Inc.

vnt_list = get_param(variant_sub_name,'Variants');
vnt_actv = get_param(variant_sub_name,'ActiveVariant');

blk = [];
if(~isempty(vnt_actv))
blk = vnt_list(strcmp(vnt_actv,{vnt_list(:).Name})).BlockName;
end
9 changes: 5 additions & 4 deletions Libraries/CFL_Core/Scripts_Data/CFL_contact_setModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ function CFL_contact_setModel(mdlname,contactModel)

% Copyright 2014-2022 The MathWorks, Inc.

CF_bpth=find_system(mdlname,'RegExp','on','LookUnderMasks','on','FollowLinks','on','force_law','.*');
CF_bpth_box2box=find_system(mdlname,'RegExp','on','LookUnderMasks','on','FollowLinks','on','force_law_box2box','.*');
CF_bpth_box2belt=find_system(mdlname,'RegExp','on','LookUnderMasks','on','FollowLinks','on','force_law_box2belt','.*');
CF_bpth_sph2belt=find_system(mdlname,'RegExp','on','LookUnderMasks','on','FollowLinks','on','force_law_sph2bel','.*');
f=Simulink.FindOptions('FollowLinks',1,'LookUnderMasks','All','RegExp',1);
CF_bpth=getfullname(Simulink.findBlocks(mdlname,'friction_law','.*',f));
CF_bpth_box2box=getfullname(Simulink.findBlocks(mdlname,'force_law_box2box','.*',f));
CF_bpth_box2belt=getfullname(Simulink.findBlocks(mdlname,'force_law_box2belt','.*',f));
CF_bpth_sph2belt=getfullname(Simulink.findBlocks(mdlname,'force_law_sph2bel','.*',f));

if(~isempty(CF_bpth))

Expand Down
9 changes: 5 additions & 4 deletions Libraries/CFL_Core/Scripts_Data/CFL_friction_setModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ function CFL_friction_setModel(mdlname,frictionModel)

% Copyright 2014-2022 The MathWorks, Inc.

CF_bpth=find_system(mdlname,'RegExp','on','LookUnderMasks','on','FollowLinks','on','friction_law','.*');
CF_bpth_box2box=find_system(mdlname,'RegExp','on','LookUnderMasks','on','FollowLinks','on','friction_law_box2box','.*');
CF_bpth_box2belt=find_system(mdlname,'RegExp','on','LookUnderMasks','on','FollowLinks','on','friction_law_box2belt','.*');
CF_bpth_sph2belt=find_system(mdlname,'RegExp','on','LookUnderMasks','on','FollowLinks','on','friction_law_sph2bel','.*');
f=Simulink.FindOptions('FollowLinks',1,'LookUnderMasks','All','RegExp',1);
CF_bpth=getfullname(Simulink.findBlocks(mdlname,'friction_law','.*',f));
CF_bpth_box2box =getfullname(Simulink.findBlocks(mdlname,'friction_law_box2box','.*',f));
CF_bpth_box2belt=getfullname(Simulink.findBlocks(mdlname,'friction_law_box2belt','.*',f));
CF_bpth_sph2belt=getfullname(Simulink.findBlocks(mdlname,'friction_law_sph2bel','.*',f));

if(~isempty(CF_bpth))

Expand Down
9 changes: 5 additions & 4 deletions Libraries/CFL_Core/Scripts_Data/CFL_visual_setOnOff.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ function CFL_visual_setOnOff(mdlname,visOnOff)

% Copyright 2014-2022 The MathWorks, Inc.

CF_bpth=find_system(mdlname,'RegExp','on','LookUnderMasks','on','FollowLinks','on','vis_on','.*');
CF_bpth_box2box=find_system(mdlname,'RegExp','on','LookUnderMasks','on','FollowLinks','on','vis_on_box2box','.*');
CF_bpth_box2belt=find_system(mdlname,'RegExp','on','LookUnderMasks','on','FollowLinks','on','vis_on_pla2pla','.*');
CF_bpth_sph2belt=find_system(mdlname,'RegExp','on','LookUnderMasks','on','FollowLinks','on','vis_on_sph2bel','.*');
f=Simulink.FindOptions('FollowLinks',1,'LookUnderMasks','All','RegExp',1);
CF_bpth=getfullname(Simulink.findBlocks(mdlname,'vis_on','.*',f));
CF_bpth_box2box =getfullname(Simulink.findBlocks(mdlname,'vis_on_box2box','.*',f));
CF_bpth_box2belt=getfullname(Simulink.findBlocks(mdlname,'vis_on_pla2pla','.*',f));
CF_bpth_sph2belt=getfullname(Simulink.findBlocks(mdlname,'vis_on_sph2bel','.*',f));

if(~isempty(CF_bpth))
for i=1:length(CF_bpth)
Expand Down
Binary file modified Libraries/CFL_Core/Test_Models/Test2D_Disks_in_Box.slx
Binary file not shown.
Binary file modified Libraries/CFL_Core/Test_Models/Test3D_Balls_in_Box.slx
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="ad2dea70-790c-4d13-aa0b-381399c1ae7d"/>
</Category>
</Info>
Binary file modified Libraries/sm_robot_run_4legs_lib.slx
Binary file not shown.
6 changes: 3 additions & 3 deletions Overview/html/sm_robot_run_4legs.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!--
This HTML was auto-generated from MATLAB code.
To make changes, update the MATLAB code and republish this document.
--><title>Mechatronic Running Robot</title><meta name="generator" content="MATLAB 9.12"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2022-03-10"><meta name="DC.source" content="sm_robot_run_4legs.m"><style type="text/css">
--><title>Mechatronic Running Robot</title><meta name="generator" content="MATLAB 9.13"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2022-09-19"><meta name="DC.source" content="sm_robot_run_4legs.m"><style type="text/css">
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outine:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}

html { min-height:100%; margin-bottom:1px; }
Expand Down Expand Up @@ -67,7 +67,7 @@



</style></head><body><div class="content"><h1>Mechatronic Running Robot</h1><!--introduction--><p>This model shows how a running or walking robot can be modeled to support system design. This four-legged robot has compliant legs that can store and re-release kinetic energy. As such it is biologically-inspired by an equestrian trotting gait. The model can be used to support selection of leg length, leg spring stiffness and actuators. An objective could be to minimise power consumption for a steady trot at some nominal average forward speed. The DC power supply is augmented with an ultracapacitor which is sized to smooth battery currents and store regenerative electrical energy.</p><p>For details on the design process, see <a href="matlab:web('sm_robot_run_limb_design.html');">Mechatronic Running Robot Limb Design</a></p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#1">Model</a></li><li><a href="#3">Leg LF Subsystem</a></li><li><a href="#4">Hip Actuator Subsystem</a></li><li><a href="#5">Power Supply Subsystem</a></li><li><a href="#6">Gait Phase Subsystem</a></li><li><a href="#7">Contact Forces Between Feet and Floor</a></li><li><a href="#9">Simulation Results from Simscape Logging</a></li></ul></div><h2 id="1">Model</h2><img vspace="5" hspace="5" src="sm_robot_run_4legs_01.png" alt=""> <p><img vspace="5" hspace="5" src="sm_robot_run_4legs_mechExp_anim.gif" alt=""> </p><h2 id="3">Leg LF Subsystem</h2><p><a href="matlab:open_system('sm_robot_run_4legs');open_system('sm_robot_run_4legs/Leg%20LF','force');">Open Subsystem</a></p><img vspace="5" hspace="5" src="sm_robot_run_4legs_02.png" alt=""> <h2 id="4">Hip Actuator Subsystem</h2><p><a href="matlab:open_system('sm_robot_run_4legs');open_system('sm_robot_run_4legs/Leg%20LF/Hip%20Actuator/Actuator','force');">Open Subsystem</a></p><img vspace="5" hspace="5" src="sm_robot_run_4legs_03.png" alt=""> <h2 id="5">Power Supply Subsystem</h2><p><a href="matlab:open_system('sm_robot_run_4legs');open_system('sm_robot_run_4legs/Power%20Supply','force');">Open Subsystem</a></p><img vspace="5" hspace="5" src="sm_robot_run_4legs_04.png" alt=""> <h2 id="6">Gait Phase Subsystem</h2><p><a href="matlab:open_system('sm_robot_run_4legs');open_system('sm_robot_run_4legs/Gait%20Phase','force');">Open Subsystem</a></p><img vspace="5" hspace="5" src="sm_robot_run_4legs_05.png" alt=""> <h2 id="7">Contact Forces Between Feet and Floor</h2><p>Two methods are used for modeling the contact force between the foot and the floor. One is used for the X-Y plane only, the other accommodates movement in any direction. You can select the appropriate force for your test using a parameter in the leg subsystem mask.</p><p><b>Planar Contact Model</b></p><p>The planar variant of the contact force model assumes that the leg is moving in the positive global x direction and stays within the XY-plane. Simulink is used to model a spring-damper that connects the end of the leg to the floor at the exact location where it lands. This spring-damper is deactivated when the foot leaves the floor. This idealized form of a contact model is good for initial testing.</p><p><a href="matlab:open_system('sm_robot_run_4legs');open_system('sm_robot_run_4legs/Leg%20RR/Contact%20Force%20Model/Planar','force');">Open Subsystem</a></p><img vspace="5" hspace="5" src="sm_robot_run_4legs_06.png" alt=""> <p><b>Six Degree of Freedom Contact Model</b></p><p>This variant of the contact force model assumes the end of the leg is a sphere and detects collision between the sphere and the surface of the floor. It models contact and friction force between the sphere and the plane. It is valid for all six degrees of freedom.</p><p><a href="matlab:open_system('sm_robot_run_4legs');open_system('sm_robot_run_4legs/Leg%20RR/Contact%20Force%20Model/SixDOF','force');">Open Subsystem</a></p><img vspace="5" hspace="5" src="sm_robot_run_4legs_07.png" alt=""> <h2 id="9">Simulation Results from Simscape Logging</h2><p>The plot below shows the current drawn by the motor and supplied by the battery as the robot runs.</p><img vspace="5" hspace="5" src="sm_robot_run_4legs_08.png" alt=""> <p class="footer">Copyright 2012-2022 The MathWorks, Inc.<br><a href="https://www.mathworks.com/products/matlab/">Published with MATLAB&reg; R2022a</a><br></p></div><!--
</style></head><body><div class="content"><h1>Mechatronic Running Robot</h1><!--introduction--><p>This model shows how a running or walking robot can be modeled to support system design. This four-legged robot has compliant legs that can store and re-release kinetic energy. As such it is biologically-inspired by an equestrian trotting gait. The model can be used to support selection of leg length, leg spring stiffness and actuators. An objective could be to minimise power consumption for a steady trot at some nominal average forward speed. The DC power supply is augmented with an ultracapacitor which is sized to smooth battery currents and store regenerative electrical energy.</p><p>For details on the design process, see <a href="matlab:web('sm_robot_run_limb_design.html');">Mechatronic Running Robot Limb Design</a></p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#1">Model</a></li><li><a href="#3">Leg LF Subsystem</a></li><li><a href="#4">Hip Actuator Subsystem</a></li><li><a href="#5">Power Supply Subsystem</a></li><li><a href="#6">Gait Phase Subsystem</a></li><li><a href="#7">Contact Forces Between Feet and Floor</a></li><li><a href="#9">Simulation Results from Simscape Logging</a></li></ul></div><h2 id="1">Model</h2><img vspace="5" hspace="5" src="sm_robot_run_4legs_01.png" alt=""> <p><img vspace="5" hspace="5" src="sm_robot_run_4legs_mechExp_anim.gif" alt=""> </p><h2 id="3">Leg LF Subsystem</h2><p><a href="matlab:open_system('sm_robot_run_4legs');open_system('sm_robot_run_4legs/Leg%20LF','force');">Open Subsystem</a></p><img vspace="5" hspace="5" src="sm_robot_run_4legs_02.png" alt=""> <h2 id="4">Hip Actuator Subsystem</h2><p><a href="matlab:open_system('sm_robot_run_4legs');open_system('sm_robot_run_4legs/Leg%20LF/Hip%20Actuator/Actuator','force');">Open Subsystem</a></p><img vspace="5" hspace="5" src="sm_robot_run_4legs_03.png" alt=""> <h2 id="5">Power Supply Subsystem</h2><p><a href="matlab:open_system('sm_robot_run_4legs');open_system('sm_robot_run_4legs/Power%20Supply','force');">Open Subsystem</a></p><img vspace="5" hspace="5" src="sm_robot_run_4legs_04.png" alt=""> <h2 id="6">Gait Phase Subsystem</h2><p><a href="matlab:open_system('sm_robot_run_4legs');open_system('sm_robot_run_4legs/Gait%20Phase','force');">Open Subsystem</a></p><img vspace="5" hspace="5" src="sm_robot_run_4legs_05.png" alt=""> <h2 id="7">Contact Forces Between Feet and Floor</h2><p>Two methods are used for modeling the contact force between the foot and the floor. One is used for the X-Y plane only, the other accommodates movement in any direction. You can select the appropriate force for your test using a parameter in the leg subsystem mask.</p><p><b>Planar Contact Model</b></p><p>The planar variant of the contact force model assumes that the leg is moving in the positive global x direction and stays within the XY-plane. Simulink is used to model a spring-damper that connects the end of the leg to the floor at the exact location where it lands. This spring-damper is deactivated when the foot leaves the floor. This idealized form of a contact model is good for initial testing.</p><p><a href="matlab:open_system('sm_robot_run_4legs');open_system('sm_robot_run_4legs/Leg%20RR/Contact%20Force%20Model/Planar','force');">Open Subsystem</a></p><img vspace="5" hspace="5" src="sm_robot_run_4legs_06.png" alt=""> <p><b>Six Degree of Freedom Contact Model</b></p><p>This variant of the contact force model assumes the end of the leg is a sphere and detects collision between the sphere and the surface of the floor. It models contact and friction force between the sphere and the plane. It is valid for all six degrees of freedom.</p><p><a href="matlab:open_system('sm_robot_run_4legs');open_system('sm_robot_run_4legs/Leg%20RR/Contact%20Force%20Model/SixDOF','force');">Open Subsystem</a></p><img vspace="5" hspace="5" src="sm_robot_run_4legs_07.png" alt=""> <h2 id="9">Simulation Results from Simscape Logging</h2><p>The plot below shows the current drawn by the motor and supplied by the battery as the robot runs.</p><img vspace="5" hspace="5" src="sm_robot_run_4legs_08.png" alt=""> <p class="footer">Copyright 2012-2022 The MathWorks, Inc.<br><a href="https://www.mathworks.com/products/matlab/">Published with MATLAB&reg; R2022b</a><br></p></div><!--
##### SOURCE BEGIN #####
%% Mechatronic Running Robot
% This model shows how a running or walking robot can be modeled to
Expand All @@ -90,7 +90,7 @@
open_system('sm_robot_run_4legs')
set_param(find_system('sm_robot_run_4legs','FindAll', 'on','type','annotation','Tag','ModelFeatures'),'Interpreter','off')
set_param(find_system('sm_robot_run_4legs','MatchFilter',@Simulink.match.allVariants,'FindAll', 'on','type','annotation','Tag','ModelFeatures'),'Interpreter','off')
%%
% <<sm_robot_run_4legs_mechExp_anim.gif>>
Expand Down
Binary file modified Overview/html/sm_robot_run_4legs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Overview/html/sm_robot_run_4legs_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Overview/html/sm_robot_run_4legs_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Overview/html/sm_robot_run_4legs_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Overview/html/sm_robot_run_4legs_04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Overview/html/sm_robot_run_4legs_05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Overview/html/sm_robot_run_4legs_06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Overview/html/sm_robot_run_4legs_07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Overview/html/sm_robot_run_4legs_08.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Overview/sm_robot_run_4legs.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

open_system('sm_robot_run_4legs')

set_param(find_system('sm_robot_run_4legs','FindAll', 'on','type','annotation','Tag','ModelFeatures'),'Interpreter','off')
set_param(find_system('sm_robot_run_4legs','MatchFilter',@Simulink.match.allVariants,'FindAll', 'on','type','annotation','Tag','ModelFeatures'),'Interpreter','off')

%%
% <<sm_robot_run_4legs_mechExp_anim.gif>>
Expand Down
12 changes: 12 additions & 0 deletions Scripts_Data/sm_robot_run_4legs_activeVariantBlock.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function blk = sm_robot_run_4legs_activeVariantBlock(variant_sub_name)
% Code to return path to block which is the active variant.

% Copyright 2022 The MathWorks, Inc.

vnt_list = get_param(variant_sub_name,'Variants');
vnt_actv = get_param(variant_sub_name,'ActiveVariant');

blk = [];
if(~isempty(vnt_actv))
blk = vnt_list(strcmp(vnt_actv,{vnt_list(:).Name})).BlockName;
end
Loading

0 comments on commit d1236bf

Please sign in to comment.