Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rosco/controller/src/ControllerBlocks.f90
Original file line number Diff line number Diff line change
Expand Up @@ -605,13 +605,13 @@ SUBROUTINE Startup(LocalVar, CntrPar, objInst,ErrVar)

! Set PRC_R_Speed, SU_PrevLoad based on SU_Stage
IF (LocalVar%SU_Stage == 1) THEN
LocalVar%PRC_R_Speed = CntrPar%SU_RotorSpeedThresh / CntrPar%PC_RefSpd
LocalVar%PRC_R_Speed = CntrPar%SU_RotorSpeedThresh / CntrPar%PC_RefSpd * CntrPar%WE_GearboxRatio
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be CntrPar%SU_RotorSpeedThresh * CntrPar%WE_GearboxRatio / CntrPar%PC_RefSpd

PC_RefSpd is a generator value.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes,
I think fortran calculates CntrPar%SU_RotorSpeedThresh / CntrPar%PC_RefSpd * CntrPar%WE_GearboxRatio same as CntrPar%SU_RotorSpeedThresh * CntrPar%WE_GearboxRatio / CntrPar%PC_RefSpd (unless I am mistaken).
I'll push a fix based on your suggestion as it is better for readability anyways.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you might be correct. Have you tested this on a geared system?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it with NREL-5MW with two load staged of 0.2 and 1:
image
Seem to be working.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked into why regression test is failing.
Example 11_robust_tuning.py fails becuase "self.controller.Kp_float" is a 1-d numpy array which causes error when using numpy=2.4.1 (current) here: https://github.com/NREL/ROSCO/blob/fc11f43984876559c8b355e5070dd8147c4225da/rosco/toolbox/utilities.py#L773.
The example runs fine with numpy=1.26.4.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!! I've seen similar errors over in WEIS. I can fix this to work with new versions of numpy that are now being used.

ELSEIF (LocalVar%SU_Stage == 2) THEN
SU_PrevLoad = 0.0_DbKi
! Ramp up PRC_R_Speed to 1.0 in duration = SU_LoadRampDuration(1)
LocalVar%PRC_R_Speed = sigma(LocalVar%Time,LocalVar%SU_LoadStageStartTime, &
LocalVar%SU_LoadStageStartTime + CntrPar%SU_LoadRampDuration(LocalVar%SU_Stage - 1), &
CntrPar%SU_RotorSpeedThresh / CntrPar%PC_RefSpd ,1.0_DbKi,ErrVar)
CntrPar%SU_RotorSpeedThresh * CntrPar%WE_GearboxRatio / CntrPar%PC_RefSpd ,1.0_DbKi,ErrVar)
ELSEIF ((LocalVar%SU_Stage .ge. 2) .AND. (LocalVar%SU_Stage .le. CntrPar%SU_LoadStages_N + 1)) THEN
SU_PrevLoad = CntrPar%SU_LoadStages(LocalVar%SU_Stage-2)
ELSEIF (LocalVar%SU_Stage == CntrPar%SU_LoadStages_N + 2) THEN
Expand Down
Loading