Skip to content

Commit

Permalink
Considerable cahnges to fixed-blade-pitch (FBP) operation for marine …
Browse files Browse the repository at this point in the history
…turbines. FBP modes changed so that any VS Region 2 mode can be paired with any FBP Region 3 mode, and the logic for controller switching has been restructured and (hopefully) made more readable. Still undergoing testing.
  • Loading branch information
David Stockhouse committed Jul 25, 2024
1 parent be58bbb commit 102286d
Show file tree
Hide file tree
Showing 17 changed files with 231 additions and 163 deletions.
50 changes: 30 additions & 20 deletions Examples/29_marine_hydro_fbp.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ def main():
### Tune controller cases
# Constant power underspeed (should be the default)
controller_params_1 = controller_params.copy()
controller_params_1['VS_FBP_ref_mode'] = 0 # Switch to WSE reference
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_ref_mode'] = 0 # Switch to WSE reference
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)
Expand All @@ -90,31 +90,41 @@ def main():

# Generic numeric function
controller_params_5 = controller_params.copy()
controller_params_5['VS_FBP_ref_mode'] = 0 # Switch to WSE reference
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='Constant Power Underspeed')
axs[0].plot(controller_2.v, controller_2.power_op, linestyle='--', label='Constant Power Overspeed')
axs[0].plot(controller_3.v, controller_3.power_op, label='Linear Increasing Power')
axs[0].plot(controller_4.v, controller_4.power_op, label='Increasing Leveled Power')
axs[0].plot(controller_5.v, controller_5.power_op, label='Generic')
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='Constant Power Underspeed')
axs[1].plot(controller_2.v, controller_2.omega_gen_op, linestyle='--', label='Constant Power Overspeed')
axs[1].plot(controller_3.v, controller_3.omega_gen_op, label='Linear Increasing Power')
axs[1].plot(controller_4.v, controller_4.omega_gen_op, label='Increasing Leveled Power')
axs[1].plot(controller_5.v, controller_5.omega_gen_op, label='Generic')
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='Constant Power Underspeed')
axs[2].plot(controller_2.v, controller_2.tau_op, linestyle='--', label='Constant Power Overspeed')
axs[2].plot(controller_3.v, controller_3.tau_op, label='Linear Increasing Power')
axs[2].plot(controller_4.v, controller_4.tau_op, label='Increasing Leveled Power')
axs[2].plot(controller_5.v, controller_5.tau_op, label='Generic')
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')
Expand All @@ -129,7 +139,7 @@ def main():
# Write parameter input file for constant power underspeed controller
param_file = os.path.join(run_dir,'DISCON.IN')
write_DISCON(turbine,
controller_2,
controller_1,
param_file=param_file,
txt_filename=cp_filename
)
Expand All @@ -147,7 +157,7 @@ def main():
}
r.case_inputs = {}
# r.fst_vt = reader.fst_vt
r.controller_params = controller_params_2
r.controller_params = controller_params_1
r.save_dir = run_dir
r.rosco_dir = rosco_dir

Expand Down
6 changes: 3 additions & 3 deletions Examples/Test_Cases/BAR_10/BAR_10_DISCON.IN
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Controller parameter input file for the BAR_10 wind turbine
! - File written using ROSCO version 2.9.0 controller tuning logic on 05/13/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)}
Expand All @@ -12,6 +12,7 @@
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 @@ -82,7 +83,7 @@
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]
12.03868000000 ! 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]
Expand All @@ -92,7 +93,6 @@
9.76 ! VS_TSRopt - Power-maximizing region 2 tip-speed-ratio. Only used in VS_ControlMode = 2.

!------- FIXED PITCH REGION 3 TORQUE CONTROL ------------------------------------------------
0 ! VS_FBP_RefMode - Reference control mode (0 - Use wind speed estimator, 1 - Use torque feedback)
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].
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Controller parameter input file for the IEA-15-240-RWT-UMaineSemi wind turbine
! - File written using ROSCO version 2.9.0 controller tuning logic on 05/13/24
! - File written using ROSCO version 2.9.0 controller tuning logic on 07/24/24

!------- SIMULATION CONTROL ------------------------------------------------------------
2 ! 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)}
Expand All @@ -12,6 +12,7 @@
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 @@ -82,7 +83,7 @@
21586451.33303 ! VS_MaxTq - Maximum generator torque in Region 3 (HSS side), [Nm].
0.000000000000 ! VS_MinTq - Minimum generator torque (HSS side), [Nm].
0.523600000000 ! VS_MinOMSpd - Minimum generator speed [rad/s]
32514899.86953 ! VS_Rgn2K - Generator torque constant in Region 2 (HSS side). Only used in VS_ControlMode = 1,3
32514899.86953 ! VS_Rgn2K - Generator torque constant in Region 2 (HSS side). Only used in VS_ControlMode = 1,3,4
15000000.00000 ! VS_RtPwr - Wind turbine rated power [W]
19624046.66639 ! VS_RtTq - Rated torque, [Nm].
0.791680000000 ! VS_RefSpd - Rated generator speed [rad/s]
Expand All @@ -92,7 +93,6 @@
9.00 ! VS_TSRopt - Power-maximizing region 2 tip-speed-ratio. Only used in VS_ControlMode = 2.

!------- FIXED PITCH REGION 3 TORQUE CONTROL ------------------------------------------------
0 ! VS_FBP_RefMode - Reference control mode (0 - Use wind speed estimator, 1 - Use torque feedback)
60 ! VS_FBP_n - Number of gain-scheduling table entries
3.000000 3.266897 3.533793 3.800690 4.067586 4.334483 4.601379 4.868276 5.135172 5.402069 5.668966 5.935862 6.202759 6.469655 6.736552 7.003448 7.270345 7.537241 7.804138 8.071034 8.337931 8.604828 8.871724 9.138621 9.405517 9.672414 9.939310 10.206207 10.473103 10.740000 11.215333 11.690667 12.166000 12.641333 13.116667 13.592000 14.067333 14.542667 15.018000 15.493333 15.968667 16.444000 16.919333 17.394667 17.870000 18.345333 18.820667 19.296000 19.771333 20.246667 20.722000 21.197333 21.672667 22.148000 22.623333 23.098667 23.574000 24.049333 24.524667 25.000000 ! VS_FBP_U - Operating schedule table: Wind speeds [m/s].
0.523599 0.523599 0.523599 0.523599 0.523599 0.523599 0.523599 0.523599 0.523599 0.523599 0.523599 0.523599 0.523599 0.523599 0.523599 0.525259 0.545276 0.565293 0.585310 0.605328 0.625345 0.645362 0.665379 0.685397 0.705414 0.725431 0.745448 0.765466 0.785483 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 0.791681 ! VS_FBP_Omega - Operating schedule table: Generator speeds [rad/s].
Expand Down
6 changes: 3 additions & 3 deletions Examples/Test_Cases/MHK_RM1/MHK_RM1_DISCON.IN
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Controller parameter input file for the MHK_RM1_Floating wind turbine
! - File written using ROSCO version 2.9.0 controller tuning logic on 05/13/24
! - File written using ROSCO version 2.9.0 controller tuning logic on 07/24/24

!------- SIMULATION CONTROL ------------------------------------------------------------
2 ! 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)}
Expand All @@ -12,6 +12,7 @@
0 ! IPC_ControlMode - Turn Individual Pitch Control (IPC) for fatigue load reductions (pitch contribution) {0: off, 1: 1P reductions, 2: 1P+2P reductions}
3 ! 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)}
1 ! 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 @@ -82,7 +83,7 @@
12450.50344000 ! VS_MaxTq - Maximum generator torque in Region 3 (HSS side), [Nm].
0.000000000000 ! VS_MinTq - Minimum generator torque (HSS side), [Nm].
19.00787000000 ! VS_MinOMSpd - Minimum generator speed [rad/s]
1.310360000000 ! VS_Rgn2K - Generator torque constant in Region 2 (HSS side). Only used in VS_ControlMode = 1,3
1.310360000000 ! VS_Rgn2K - Generator torque constant in Region 2 (HSS side). Only used in VS_ControlMode = 1,3,4
500000.0000000 ! VS_RtPwr - Wind turbine rated power [W]
8300.335630000 ! VS_RtTq - Rated torque, [Nm].
63.81200000000 ! VS_RefSpd - Rated generator speed [rad/s]
Expand All @@ -92,7 +93,6 @@
7.17 ! VS_TSRopt - Power-maximizing region 2 tip-speed-ratio. Only used in VS_ControlMode = 2.

!------- FIXED PITCH REGION 3 TORQUE CONTROL ------------------------------------------------
0 ! VS_FBP_RefMode - Reference control mode (0 - Use wind speed estimator, 1 - Use torque feedback)
60 ! VS_FBP_n - Number of gain-scheduling table entries
0.500000 0.551724 0.603448 0.655172 0.706897 0.758621 0.810345 0.862069 0.913793 0.965517 1.017241 1.068966 1.120690 1.172414 1.224138 1.275862 1.327586 1.379310 1.431034 1.482759 1.534483 1.586207 1.637931 1.689655 1.741379 1.793103 1.844828 1.896552 1.948276 2.000000 2.033333 2.066667 2.100000 2.133333 2.166667 2.200000 2.233333 2.266667 2.300000 2.333333 2.366667 2.400000 2.433333 2.466667 2.500000 2.533333 2.566667 2.600000 2.633333 2.666667 2.700000 2.733333 2.766667 2.800000 2.833333 2.866667 2.900000 2.933333 2.966667 3.000000 ! VS_FBP_U - Operating schedule table: Wind speeds [m/s].
19.007868 20.974199 22.940530 24.906861 26.873192 28.839524 30.805855 32.772186 34.738517 36.704848 38.671179 40.637511 42.603842 44.570173 46.536504 48.502835 50.469166 52.435498 54.401829 56.368160 58.334491 60.300822 62.267153 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 63.812000 ! VS_FBP_Omega - Operating schedule table: Generator speeds [rad/s].
Expand Down
Loading

0 comments on commit 102286d

Please sign in to comment.