NREL / hercules

Hercules
https://nrel.github.io/hercules/
Apache License 2.0
3 stars 7 forks source link

Smooth output of FlorisStandin to prevent oscilations in closed-loop response #90

Closed misi9170 closed 5 months ago

misi9170 commented 6 months ago

The FlorisStandin is a steady-state model standing in for a the dynamic AMR-Wind model. We (@genevievestarke ) have been finding that this can lead to poor performance in simple closed-loop controllers, which I think is because the plant model essentially has infinite bandwidth, which, when combined with an infinite bandwidth controller (such as the wind farm power tracking controller implemented in WHOC, which is essentially a proportional controller), appears to lead to a closed-loop system that is marginally stable---see below, which comes from running the wind farm power tracking example in WHOC with the wind speed at 11m/s, rather than 8m/s.

wf-power-tracking-plot_smoothing0

To solve this issue, this PR "smooths" the output from the FlorisStandin model by applying a first order filter to the output power to give the open-loop system a finite bandwidth; this dampens oscillations in the closed-loop system (or removes oscillations entirely). This damping is artificial, in the sense that it is not a direct output from FLORIS; however, any real system with dynamics will have a finite bandwidth, so this update makes the FlorisStandin slightly more realistic. The level of smoothing is controllable with the smoothing_coefficient, which users can set between 0 (no smoothing) and 1 (as the smoothing_coefficient approaches 1, smoothing becomes very heavy).

Using the default smoothing_coefficient (0.5) now results in the following (note that Open Loop and Closed Loop control appear similar (both able to achieve the farm setpoint) here because, at 11m/s, there is sufficient resource for the Open Loop controller to achieve the demanded setpoint also. This is not a characteristic of the change to FlorisStandin).

wf-power-tracking-plot_smoothing1

Other notes

This pull request additionally updates the FlorisStandin to be compatible with the latest changes in FLORIS v4.

genevievestarke commented 5 months ago

What testing script did you use for these figures? I'm running into some floris/flasc version issues with WHOC at the moment, so I might need to update something somewhere

misi9170 commented 5 months ago

What testing script did you use for these figures? I'm running into some floris/flasc version issues with WHOC at the moment, so I might need to update something somewhere

I ran the wind farm power tracking control example in WHOC, which generates these figures when it concludes (using this python file)

On the FLASC/FLORIS versioning issues; sorry about that; you should comment out the line from flasc.wake_steering.lookup_table_tools import get_yaw_angles_interpolant in whoc/controllers/lookup_based_wake_steering_control.py. I need to fix that issue.

genevievestarke commented 5 months ago

Ah, ok, great, I'm getting the same plots as you now!