Skip to content

Commit

Permalink
Update control interface (#366)
Browse files Browse the repository at this point in the history
* Update to latest scipy functions

* Update max_torque_rates

* minor changes to controller_interface

* update scipy version and DISCOn files

* sync with new WISDEM syntax

* pin to right version of wisdem

* Fix max_torque_rates with gearbox ratio

---------

Co-authored-by: AthulKrishnaSundarrajan <rajan.s.athul@gmail.com>
Co-authored-by: Garrett Barter <garrett.barter@nrel.gov>
  • Loading branch information
3 people authored Jul 11, 2024
1 parent 72b2a6a commit d621956
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions rosco/toolbox/control_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def __init__(self, lib_name, param_filename="DISCON.IN", **kwargs):
self.char_buffer = 500
self.avr_size = 500
self.sim_name = "simDEBUG"
self.pitch = 0 # option to provid initial blade pitch value

# Set kwargs, like DT
for k, w in kwargs.items():
Expand All @@ -89,7 +90,7 @@ def __init__(self, lib_name, param_filename="DISCON.IN", **kwargs):

def init_discon(self):
# Initialize
self.pitch = 0

self.torque = 0
# -- discon
self.discon = cdll.LoadLibrary(self.lib_name)
Expand All @@ -104,9 +105,9 @@ def init_discon(self):
self.avrSWAP[26] = 10 # HARD CODE initial wind speed = 10 m/s

# Blade pitch initial conditions
self.avrSWAP[3] = 0 * np.deg2rad(1)
self.avrSWAP[32] = 0 * np.deg2rad(1)
self.avrSWAP[33] = 0 * np.deg2rad(1)
self.avrSWAP[3] = self.pitch * np.deg2rad(1)
self.avrSWAP[32] = self.pitch * np.deg2rad(1)
self.avrSWAP[33] = self.pitch * np.deg2rad(1)

self.avrSWAP[27] = 1 # IPC

Expand Down Expand Up @@ -212,6 +213,12 @@ def call_controller(self, turbine_state, end=False):
except KeyError:
self.avrSWAP[82] = 0

# pass translational acceleration
try:
self.avrSWAP[52] = turbine_state['FA_Acc']
except KeyError:
self.avrSWAP[52] = 0

# call controller
self.call_discon()

Expand Down

0 comments on commit d621956

Please sign in to comment.