Skip to content

Commit

Permalink
Flap tuning parameters as yaml inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhar-abbas committed Feb 11, 2020
1 parent 6c27b38 commit 0693276
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
14 changes: 8 additions & 6 deletions ROSCO_toolbox/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ def __init__(self, controller_params):
self.omega_pc = controller_params['omega_pc']
self.zeta_vs = controller_params['zeta_vs']
self.omega_vs = controller_params['omega_vs']
if self.Flp_Mode > 0:
self.zeta_flp = controller_params['zeta_flp']
self.omega_flp = controller_params['omega_flp']

# Optional parameters, default to standard if not defined
if controller_params['min_pitch']:
Expand Down Expand Up @@ -280,6 +283,7 @@ def tune_controller(self, turbine):
self.flp_angle = 0.0
self.tune_flap_controller(turbine)
else:
self.flp_angle = 0.0
self.Ki_flap = np.array([0.0])
self.Kp_flap = np.array([0.0])

Expand Down Expand Up @@ -349,14 +353,12 @@ def tune_flap_controller(self,turbine):
omegaf = turbine.bld_flapwise_freq

# Desired Closed loop response
zeta = 1.0
# omega = turbine.bld_flapwise_freq*(0.5)
ts = 1/(turbine.rated_rotor_speed/(2*pi)) / 2 # Closed-loop omega at 1/2 1P frequency
omega = 4.6/(ts*zeta)
# zeta = self.zeta_flp
# omega = 4.6/(ts*zeta)

# PI Gains
self.Kp_flap = -(2*zeta*omega - 2*zetaf*omegaf)/(kappa*omegaf**2)
self.Ki_flap = -(omega**2 - omegaf**2)/(kappa*omegaf**2)
self.Kp_flap = -(2*self.zeta_flp*self.omega_flp - 2*zetaf*omegaf)/(kappa*omegaf**2)
self.Ki_flap = -(self.omega_flp**2 - omegaf**2)/(kappa*omegaf**2)

class ControllerBlocks():
'''
Expand Down
5 changes: 4 additions & 1 deletion Tune_Cases/BAR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@ controller_params:
PS_Mode: 0 # Peak shaving mode {0: no peak shaving, 1: implement peak shaving}
SD_Mode: 0 # Shutdown mode {0: no shutdown procedure, 1: pitch to max pitch at shutdown}
Fl_Mode: 0 # Floating specific feedback mode {0: no nacelle velocity feedback, 1: nacelle velocity feedback}
Flp_Mode: 2 # Flap control mode {0: no flap control, 1: steady state flap angle, 2: Proportional flap control}
Flp_Mode: 0 # Flap control mode {0: no flap control, 1: steady state flap angle, 2: Proportional flap control}
# Controller parameters
zeta_pc: 1.2 # Pitch controller desired damping ratio [-]
omega_pc: 0.1 # Pitch controller desired natural frequency [rad/s]
zeta_vs: 0.5 # Torque controller desired damping ratio [-]
omega_vs: 0.1 # Torque controller desired natural frequency [rad/s]
# Only needed if Flp_Mode > 0
zeta_flp: # None 0.5 # Flap controller desired damping ratio [-]
omega_flp: # None 0.1 # Flap controller desired natural frequency [rad/s]
# Optional - these can be defined, but do not need to be
max_pitch: # None # Maximum pitch angle [rad], {default = 90 degrees}
min_pitch: # None # Minimum pitch angle [rad], {default = 0 degrees}
Expand Down
10 changes: 5 additions & 5 deletions Tune_Cases/DISCON.IN
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Controller parameter input file for the RotorSE_FAST_BAR_2010n_noRe wind turbine
! - File written using ROSCO Controller tuning logic on 02/07/20
! - File written using ROSCO Controller tuning logic on 02/11/20

!------- DEBUG ------------------------------------------------------------
1 ! LoggingLevel - {0: write no debug files, 1: write standard output .dbg-file, 2: write standard output .dbg-file and complete avrSWAP-array .dbg2-file}
Expand All @@ -16,7 +16,7 @@
0 ! PS_Mode - Pitch saturation mode {0: no pitch saturation, 1: implement pitch saturation}
0 ! SD_Mode - Shutdown mode {0: no shutdown procedure, 1: pitch to max pitch at shutdown}
0 ! Fl_Mode - Floating specific feedback mode {0: no nacelle velocity feedback, 1: nacelle velocity feedback}
2 ! Flp_Mode - Flap control mode {0: no flap control, 1: steady state flap angle, 2: Proportional flap control}
0 ! Flp_Mode - Flap control mode {0: no flap control, 1: steady state flap angle, 2: Proportional flap control}

!------- FILTERS ----------------------------------------------------------
0.81771 ! F_LPFCornerFreq - Corner frequency (-3dB point) in the low-pass filters, [rad/s]
Expand Down Expand Up @@ -79,7 +79,7 @@
96.8 ! WE_GearboxRatio - Gearbox ratio [>=1], [-]
311169343.31448 ! WE_Jtot - Total drivetrain inertia, including blades, hub and casted generator inertia to LSS, [kg m^2]
1.225 ! WE_RhoAir - Air density, [kg m^-3]
"../BAR_00/Cp_Ct_Cq.BAR.txt" ! PerfFileName - File containing rotor performance tables (Cp,Ct,Cq)
"../Tune_Cases/Cp_Ct_Cq.BAR.txt" ! PerfFileName - File containing rotor performance tables (Cp,Ct,Cq)
104 48 ! PerfTableSize - Size of rotor performance tables, first number refers to number of blade pitch angles, second number referse to number of tip-speed ratios
44 ! WE_FOPoles_N - Number of first-order system poles used in EKF
3.00 3.50 4.00 4.50 5.00 5.50 6.00 6.50 7.00 7.50 8.00 8.77 9.27 9.77 10.27 10.77 11.27 11.77 12.27 12.77 13.27 13.77 14.27 14.77 15.27 15.77 16.27 16.77 17.27 17.77 18.27 18.77 19.27 19.77 20.27 20.77 21.27 21.77 22.27 22.77 23.27 23.77 24.27 24.77 ! WE_FOPoles_v - Wind speeds corresponding to first-order system poles [m/s]
Expand Down Expand Up @@ -117,5 +117,5 @@

!------- FLAP ACTUATION -----------------------------------------------------
0.000000000000 ! Flp_Angle - Initial or steady state flap angle [rad]
6.31118604e-10 ! Flp_Kp - Blade root bending moment proportional gain for flap control [s]
4.17673981e-08 ! Flp_Ki - Flap displacement integral gain for flap control [s]
0.00000000e+00 ! Flp_Kp - Blade root bending moment proportional gain for flap control [s]
0.00000000e+00 ! Flp_Ki - Flap displacement integral gain for flap control [s]

0 comments on commit 0693276

Please sign in to comment.