Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed-Pitch Torque Control in Region 3 #347

Open
wants to merge 183 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 176 commits
Commits
Show all changes
183 commits
Select commit Hold shift + click to select a range
ae7b267
Update example 05 units
dzalkind Sep 12, 2022
778822b
Add generator efficiency to power output of simple simulation
dzalkind Sep 12, 2022
86c8acf
Update Windows install instructions
dzalkind Sep 12, 2022
b933b3b
Add rotor speed tracking, test case
dzalkind Sep 13, 2022
34ca985
Update discons
dzalkind Sep 14, 2022
2efac84
Adding pitch actuator fault (#163)
mayankchetan Sep 26, 2022
decd694
Various Bug Fixes (#167)
dzalkind Sep 28, 2022
9384f03
Added feature to read AeroDyn 14 files also for the case without towe…
verlivkra Oct 14, 2022
602332e
Various Bug Fixes (#188)
dzalkind Dec 12, 2022
827b281
Update sim.py (#196)
aclerc Dec 19, 2022
5ad1d41
Doc fix (#200)
dzalkind Dec 22, 2022
9d27a33
OpenFAST v3.3.0 (#202)
dzalkind Dec 23, 2022
75a648c
AWC First Version, collected changes
ndevelder Jan 17, 2023
05d7b3b
Compatibility with Numpy v1.24 (#208)
gbarter Jan 18, 2023
f5428de
Merge remote-tracking branch 'upstream/develop' into rosco_awc_merge
dzalkind Jan 18, 2023
0be88d4
Add AWC parameters to registry, regenerate types
dzalkind Jan 23, 2023
1e80263
Apply DbKi to COMPLEX
dzalkind Jan 23, 2023
0575d75
Re-organize AWC pitch contribution, before actuator
dzalkind Jan 23, 2023
974e271
Separate contribution to PitCom from mode calculation
dzalkind Jan 23, 2023
515da17
Make AWC_complexangle a LocalVar for logging
dzalkind Jan 23, 2023
be28641
Allow PA_Mode 1 (#213)
dzalkind Jan 25, 2023
e554c1d
IPC Saturation Fix [RAAW] (#210)
dzalkind Jan 26, 2023
c51ed30
Removed duplicate pitch assignment and removed MinPitch mods for AWC
ndevelder Jan 27, 2023
3155b63
Add script for updating DISCON versions (#214)
dzalkind Feb 2, 2023
0c0e466
Fixes to readsetparams and awc location
ndevelder Feb 3, 2023
20c9c9d
Adding NREL 2.8 127 for AWC testing
ndevelder Feb 3, 2023
a1cf97b
Rename examples (#215)
dzalkind Feb 7, 2023
42525a9
V270 prep (#218)
dzalkind Feb 10, 2023
f5c3c1e
Add case generation updates
dzalkind Feb 10, 2023
a471783
Add initial AWC example, needs OF3.4
dzalkind Feb 10, 2023
2f941e3
Merge remote-tracking branch 'upstream/main' into develop
dzalkind Feb 10, 2023
d05ef6c
Merge branch 'develop' into rosco_awc_merge
dzalkind Feb 10, 2023
80bd691
Add AWC_Mode and move AWC into subroutine
dzalkind Feb 10, 2023
b102b34
Update example to point to correct inputs
dzalkind Feb 10, 2023
5c5333b
Remove LocalVar%PC_MinPit = CntrPar%PC_MinPit, breaking setpoint smoo…
dzalkind Feb 10, 2023
da46fac
Set min pitch for AWC
dzalkind Feb 10, 2023
cc4080d
Tidy up input additions
dzalkind Feb 10, 2023
1201a66
Update other DISCONs
dzalkind Feb 10, 2023
1693602
Add AWC to toolbox schema
dzalkind Feb 10, 2023
2bb0176
Tidy example
dzalkind Feb 10, 2023
d93d443
Update AWC example with instructions/theory
ndevelder Feb 14, 2023
3c40565
Formatting fixes
ndevelder Feb 14, 2023
83022e5
Prep for more modes
dzalkind Feb 15, 2023
a7d3303
Merge remote-tracking branch 'upstream/main' into develop
dzalkind Feb 15, 2023
f6d061f
Update 20_active_wake_control.py
kbrown1snl Feb 16, 2023
1824f99
Fix units in schema
dzalkind Feb 16, 2023
cabbb2a
Merge pull request #1 from kbrown1snl/patch-1
ndevelder Feb 17, 2023
de16ecd
Test all AWC cases in example 20
dzalkind Feb 17, 2023
de3a6fe
Tidy up DISCON file writing
dzalkind Feb 17, 2023
87b3f09
Revert setup directory
dzalkind Feb 17, 2023
46e7168
Update 20_active_wake_control.py
kbrown1snl Feb 22, 2023
32dc9fd
Update NREL-2p8-127_DISCON.IN
kbrown1snl Feb 24, 2023
ae5090b
Update Controllers.f90
kbrown1snl Feb 24, 2023
5c878ad
Update ROSCO_Types.f90
kbrown1snl Feb 24, 2023
baaa8db
Update ReadSetParameters.f90
kbrown1snl Feb 24, 2023
b141c4e
Update 20_active_wake_control.py
kbrown1snl Feb 24, 2023
826ca01
Update toolbox_schema.yaml
kbrown1snl Feb 24, 2023
797e554
Update utilities.py
kbrown1snl Feb 24, 2023
ff0ce39
Update rosco_types.yaml
kbrown1snl Feb 24, 2023
3bc2185
Added NREL-developed AWC-implementation
jfrederik-nrel Feb 27, 2023
687b760
Undo unintentional changes to wrie_registry.py
jfrederik-nrel Feb 28, 2023
70d5771
Fix file writing in AWC section
dzalkind Feb 28, 2023
b24f07b
Merge remote-tracking branch 'upstream/develop' into awc
dzalkind Feb 28, 2023
a9ec14e
Update all DISCONs
dzalkind Feb 28, 2023
4604ebb
Add 20_awc to test_examples
dzalkind Feb 28, 2023
b17f350
Add 2.8 to update_discons, regenerate DISCON
dzalkind Feb 28, 2023
b2fdfbc
Update AWC_Mode descriptions
dzalkind Feb 28, 2023
e899600
Updated Coleman Transformation based AWC
jfrederik-nrel Mar 7, 2023
1ccc1b3
Platform control and Optional Inputs (#227)
dzalkind Mar 7, 2023
87cde8c
Merge remote-tracking branch 'upstream/develop' into awc
dzalkind Mar 7, 2023
8ea0a4c
Merge remote-tracking branch 'jfred/AWC_NREL' into awc
dzalkind Mar 7, 2023
daf77e9
Merge remote-tracking branch 'ndev/rosco_awc_merge' into awc
dzalkind Mar 7, 2023
ca7c44d
Tidy print statements, file writing
dzalkind Mar 7, 2023
4e2a778
Remove duplicate PF_Offsets input read
dzalkind Mar 7, 2023
74c7fcb
Rename methods in readme
dzalkind Mar 7, 2023
e4d7ec2
Tidy input writing, remove `future` references
dzalkind Mar 7, 2023
4194da4
Force AWC_n into int
dzalkind Mar 8, 2023
c1e4be7
Force AWC_n into int better
dzalkind Mar 8, 2023
5e75601
Make AWC_n a list, too
dzalkind Mar 8, 2023
de8d228
Fix input file writing, force into int in write_array
dzalkind Mar 8, 2023
e1379de
Run ROSCO_testing from anywhere
dzalkind Mar 8, 2023
2947b4f
Dylib -> so in Test_Cases
dzalkind Mar 8, 2023
cae3f17
Updated AWC input parameters.
jfrederik-nrel Mar 15, 2023
bd4d7d5
Added checks for AWC inputs.
jfrederik-nrel Mar 16, 2023
1e25c88
Fixed bug in added AWC input checks.
jfrederik-nrel Mar 16, 2023
50f4191
Update error message
dzalkind Mar 20, 2023
50bd08c
Tidy up IPC, allow AWC and IPC with warning
dzalkind Mar 20, 2023
e02379d
Remove AWC references from IPC
dzalkind Mar 20, 2023
3851a6b
Remove lingering comment
dzalkind Mar 20, 2023
9d7e18d
Tidy file writing
dzalkind Mar 20, 2023
7f12c9c
Clean up comments
dzalkind Mar 20, 2023
8e4cf8b
Allow more than 99 local variables in dbg2
dzalkind Mar 20, 2023
bc33417
Update api_change.rst
jfrederik-nrel Mar 20, 2023
17ce1a5
Merge remote-tracking branch 'jfred/patch-1' into awc
dzalkind Mar 20, 2023
728c61d
Update 20_active_wake_control.py
kbrown1snl Mar 27, 2023
820aa66
Merge pull request #2 from kbrown1snl/patch-2
dzalkind Mar 27, 2023
90c4041
Add optimized NREL2p8 controller input
dzalkind Mar 30, 2023
5afb385
Parallelize output processing
dzalkind Apr 3, 2023
fbb44c4
Add IPC gain to NREL2p8
dzalkind Apr 3, 2023
fe24704
Merge remote-tracking branch 'upstream/develop' into power_ref_tracking
dzalkind Apr 3, 2023
52e3708
Finish merge with inputs and registry
dzalkind Apr 3, 2023
1e38c90
Update IPC example for testing sat modes
dzalkind Apr 3, 2023
e49f383
Add latest plot_FAST notebook
dzalkind Apr 3, 2023
9e5fd58
Add PRC example
dzalkind Apr 3, 2023
f1037ec
Merge remote-tracking branch 'origin/awc' into power_ref_tracking
dzalkind Apr 3, 2023
099532b
Finish merge with awc inputs and registry
dzalkind Apr 3, 2023
5a7046f
Active Wake Control (#230)
dzalkind Apr 3, 2023
8a39f3c
Update example with ramp, reference
dzalkind Apr 3, 2023
7669419
Merge remote-tracking branch 'upstream/develop' into power_ref_tracking
dzalkind Apr 3, 2023
de15e52
Various bug fixes (#233)
dzalkind Apr 4, 2023
ac14b17
Init PC_RefSpeed if no PRC
dzalkind Apr 5, 2023
60b366d
Revert openfast changes
dzalkind Apr 5, 2023
24bded0
Add note about offset
dzalkind Apr 5, 2023
585e2c8
Open loop platform control (#236)
dzalkind Apr 10, 2023
339ad53
Tidy example output
dzalkind Apr 10, 2023
79426f7
Increment version number
dzalkind Apr 10, 2023
90357a2
Merge remote-tracking branch 'upstream/develop' into power_ref_tracking
dzalkind Apr 20, 2023
12f8fdb
Merge remote-tracking branch 'upstream/main' into develop
dzalkind Jun 8, 2023
5fd97e2
Increment version number
dzalkind Jun 8, 2023
e5b1af5
Yaw Rate Bug Fix (#239)
dzalkind Jun 9, 2023
c701f67
OpenFAST 3.5.0 (#246)
dzalkind Jul 10, 2023
2f069da
Floating Feedback Gain Scheduling (#241)
alandwright Jul 20, 2023
9de385b
Merge remote-tracking branch 'upstream/develop' into power_ref_tracking
dzalkind Jul 24, 2023
d9547dd
Fix relative Cp filepaths
dzalkind Jul 24, 2023
178217b
Regenerate registry, inputs
dzalkind Jul 24, 2023
c641b54
Rotor Position Control (#255)
dzalkind Aug 4, 2023
31332d9
Update .readthedocs.yaml to remove use of 'system_packages' as it is …
abhineet-gupta Aug 9, 2023
63bcb0d
Extend ROSCO for MHK (#257)
AthulKrishnaSundarrajan Sep 19, 2023
716b2e4
Merge remote-tracking branch 'upstream/develop' into power_ref_tracking
dzalkind Sep 22, 2023
b27629b
Rename power ref example
dzalkind Sep 22, 2023
ea55560
Shorten PRC example
dzalkind Sep 22, 2023
b5eb5c0
Use updated DISCON writing functions for PRC inputs
dzalkind Sep 22, 2023
24052dc
Revert run_FAST cases
dzalkind Sep 25, 2023
3092e38
Tidy example documentation, output
dzalkind Sep 25, 2023
b817a5c
Bring back new VS_ControlMode that merge lost
dzalkind Sep 25, 2023
38f27de
Add LPF on WSE for speed selection, use gen speed rather than rotor
dzalkind Sep 26, 2023
d9a31fb
Document API changes
dzalkind Sep 26, 2023
32292e5
Bring back saturation of torque reference speed
dzalkind Sep 26, 2023
3b0bde0
Update PRC example with PRC_GenSpeeds
dzalkind Sep 26, 2023
e75baa2
Remove pCrunch notebook
dzalkind Sep 27, 2023
989ce5b
Merge pull request #170 from dzalkind/power_ref_tracking
abhineet-gupta Sep 27, 2023
2c76747
Increase max file unit (#253)
dzalkind Oct 6, 2023
b66cd11
Add types to scalars (#264)
rthedin Oct 17, 2023
0e80094
Update api_change.rst formatting
dzalkind Oct 17, 2023
f2a624d
Update .readthedocs.yaml with build.os
dzalkind Oct 17, 2023
6f1ccfa
Update .readthedocs.yaml with other build options
dzalkind Oct 17, 2023
80973fe
Update .readthedocs.yaml with python 3.9
dzalkind Oct 17, 2023
04d3f52
Update .readthedocs.yaml with new python version
dzalkind Oct 17, 2023
c479034
Update .readthedocs.yaml with another python version
dzalkind Oct 17, 2023
328d29e
Update .readthedocs.yaml with version key
dzalkind Oct 17, 2023
8693d4b
Update .readthedocs.yaml
dzalkind Oct 17, 2023
dd01047
Update .readthedocs.yaml remove old python version
dzalkind Oct 17, 2023
a610e55
Better Open Loop Control Error Catching (#273)
dzalkind Oct 27, 2023
c75738e
Modified ZeroMQ interface to include pitch offsets (#261)
mvanv Nov 6, 2023
1961f95
Merged upstream/develop
Mar 27, 2024
0ddbf0d
Merge remote-tracking branch 'upstream/develop' into develop
May 8, 2024
f846f17
Initial implementation of fixed blade pitch control for MHK turbines.…
May 9, 2024
748d975
Remove extra test_cases
dzalkind May 10, 2024
2787ff9
Expanded test script and made cc-blade Cp surface generation extend t…
May 10, 2024
c15e869
Merged and regenerated rotor performance in the right place
May 10, 2024
32ecfc8
updated DISCONs
May 10, 2024
8c57a31
Remove extra RefSpd localvars
dzalkind May 10, 2024
4c1202c
Merge remote-tracking branch 'ds/r3-fixed-pitch' into r3-fixed-pitch
dzalkind May 10, 2024
de4f6a7
Added overspeed config option and expanded Cp surface again
May 10, 2024
ae07303
Add constants for various VS_Control modes
dzalkind May 10, 2024
2df9e54
Regen registry
dzalkind May 10, 2024
8eab998
Cleaned up fixed pitch example script
May 10, 2024
38e28cf
Merge remote-tracking branch 'ds/r3-fixed-pitch' into r3-fixed-pitch
dzalkind May 10, 2024
1008cc6
Added comments to fixed pitch controller tuning, rearranged torque co…
May 13, 2024
25001e0
Finished renaming FBP variables and VS ref speed filter
May 13, 2024
822b731
Regenerated DISCONs
May 13, 2024
e639706
Merge remote-tracking branch 'ds/r3-fixed-pitch' into r3-fixed-pitch
dzalkind May 15, 2024
7726f0d
Disable the pitch controller at the DISCON level
dzalkind May 15, 2024
01121e2
Working on overspeed operating schedule, still not yet giving stable …
May 15, 2024
be58bbb
Merge branch 'r3-fixed-pitch' of https://github.com/dstockhouse/ROSCO…
May 15, 2024
102286d
Considerable cahnges to fixed-blade-pitch (FBP) operation for marine …
Jul 25, 2024
ead419d
Merge remote-tracking branch 'upstream/develop' into develop
Aug 15, 2024
f0debea
Merged branch upstream/develop
Aug 15, 2024
6216972
Fixed bug in FBP control with VS_RefSpd turning to NaN if GenTq ever …
Aug 21, 2024
ce1b0eb
Revised usage of generator and gearbox efficiencies in toolbox contro…
Aug 22, 2024
44703b6
Modified comments related to GBoxEff in rng2K calculation
Sep 5, 2024
d77ba20
Restructured some controller code related to saturation, attempted to…
Sep 18, 2024
6d79062
Added more precise calculation of Cp-optimizing pitch and updated the…
Sep 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
190 changes: 190 additions & 0 deletions Examples/29_marine_hydro_fbp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
'''
----------- 29_marine_hydro_fbp ---------------
Run openfast with ROSCO and a MHK turbine with fixed blade pitch control
-----------------------------------------------


'''

import os
from rosco.toolbox.ofTools.case_gen.run_FAST import run_FAST_ROSCO
from rosco.toolbox.ofTools.case_gen import CaseLibrary as cl
from rosco.toolbox.ofTools.fast_io import output_processing
from rosco.toolbox import controller as ROSCO_controller
from rosco.toolbox import turbine as ROSCO_turbine
from rosco.toolbox import utilities as ROSCO_utilities
from rosco.toolbox.utilities import write_DISCON
from rosco.toolbox.inputs.validation import load_rosco_yaml
import matplotlib.pyplot as plt
import numpy as np

'''
Run MHK turbine in OpenFAST with ROSCO torque controller


'''


#directories
this_dir = os.path.dirname(os.path.abspath(__file__))
rosco_dir = os.path.dirname(this_dir)
example_out_dir = os.path.join(this_dir, 'examples_out')
os.makedirs(example_out_dir,exist_ok=True)

def main():

# Input yaml and output directory
parameter_filename = os.path.join(this_dir, 'Tune_Cases/RM1_MHK_FBP.yaml')
tune_dir = os.path.dirname(parameter_filename)
run_dir = os.path.join(example_out_dir, '29_MHK/0_baseline')
os.makedirs(run_dir,exist_ok=True)

inps = load_rosco_yaml(parameter_filename)
path_params = inps['path_params']
turbine_params = inps['turbine_params']
controller_params = inps['controller_params']

# Instantiate turbine, controller, and file processing classes
turbine = ROSCO_turbine.Turbine(turbine_params)
controller = ROSCO_controller.Controller(controller_params)

# Load turbine data from OpenFAST and rotor performance text file
cp_filename = os.path.join(tune_dir, path_params['rotor_performance_filename'])
turbine.load_from_fast(
path_params['FAST_InputFile'],
os.path.join(tune_dir, path_params['FAST_directory']),
rot_source='txt', txt_filename= cp_filename
)


### Tune controller cases
# Constant power underspeed (should be the default)
controller_params_1 = controller_params.copy()
controller_params_1['VS_FBP'] = 3 # Power reference
controller_params_1['VS_FBP_speed_mode'] = 0
controller_params_1['VS_FBP_P'] = [1.0, 1.0]
controller_1 = ROSCO_controller.Controller(controller_params_1)
controller_1.tune_controller(turbine)

# Constant power overspeed
controller_params_2 = controller_params.copy()
controller_params_2['VS_FBP'] = 2 # Switch to WSE reference
controller_params_2['VS_FBP_speed_mode'] = 1
controller_params_2['VS_FBP_P'] = [1.0, 1.0]
controller_2 = ROSCO_controller.Controller(controller_params_2)
controller_2.tune_controller(turbine)

# Linear increasing power
controller_params_3 = controller_params.copy()
controller_params_3['VS_FBP_speed_mode'] = 0
controller_params_3['VS_FBP_P'] = [1.0, 2.0]
controller_3 = ROSCO_controller.Controller(controller_params_3)
controller_3.tune_controller(turbine)

# Linear increasing power, leveling out
controller_params_4 = controller_params.copy()
controller_params_4['VS_FBP_U'] = [2.0, 3.0]
controller_params_4['VS_FBP_P'] = [1.0, 2.0]
controller_4 = ROSCO_controller.Controller(controller_params_4)
controller_4.tune_controller(turbine)

# Generic numeric function
controller_params_5 = controller_params.copy()
controller_params_5['VS_FBP'] = 2 # WSE reference
controller_params_5['VS_FBP_U'] = [2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0]
controller_params_5['VS_FBP_P'] = [1.0, 1.3, 1.6, 1.8, 1.9, 2.0, 1.9, 1.8, 1.7, 1.6, 1.5]
controller_5 = ROSCO_controller.Controller(controller_params_5)
controller_5.tune_controller(turbine)

# Constant power overspeed, nonlinear lookup table control
controller_params_6 = controller_params.copy()
controller_params_6['VS_FBP'] = 0 # Constant power overspeed
controller_params_6['VS_FBP_speed_mode'] = 1
controller_params_6['VS_FBP_P'] = [1.0, 1.0]
controller_params_6['VS_ControlMode'] = 1
controller_6 = ROSCO_controller.Controller(controller_params_6)
controller_6.tune_controller(turbine)


plot_labels = ['Constant Power Underspeed', 'Constant Power Overspeed', 'Linear Increasing Power', 'Increasing Leveled Power', 'Generic User-Defined']
fig, axs = plt.subplots(3,1)
axs[0].plot(controller_1.v, controller_1.power_op, label=plot_labels[0])
axs[0].plot(controller_2.v, controller_2.power_op, label=plot_labels[1], linestyle='--')
axs[0].plot(controller_3.v, controller_3.power_op, label=plot_labels[2])
axs[0].plot(controller_4.v, controller_4.power_op, label=plot_labels[3])
axs[0].plot(controller_5.v, controller_5.power_op, label=plot_labels[4])
axs[0].set_ylabel('Gen Power [W]')
axs[1].plot(controller_1.v, controller_1.omega_gen_op, label=plot_labels[0])
axs[1].plot(controller_2.v, controller_2.omega_gen_op, label=plot_labels[1], linestyle='--')
axs[1].plot(controller_3.v, controller_3.omega_gen_op, label=plot_labels[2])
axs[1].plot(controller_4.v, controller_4.omega_gen_op, label=plot_labels[3])
axs[1].plot(controller_5.v, controller_5.omega_gen_op, label=plot_labels[4])
axs[1].set_ylabel('Gen Speed [rad/s]')
axs[2].plot(controller_1.v, controller_1.tau_op, label=plot_labels[0])
axs[2].plot(controller_2.v, controller_2.tau_op, label=plot_labels[1], linestyle='--')
axs[2].plot(controller_3.v, controller_3.tau_op, label=plot_labels[2])
axs[2].plot(controller_4.v, controller_4.tau_op, label=plot_labels[3])
axs[2].plot(controller_5.v, controller_5.tau_op, label=plot_labels[4])
axs[2].set_ylabel('Gen Torque [N m]')
axs[2].set_xlabel('Flow Speed [m/s]')
axs[0].legend(loc='upper left')

if False:
plt.show()
else:
fig_fname = os.path.join(example_out_dir, '29_marine_hydro_fbp_sched.png')
print('Saving figure ' + fig_fname)
plt.savefig(fig_fname)

# Write parameter input file for constant power underspeed controller
param_file = os.path.join(run_dir,'DISCON.IN')
write_DISCON(turbine,
controller_1,
param_file=param_file,
txt_filename=cp_filename
)


# simulation set up
# TODO: simulate multiple controller configurations in parallel
r = run_FAST_ROSCO()
r.tuning_yaml = parameter_filename
# r.wind_case_fcn = cl.simp_step # single step wind input
r.wind_case_fcn = cl.power_curve
r.wind_case_opts = {
'U': [3.0],
'TMax': 60.0,
}
r.case_inputs = {}
# r.fst_vt = reader.fst_vt
r.controller_params = controller_params_1
r.save_dir = run_dir
r.rosco_dir = rosco_dir

r.run_FAST()

op = output_processing.output_processing()
fast_out = op.load_fast_out([os.path.join(run_dir,'RM1_MHK_FBP/power_curve/base/RM1_MHK_FBP_0.out')], tmin=0)
fig, axs = plt.subplots(4,1)
axs[0].plot(fast_out[0]['Time'], fast_out[0]['Wind1VelX'], label='Constant Power Underspeed')
axs[0].set_ylabel('Flow Speed [m/s]')
axs[1].plot(fast_out[0]['Time'], fast_out[0]['GenSpeed'] * 2*np.pi/60, label='Constant Power Underspeed')
axs[1].set_ylabel('Gen Speed [rad/s]')
axs[2].plot(fast_out[0]['Time'], fast_out[0]['GenTq'] * 1e3, label='Constant Power Underspeed')
axs[2].set_ylabel('Gen Torque [N m]')
axs[3].plot(fast_out[0]['Time'], fast_out[0]['GenPwr'] * 1e3, label='Constant Power Underspeed')
axs[3].set_ylabel('Gen Power [W]')
axs[3].set_xlabel('Time [s]')

# TODO: Compare result to desired operating schedule

if False:
plt.show()
else:
fig_fname = os.path.join(example_out_dir, '29_marine_hydro_fbp_sim.png')
print('Saving figure ' + fig_fname)
plt.savefig(fig_fname)


if __name__=="__main__":
main()
13 changes: 13 additions & 0 deletions Examples/ROSCO_walkthrough.ipynb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
Expand Down Expand Up @@ -61,6 +62,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
Expand Down Expand Up @@ -133,6 +135,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
Expand All @@ -153,6 +156,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
Expand Down Expand Up @@ -197,6 +201,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
Expand Down Expand Up @@ -250,6 +255,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
Expand Down Expand Up @@ -287,6 +293,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
Expand Down Expand Up @@ -362,6 +369,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
Expand Down Expand Up @@ -423,6 +431,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
Expand Down Expand Up @@ -593,6 +602,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
Expand All @@ -604,6 +614,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
Expand Down Expand Up @@ -686,6 +697,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
Expand Down Expand Up @@ -724,6 +736,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"slideshow": {
Expand Down
15 changes: 11 additions & 4 deletions Examples/Test_Cases/BAR_10/BAR_10_DISCON.IN
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
! Controller parameter input file for the BAR_10 wind turbine
! - File written using ROSCO version 2.8.0 controller tuning logic on 01/05/24
! - File written using ROSCO version 2.9.0 controller tuning logic on 07/24/24

!------- SIMULATION CONTROL ------------------------------------------------------------
1 ! LoggingLevel - {0: write no debug files, 1: write standard output .dbg-file, 2: LoggingLevel 1 + ROSCO LocalVars (.dbg2) 3: LoggingLevel 2 + complete avrSWAP-array (.dbg3)}
0 ! DT_Out - {Time step to output .dbg* files, or 0 to match sampling period of OpenFAST}
1 ! Ext_Interface - (0 - use standard bladed interface, 1 - Use the extened DLL interface introduced in OpenFAST 3.5.0.)
1 ! Ext_Interface - (0 - use standard bladed interface, 1 - Use the extened DLL interface introduced in OpenFAST 3.5.0.)
0 ! Echo - (0 - no Echo, 1 - Echo input data to <RootName>.echo)

!------- CONTROLLER FLAGS -------------------------------------------------
2 ! F_LPFType - (1: first-order low-pass filter, 2: second-order low-pass filter), [rad/s] (currently filters generator speed and pitch control signals
0 ! IPC_ControlMode - Turn Individual Pitch Control (IPC) for fatigue load reductions (pitch contribution) {0: off, 1: 1P reductions, 2: 1P+2P reductions}
2 ! VS_ControlMode - Generator torque control mode in above rated conditions (0- no torque control, 1- k*omega^2 with PI transitions, 2- WSE TSR Tracking, 3- Power-based TSR Tracking)}
0 ! VS_ConstPower - Do constant power torque control, where above rated torque varies, 0 for constant torque}
0 ! VS_FBP - Fixed blade pitch configuration mode
1 ! PC_ControlMode - Blade pitch control mode {0: No pitch, fix to fine pitch, 1: active PI blade pitch control}
0 ! Y_ControlMode - Yaw control mode {0: no yaw control, 1: yaw rate control, 2: yaw-by-IPC}
1 ! SS_Mode - Setpoint Smoother mode {0: no setpoint smoothing, 1: introduce setpoint smoothing}
Expand Down Expand Up @@ -49,6 +50,7 @@
0.000000 1.000000 ! F_FlCornerFreq - Natural frequency and damping in the second order low pass filter of the tower-top fore-aft motion for floating feedback control [rad/s, -].
0.01042 ! F_FlHighPassFreq - Natural frequency of first-order high-pass filter for nacelle fore-aft motion [rad/s].
7.8480 1.0000 ! F_FlpCornerFreq - Corner frequency and damping in the second order low pass filter of the blade root bending moment for flap control
0.05000000000 ! F_VSRefSpdCornerFreq - Corner frequency (-3dB point) in the first order low pass filter of the generator speed reference used for TSR tracking torque control [rad/s].

!------- BLADE PITCH CONTROL ----------------------------------------------
30 ! PC_GS_n - Amount of gain-scheduling table entries
Expand Down Expand Up @@ -81,15 +83,20 @@
70282.09458000 ! VS_MaxTq - Maximum generator torque in Region 3 (HSS side), [Nm].
0.000000000000 ! VS_MinTq - Minimum generator torque (HSS side), [Nm].
27.49717000000 ! VS_MinOMSpd - Minimum generator speed [rad/s]
11.20801000000 ! VS_Rgn2K - Generator torque constant in Region 2 (HSS side). Only used in VS_ControlMode = 1,3
12.03868000000 ! VS_Rgn2K - Generator torque constant in Region 2 (HSS side). Only used in VS_ControlMode = 1,3,4
5000000.000000 ! VS_RtPwr - Wind turbine rated power [W]
63892.81326000 ! VS_RtTq - Rated torque, [Nm].
75.83317000000 ! VS_RefSpd - Rated generator speed [rad/s]
1 ! VS_n - Number of generator PI torque controller gains
-2452.07948000 ! VS_KP - Proportional gain for generator PI torque controller [-]. (Only used in the transitional 2.5 region if VS_ControlMode =/ 2)
-332.357190000 ! VS_KI - Integral gain for generator PI torque controller [s]. (Only used in the transitional 2.5 region if VS_ControlMode =/ 2)
9.76 ! VS_TSRopt - Power-maximizing region 2 tip-speed-ratio. Only used in VS_ControlMode = 2.
0.314000000000 ! VS_PwrFiltF - Low pass filter on power used to determine generator speed set point. Only used in VS_ControlMode = 3.

!------- FIXED PITCH REGION 3 TORQUE CONTROL ------------------------------------------------
60 ! VS_FBP_n - Number of gain-scheduling table entries
3.000000 3.181847 3.363694 3.545541 3.727388 3.909234 4.091081 4.272928 4.454775 4.636622 4.818469 5.000316 5.182163 5.364010 5.545857 5.727703 5.909550 6.091397 6.273244 6.455091 6.636938 6.818785 7.000632 7.182479 7.364326 7.546172 7.728019 7.909866 8.091713 8.273560 8.831108 9.388656 9.946204 10.503752 11.061300 11.618848 12.176396 12.733944 13.291492 13.849040 14.406588 14.964136 15.521684 16.079232 16.636780 17.194328 17.751876 18.309424 18.866972 19.424520 19.982068 20.539616 21.097164 21.654712 22.212260 22.769808 23.327356 23.884904 24.442452 25.000000 ! VS_FBP_U - Operating schedule table: Wind speeds [m/s].
27.497174 29.163932 30.830691 32.497450 34.164208 35.830967 37.497725 39.164484 40.831243 42.498001 44.164760 45.831518 47.498277 49.165035 50.831794 52.498553 54.165311 55.832070 57.498828 59.165587 60.832346 62.499104 64.165863 65.832621 67.499380 69.166138 70.832897 72.499656 74.166414 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 79.853125 ! VS_FBP_Omega - Operating schedule table: Generator speeds [rad/s].
9102.377387 10239.314561 11443.140643 12713.855635 14051.459535 15455.952344 16927.334062 18465.604688 20070.764223 21742.812668 23481.750020 25287.576282 27160.291453 29099.895532 31106.388520 33179.770417 35320.041223 37527.200937 39801.249560 42142.187093 44550.013533 47024.728883 49566.333142 52174.826309 54850.208385 57592.479370 60401.639263 63277.688066 66220.625777 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 65712.002182 ! VS_FBP_Tau - Operating schedule table: Generator torques [N m].

!------- SETPOINT SMOOTHER ---------------------------------------------
1.00000 ! SS_VSGain - Variable speed torque controller setpoint smoother gain, [-].
Expand Down
Loading
Loading