Skip to content

Commit

Permalink
Add initial constant power control with TSR tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
dzalkind authored and nikhar-abbas committed Nov 30, 2020
1 parent 584bc08 commit 9b6392e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/Controllers.f90
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,12 @@ SUBROUTINE VariableSpeedControl(avrSWAP, CntrPar, LocalVar, objInst)
ENDIF

! Optimal Tip-Speed-Ratio tracking controller
IF (CntrPar%VS_ControlMode == 2) THEN
IF ((CntrPar%VS_ControlMode == 2) .OR. (CntrPar%VS_ControlMode == 3)) THEN
! Constant Power, update VS_MaxTq
IF (CntrPar%VS_ControlMode == 3) THEN
VS_MaxTq = min((CntrPar%VS_RtPwr/(CntrPar%VS_GenEff/100.0))/LocalVar%GenSpeedF, CntrPar%VS_RtTq)
END IF

! PI controller
LocalVar%GenTq = PIController(LocalVar%VS_SpdErr, CntrPar%VS_KP(1), CntrPar%VS_KI(1), CntrPar%VS_MinTq, VS_MaxTq, LocalVar%DT, LocalVar%VS_LastGenTrq, .FALSE., objInst%instPI)
LocalVar%GenTq = saturate(LocalVar%GenTq, CntrPar%VS_MinTq, VS_MaxTq)
Expand Down
2 changes: 1 addition & 1 deletion src/ROSCO_Types.f90
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ MODULE ROSCO_Types
REAL(8) :: PC_FinePit ! Record 5: Below-rated pitch angle set-point (deg) [used only with Bladed Interface]
REAL(8) :: PC_Switch ! Angle above lowest minimum pitch angle for switch [rad]

INTEGER(4) :: VS_ControlMode ! Generator torque control mode in above rated conditions {0: constant torque, 1: constant power}
INTEGER(4) :: VS_ControlMode ! Generator torque control mode in above rated conditions {0: constant torque, 1: constant power, 2: TSR Tracking, 3: TSR Tracking w/ const power}
REAL(8) :: VS_GenEff ! Generator efficiency mechanical power -> electrical power [-]
REAL(8) :: VS_ArSatTq ! Above rated generator torque PI control saturation, [Nm] -- 212900
REAL(8) :: VS_MaxRat ! Maximum torque rate (in absolute value) in torque controller, [Nm/s].
Expand Down
4 changes: 2 additions & 2 deletions src/ReadSetParameters.f90
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ SUBROUTINE ComputeVariablesSetpoints(CntrPar, LocalVar, objInst)

! ----- Torque controller reference errors -----
! Define VS reference generator speed [rad/s]
IF (CntrPar%VS_ControlMode == 2) THEN
IF ((CntrPar%VS_ControlMode == 2) .OR. (CntrPar%VS_ControlMode == 3)) THEN
VS_RefSpd = (CntrPar%VS_TSRopt * LocalVar%We_Vw_F / CntrPar%WE_BladeRadius) * CntrPar%WE_GearboxRatio
VS_RefSpd = saturate(VS_RefSpd,CntrPar%VS_MinOMSpd, CntrPar%VS_RefSpd)
ELSE
Expand All @@ -274,7 +274,7 @@ SUBROUTINE ComputeVariablesSetpoints(CntrPar, LocalVar, objInst)
VS_RefSpd = max(VS_RefSpd, CntrPar%VS_MinOmSpd)

! TSR-tracking reference error
IF (CntrPar%VS_ControlMode == 2) THEN
IF ((CntrPar%VS_ControlMode == 2) .OR. (CntrPar%VS_ControlMode == 3)) THEN
LocalVar%VS_SpdErr = VS_RefSpd - LocalVar%GenSpeedF
ENDIF

Expand Down

0 comments on commit 9b6392e

Please sign in to comment.