Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhar-abbas committed Oct 19, 2019
1 parent fbb0a90 commit a19d7a8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions WTC_toolbox/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ class containing
print('Writing new controller parameter file parameter file %s.' % param_file)
file = open(param_file,'w')
file.write('! Controller parameter input file for the %s wind turbine\n' % turbine.TurbineName)
file.write('! - File written using NREL Baseline Controller tuning logic on %s\n' % now.strftime('%m/%d/%y'))
file.write('! - File written using NREL Reference Controller tuning logic on %s\n' % now.strftime('%m/%d/%y'))
file.write('\n')
file.write('!------- DEBUG ------------------------------------------------------------\n')
file.write('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\n')
Expand All @@ -301,7 +301,7 @@ class containing
file.write('0 ! Y_ControlMode - Yaw control mode {0: no yaw control, 1: yaw rate control, 2: yaw-by-IPC}\n')
file.write('1 ! SS_Mode - Setpoint Smoother mode {0: no setpoint smoothing, 1: introduce setpoint smoothing}\n')
file.write('0 ! WE_Mode - Wind speed estimator mode {0: One-second low pass filtered hub height wind speed, 1: Imersion and Invariance Estimator (Ortega et al.)}\n')
file.write('1 ! PS_Mode - Peak shaving mode {0: no peak shaving, 1: implement peak shaving}\n')
file.write('0 ! PS_Mode - Peak shaving mode {0: no peak shaving, 1: implement peak shaving}\n')
file.write('\n')
file.write('!------- FILTERS ----------------------------------------------------------\n')
file.write('{} ! F_LPFCornerFreq - Corner frequency (-3dB point) in the low-pass filters, [Hz]\n'.format(str(turbine.omega_dt * 1/3))) # this needs to be included as an input file
Expand All @@ -315,12 +315,12 @@ class containing
file.write('{} ! PC_GS_angles - Gain-schedule table: pitch angles\n'.format(str(controller.pitch_op_pc).strip('[]').replace('\n','')))
file.write('{} ! PC_GS_KP - Gain-schedule table: pitch controller kp gains\n'.format(str(controller.pc_gain_schedule.Kp).strip('[]').replace('\n','')))
file.write('{} ! PC_GS_KI - Gain-schedule table: pitch controller ki gains\n'.format(str(controller.pc_gain_schedule.Ki).strip('[]').replace('\n','')))
file.write('{} ! PC_GS_KD - Gain-schedule table: pitch controller kd gains\n'.format(str(np.zeros(len(controller.pitch_op_pc))).strip('[]').replace('\n','')))
file.write('{} ! PC_GS_TF - Gain-schedule table: pitch controller tf gains (derivative filter)\n'.format(str(np.zeros(len(controller.pitch_op_pc))).strip('[]').replace('\n','')))
file.write('{} ! PC_MaxPit - Maximum physical pitch limit, [rad].\n'.format(str(turbine.PC_MaxPit)))
file.write('{} ! PC_GS_KD - Gain-schedule table: pitch controller kd gains\n'.format(str(np.zeros(len(controller.pitch_op_pc))).strip('[]').replace('\n','')))
file.write('{} ! PC_GS_TF - Gain-schedule table: pitch controller tf gains (derivative filter)\n'.format(str(np.zeros(len(controller.pitch_op_pc))).strip('[]').replace('\n','')))
file.write('{} ! PC_MaxPit - Maximum physical pitch limit, [rad].\n'.format(str(turbine.PC_MaxPit)))
file.write('{} ! PC_MinPit - Minimum physical pitch limit, [rad].\n'.format(str(turbine.PC_MinPit)))
file.write('0.13962 ! PC_MaxRat - Maximum pitch rate (in absolute value) in pitch controller, [rad/s].\n')
file.write('-0.13962 ! PC_MinRat - Minimum pitch rate (in absolute value) in pitch controller, [rad/s].\n')
file.write('0.0349 ! PC_MaxRat - Maximum pitch rate (in absolute value) in pitch controller, [rad/s].\n')
file.write('-0.0349 ! PC_MinRat - Minimum pitch rate (in absolute value) in pitch controller, [rad/s].\n')
file.write('{} ! PC_RefSpd - Desired (reference) HSS speed for pitch controller, [rad/s].\n'.format(str(turbine.RRspeed*turbine.Ng)))
file.write('0.0 ! PC_FinePit - Record 5: Below-rated pitch angle set-point, [rad]\n')
file.write('0.003490658 ! PC_Switch - Angle above lowest minimum pitch angle for switch, [rad]\n')
Expand Down

0 comments on commit a19d7a8

Please sign in to comment.