NREL / ROSCO

A Reference Open Source Controller for Wind Turbines
https://rosco.readthedocs.io/en/latest/
Apache License 2.0
116 stars 93 forks source link

Inconsistent behaviour of the yaw module #329

Closed lejeunemax closed 6 months ago

lejeunemax commented 7 months ago

I'm currently coupling ROSCO to an in-house C code and encountered an unexpected behaviour of the yaw module: ROSCO returned completely inconsistent yaw angle commands. After digging a little into the code I found out that this behaviour arised from what looks like an incorrect typecast.

Updating the REAL FUNCTION wrap_360(x) and REAL FUNCTION wrap_180(x) functions to REAL(DbKi) FUNCTION wrap_360(x) and REAL(DbKi) FUNCTION wrap_180(x) (thus following the same signature as other functions of Functions.f90) apparently solved this issue on my side.

The bug occurred on Rosco 2.8.0 but I believe it is still present in ROSCO 2.9.0 (I did not replicate it though).

dzalkind commented 7 months ago

Thanks for finding this. It seems easy enough to incorporate into a future release. I'll leave this open until then.

dzalkind commented 6 months ago

Addressed in #345. Thanks!