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 0370d54 commit 062c5a9
Show file tree
Hide file tree
Showing 66 changed files with 42 additions and 154 deletions.
Binary file modified Libraries/Blades/Blades_Lib.slx
Binary file not shown.
Binary file modified Libraries/Blades/Blades_Testrig.slx
Binary file not shown.
Binary file modified Libraries/Blades/Flex_Blades/Wind_Turbine_Flexible_Blades.slx
Binary file not shown.
Binary file modified Libraries/Brakes/Brakes_Lib.slx
Binary file not shown.
Binary file modified Libraries/Environment/Inputs_Set_Busses_Testrig.slx
Binary file not shown.
Binary file modified Libraries/Environment/Turbine_Input_Lib.slx
Binary file not shown.
Binary file modified Libraries/Environment/Wind_Lib.slx
Binary file not shown.
Binary file modified Libraries/Environment/Wind_Testrig.slx
Binary file not shown.
Binary file modified Libraries/Geartrain/Geartrain_Lib.slx
Binary file not shown.
Binary file modified Libraries/Geartrain/Geartrain_Testrig.slx
Binary file not shown.
Binary file modified Libraries/Generator/Generator_Lib.slx
Binary file not shown.
Binary file modified Libraries/Generator/Generator_Testrig.slx
Binary file not shown.
Binary file modified Libraries/Main_Controller/Main_Controller_Lib.slx
Binary file not shown.
Binary file modified Libraries/Main_Controller/SLDV/ControlLogic.slx
Binary file not shown.
Binary file modified Libraries/Main_Controller/SLDV/ControlLogic_Ports.slx
Binary file not shown.
Binary file modified Libraries/Main_Controller/SLDV/ControlLogic_Testrig.slx
Binary file not shown.
Binary file modified Libraries/Main_Controller/Turbine_State_Machine_Lib.slx
Binary file not shown.
Binary file modified Libraries/Main_Controller/Turbine_State_Machine_Testrig.slx
Binary file not shown.
Binary file modified Libraries/Nacelle/Hub_Axis_Lib.slx
Binary file not shown.
Binary file modified Libraries/Pitch_Actuation/Hydraulic_Actuator_Lib.slx
Binary file not shown.
Binary file modified Libraries/Pitch_Actuation/Pitch_Actuation_Hydraulic_Testrig.slx
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ function Pitch_Actuation_Hydraulic_Testrig_setsolver(mdl,deskreal)
realtime_localSolver = 'NE_BACKWARD_EULER_ADVANCER';
realtime_globalSolver = 'ode3';

solverBlock_pth = find_system(mdl,'FollowLinks','on','LookUnderMasks','on', 'SubClassName', 'solver');
f = Simulink.FindOptions('FollowLinks',0,'LookUnderMasks','none');
solverBlock_pth = Simulink.findBlocks(mdl, 'SubClassName', 'solver',f);

if strcmpi(deskreal,'desktop')
set_param(mdl,'Solver',desktop_solver);
for svb_i=1:size(solverBlock_pth,1)
set_param(char(solverBlock_pth(svb_i)), 'UseLocalSolver','off','DoFixedCost','off');
set_param(solverBlock_pth(svb_i), 'UseLocalSolver','off','DoFixedCost','off');
end
else
set_param(mdl,'Solver',realtime_globalSolver,'FixedStep','auto');
for svb_i=1:size(solverBlock_pth,1)
set_param(char(solverBlock_pth(svb_i)),...
set_param(solverBlock_pth(svb_i),...
'UseLocalSolver','on',...
'DoFixedCost','on',...
'MaxNonlinIter',realtime_nonlinIter,...
Expand Down
Binary file modified Libraries/Pitch_Actuation/Pitch_Actuation_Lib.slx
Binary file not shown.
Binary file modified Libraries/Pitch_Actuation/Pitch_Actuation_Linkage.slx
Binary file not shown.
Binary file modified Libraries/Pitch_Actuation/Pitch_Actuation_Linkage_Lib.slx
Binary file not shown.
Binary file modified Libraries/Pitch_Actuation/Pitch_System_Lib.slx
Binary file not shown.
Binary file modified Libraries/Pitch_Controller/Pitch_Control_Hydraulic_Testrig.slx
Binary file not shown.
Binary file modified Libraries/Pitch_Controller/Pitch_Control_Ideal_Testrig.slx
Binary file not shown.
Binary file not shown.
Binary file modified Libraries/Pitch_Controller/Pitch_Controller_Lib.slx
Binary file not shown.
Binary file modified Libraries/Tower/Tower.slx
Binary file not shown.
Binary file modified Libraries/Yaw_Actuation/Yaw_Actuation_Lib.slx
Binary file not shown.
Binary file modified Libraries/Yaw_Actuation/Yaw_Actuation_Testrig.slx
Binary file not shown.
Binary file modified Libraries/Yaw_Actuation/Yaw_Gearbox_Lib.slx
Binary file not shown.
Binary file modified Libraries/Yaw_Actuation/Yaw_Gearbox_Testrig.slx
Binary file not shown.
Binary file modified Libraries/Yaw_Actuation/Yaw_Ideal_Actuator_Lib.slx
Binary file not shown.
Binary file modified Libraries/Yaw_Actuation/Yaw_Ideal_Motor_Lib.slx
Binary file not shown.
Binary file modified Libraries/Yaw_Actuation/Yaw_Motor_Lib.slx
Binary file not shown.
Binary file modified Libraries/Yaw_Actuation/Yaw_System_Lib.slx
Binary file not shown.
Binary file modified Libraries/Yaw_Controller/Yaw_Controller_Lib.slx
Binary file not shown.
41 changes: 0 additions & 41 deletions Scripts_Data/Break_All_Links.m

This file was deleted.

10 changes: 0 additions & 10 deletions Scripts_Data/Remove_Images.m

This file was deleted.

10 changes: 0 additions & 10 deletions Scripts_Data/Remove_Mask_Image_Dependency.m

This file was deleted.

10 changes: 0 additions & 10 deletions Scripts_Data/Set_Body_Color_White.m

This file was deleted.

4 changes: 1 addition & 3 deletions Scripts_Data/Setup_Pitch_Control_Design.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
% Copyright 2009-2022 The MathWorks(TM), Inc.

BlocksToSwitch = 'Pitch Controller';

BlockPath = find_system('Wind_Turbine','FollowLinks','on','Name',BlocksToSwitch);
BlockPath = 'Wind_Turbine/Pitch Controller';

% GET BLOCK INFO (INSTANCE AND SOURCE)

Expand Down
24 changes: 14 additions & 10 deletions Scripts_Data/Setup_WT_Configurations.m
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
% Copyright 2009-2022 The MathWorks(TM), Inc.

hub_axis_path = char(find_system(gcs,'FollowLinks','on','Name','Hub Axis'));
blade_load_path = char(find_system(gcs,'FollowLinks','on','Name','Blade Load'));
pitch_controller_path = char(find_system(gcs,'FollowLinks','off','Name','Pitch Controller')); % OFF TO CATCH ONLY TOP LEVEL
yaw_controller_path = char(find_system(gcs,'FollowLinks','off','Name','Yaw Controller')); % OFF TO CATCH ONLY TOP LEVEL
main_controller_path = char(find_system(gcs,'FollowLinks','on','Name','Main Controller'));
pitch_system_path = char(find_system(gcs,'FollowLinks','on','Name','Pitch System'));
yaw_system_path = char(find_system(gcs,'FollowLinks','on','Name','Yaw System'));
geartrain_system_path = char(find_system(gcs,'FollowLinks','on','Name','Geartrain'));
generator_system_path = char(find_system(gcs,'FollowLinks','on','Name','Generator'));
turbine_input_path = char(find_system(gcs,'FollowLinks','off','Name','Turbine Input'));
f = Simulink.FindOptions('FollowLinks',1);
hub_axis_path = getfullname(Simulink.findBlocks(bdroot,'Name','Hub Axis',f));
blade_load_path = getfullname(Simulink.findBlocks(bdroot,'Name','Blade Load',f));
main_controller_path = getfullname(Simulink.findBlocks(bdroot,'Name','Main Controller',f));
pitch_system_path = getfullname(Simulink.findBlocks(bdroot,'Name','Pitch System',f));
yaw_system_path = getfullname(Simulink.findBlocks(bdroot,'Name','Yaw System',f));
geartrain_system_path = getfullname(Simulink.findBlocks(bdroot,'Name','Geartrain',f));
generator_system_path = getfullname(Simulink.findBlocks(bdroot,'Name','Generator',f));

f = Simulink.FindOptions('FollowLinks',0);
turbine_input_path = getfullname(Simulink.findBlocks(bdroot,'Name','Turbine Input',f));
pitch_controller_path = getfullname(Simulink.findBlocks(bdroot,'Name','Pitch Controller',f));
yaw_controller_path = getfullname(Simulink.findBlocks(bdroot,'Name','Yaw Controller',f));


WT_Configs_TBL_COLS = {'Type' 'BLADE LOAD' 'GEARTRAIN' 'GENERATOR' 'HUB AXIS' 'TURBINE INPUTS' 'MAIN CONTROLLER' 'PITCH ACTUATOR' 'PITCH CONTROLLER' 'YAW ACTUATOR' 'YAW CONTROLLER' 'SIM_TIME'};
WT_Configs_TABLE{1} = {'I_Pitch Test' 'Torque' 'Empty' 'Simple' 'Locked' 'Commands' 'Direct Input' 'Ideal' 'Inner Loop' 'Locked' 'Speed Limit' 15}; % 15
Expand Down
4 changes: 2 additions & 2 deletions Scripts_Data/Wind_Turbine_Demo_Script.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>Wind Turbine Demo Script</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-12"><meta name="DC.source" content="Wind_Turbine_Demo_Script.m"><style type="text/css">
--><title>Wind Turbine Demo Script</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-16"><meta name="DC.source" content="Wind_Turbine_Demo_Script.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 @@ -97,7 +97,7 @@
<tr>... b.<a href="matlab:cd(fileparts(which('Wind_Turbine_SLRT.m')));Wind_Turbine;edit Wind_Turbine_SLRT;">Full Turbine</a><br>
</style>
</style>
</p><p>Copyright 2009-2022 The MathWorks&#8482;, Inc.</p><p class="footer"><br><a href="https://www.mathworks.com/products/matlab/">Published with MATLAB&reg; R2022a</a><br></p></div><!--
</p><p>Copyright 2009-2022 The MathWorks&#8482;, Inc.</p><p class="footer"><br><a href="https://www.mathworks.com/products/matlab/">Published with MATLAB&reg; R2022b</a><br></p></div><!--
##### SOURCE BEGIN #####
%% Wind Turbine Demo Script
%
Expand Down
5 changes: 3 additions & 2 deletions Scripts_Data/Wind_Turbine_setdesktop.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ function Wind_Turbine_setdesktop(mdl)
% Copyright 2009-2022 The MathWorks, Inc.
set_param(mdl,'Solver','ODE23t','MaxStep','0.01');

tvar_solverBlock = find_system(mdl, 'SubClassName', 'solver');
f = Simulink.FindOptions('FollowLinks',0,'LookUnderMasks','none');
tvar_solverBlock = Simulink.findBlocks(bdroot, 'SubClassName', 'solver',f);

for i=1:size(tvar_solverBlock,1)
set_param(char(tvar_solverBlock(i)), 'UseLocalSolver','off','DoFixedCost','off');
set_param(tvar_solverBlock(i), 'UseLocalSolver','off','DoFixedCost','off');
end

%clear tvar_solverBlock
6 changes: 4 additions & 2 deletions Scripts_Data/Wind_Turbine_setrealtime.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ function Wind_Turbine_setrealtime(mdl)
tvar_StepSize = '0.01';
tvar_LocalSolver='NE_BACKWARD_EULER_ADVANCER';
set_param(mdl,'Solver','ode3','FixedStep','auto');
tvar_solverBlock = find_system(mdl, 'SubClassName', 'solver');

f = Simulink.FindOptions('FollowLinks',0,'LookUnderMasks','none');
tvar_solverBlock = Simulink.findBlocks(bdroot, 'SubClassName', 'solver',f);
for i=1:size(tvar_solverBlock,1)
set_param(char(tvar_solverBlock(i)), 'UseLocalSolver','on','DoFixedCost','on','MaxNonlinIter',tvar_Nonlinear_Iterations,'LocalSolverChoice',tvar_LocalSolver,'LocalSolverSampleTime',tvar_StepSize);
set_param(tvar_solverBlock(i), 'UseLocalSolver','on','DoFixedCost','on','MaxNonlinIter',tvar_Nonlinear_Iterations,'LocalSolverChoice',tvar_LocalSolver,'LocalSolverSampleTime',tvar_StepSize);
end
11 changes: 0 additions & 11 deletions Scripts_Data/Yaw_SL_Parameter_Estimation.m

This file was deleted.

8 changes: 0 additions & 8 deletions Scripts_Data/startup_Wind_Turbine.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@
end
cd(curr_proj.RootFolder);

% Testing for generated code
if(exist(['Libraries' filesep 'Pitch_Controller' filesep 'PCG'],'dir'))
addpath([pwd filesep 'Libraries' filesep 'Pitch_Controller' filesep 'PCG']);
cd(['Libraries' filesep 'Pitch_Controller' filesep 'PCG']);
startup_Pitch_Controller_PCG
cd(curr_proj.RootFolder);
end

Wind_Turbine_Parameters
load Actuator_Lookup_data

Expand Down
12 changes: 12 additions & 0 deletions Scripts_Data/wind_turbine_activeVariantBlock.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function blk = wind_turbine_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
Binary file modified Wind_Turbine.slx
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info location="wind_turbine_activeVariantBlock.m" type="File"/>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 062c5a9

Please sign in to comment.