Hi all,
I am undertaking an undergraduate thesis in simulating a turbine and testing a pitch control system using FAST.
Having developed a basic pitch control system for a turbine, I attempted to test against some real wind data. Having successfully run the same simulink model against a different (hub height) wind file, I then got the following error when trying to run the real wind data:
Error calculating wind direction from HH file. Delta(32684) = -5.5152; Delta(32685) = 3.9794
What I believe to be the relevant section of the wind file is as follows…
! Time Wind Wind Vert. Horiz. Vert. LinV Gust
! Speed Dir Speed Shear Shear Shear Speed
32681 3.50 55 0 0 0.14 0 0
32682 3.30 224 0 0 0.14 0 0
32683 3.20 44 0 0 0.14 0 0
32684 3.30 228 0 0 0.14 0 0
32685 3.50 223 0 0 0.14 0 0
32686 3.50 33 0 0 0.14 0 0
Realising I won’t be able to simulate the entire wind data (24 hours) in one session (assuming the TMax < 10000 seconds restriction) I cut the wind file just before the problem lines and the simulation ran fine and appeared to be producing sensible values, so I believe the format is correct.
What is it about these lines that causes the error?
Many Thanks,
Monika
Hi, Monika.
The InflowWind module interpolates the wind direction between each entry in the HH wind file. When it reads the file at initialization, it checks that the wind direction didn’t jump more than 180 degrees between any two consecutive entries in the file … if it did, it adds/subtracts 360 degrees to the last wind direction and and checks again. For instance, if you said the wind direction was 1 degree at time=1 second and 359 degrees at 2 seconds, we assume that the wind didn’t rotate 358 degrees. When we ask for the wind direction at 1.5 seconds, we’d want to get (1±1)/2 = 0 degrees, not (1+359)/2 = 180 degrees.
There is a limit to how many times it will add/subtract 2*pi, and apparently because you have a really long file, you hit that limit. I would guess that if you modify your file so that the wind direction doesn’t jump 180 degrees between consecutive entries (e.g., change 224 degrees to -136 degrees), you won’t get that error.
I do think the routine should be able to handle this case, though. If you’d be willing to email me the entire file (or at least up to line 32685 where you got the error), I will add it to our list of things to check.
Hi Bonnie,
Thank you for your response…
I actually encountered the same error in another file, and indeed ensuring having none of the wind directions outside the -180 to 180 range seems to fix the problem.
The following is not an actual data file, but one set up to test a basic yaw controller, at which point, having established the workaround, it may be unimportant but I have attached the file that failed and the file that worked.
It appears it may be two consecutive values outside range may trigger the fault ?? not sure if two consecutive negative-outside-range would do the same
Error calculating wind direction from HH file. Delta(8) = 7.1209; Delta(9) = 0.87266
! Direction and magnitude change wind file
! Time Wind Wind Vert. Horiz. Vert. LinV Gust
! Speed Dir Speed Shear Shear Shear Speed
00.0 2 1 0 0.1 0.14 0 0
05.0 5 1 0 0.1 0.14 0 0
09.0 5 5 0 0.1 0.14 0 0
10.0 8 45 0 0.1 0.14 0 0
14.0 8 95 0 0.1 0.14 0 0
15.0 11 185 0 0.1 0.14 0 0
19.0 11 228 0 0.1 0.14 0 0
20.0 14 48 0 0.1 0.14 0 0
24.0 14 50 0 0.1 0.14 0 0
25.0 17 0 0 0.1 0.14 0 0
29.0 17 0 0 0.1 0.14 0 0
30.0 20 0 0 0.1 0.14 0 0
34.0 20 0 0 0.1 0.14 0 0
35.0 23 0 0 0.1 0.14 0 0
39.0 23 0 0 0.1 0.14 0 0
40.0 26 0 0 0.1 0.14 0 0
44.0 26 0 0 0.1 0.14 0 0
45.0 30 0 0 0.1 0.14 0 0
49.0 30 0 0 0.1 0.14 0 0
50.0 35 0 0 0.1 0.14 0 0
55.0 40 0 0 0.1 0.14 0 0
60.0 44 0 0 0.1 0.14 0 0
65.0 48 0 0 0.1 0.14 0 0
70.0 50 0 0 0.1 0.14 0 0
While this worked fine… only the 19 second line has changed
! Direction and magnitude change wind file
! Time Wind Wind Vert. Horiz. Vert. LinV Gust
! Speed Dir Speed Shear Shear Shear Speed
00.0 2 1 0 0.1 0.14 0 0
05.0 5 1 0 0.1 0.14 0 0
09.0 5 5 0 0.1 0.14 0 0
10.0 8 45 0 0.1 0.14 0 0
14.0 8 95 0 0.1 0.14 0 0
15.0 11 185 0 0.1 0.14 0 0
19.0 11 -132 0 0.1 0.14 0 0
20.0 14 48 0 0.1 0.14 0 0
24.0 14 50 0 0.1 0.14 0 0
25.0 17 0 0 0.1 0.14 0 0
29.0 17 0 0 0.1 0.14 0 0
30.0 20 0 0 0.1 0.14 0 0
34.0 20 0 0 0.1 0.14 0 0
35.0 23 0 0 0.1 0.14 0 0
39.0 23 0 0 0.1 0.14 0 0
40.0 26 0 0 0.1 0.14 0 0
44.0 26 0 0 0.1 0.14 0 0
45.0 30 0 0 0.1 0.14 0 0
49.0 30 0 0 0.1 0.14 0 0
50.0 35 0 0 0.1 0.14 0 0
55.0 40 0 0 0.1 0.14 0 0
60.0 44 0 0 0.1 0.14 0 0
65.0 48 0 0 0.1 0.14 0 0
70.0 50 0 0 0.1 0.14 0 0
Regards,
Monika
Thanks for the files, Monika.
However, both wind files worked in FAST v7.02.00d-bjj linked with InflowWind v1.01.00b-bjj. I didn’t get any errors when I used them.
Are you using different versions of the software? Did you recompile it?
Bonnie,
I checked the file, and found that it ran fine when run with the Fast executable, but threw an error when run in Simulink.
I am still using the previous version of FAST, as it seemed to work fine until this issue, and 11 months into a 1 year project did not seem the time to update software.
Running FAST (v7.01.00a-bjj, 16-Feb-2012).
Using NWTC Subroutine Library (v1.04.01, 21-Feb-2012).
Aerodynamic loads calculated using AeroDyn (v13.00.01a-bjj, 16-Feb
Using InflowWind (v1.00.01b-bjj, 14-Nov-2011)
I did recompile the FAST executable though without making any changes, but not (to my knowledge) the S-Function, and the wind file is fine in both the original and my recompiled executables.
The Simulink model shows creation and modification dates Wednesday, 22 February 2012, 9:14:04