Update Hycon hybrid supervisory controller architecture to handle general components#100
Merged
misi9170 merged 39 commits intoNatLabRockies:developfrom May 6, 2026
Merged
Conversation
3 tasks
Collaborator
Author
|
@paulf81 I've marked this ready for review. I'm not expecting an actual review here, since this is such a major overhaul that I think the best approach will be to merge it and let it sit on develop a while to iron out any bugs. However, I know you are going to use this a bit today, so I'll let you do that before I merge it just in case there are some obvious bugs that come up. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 39 out of 42 changed files in this pull request and generated 9 comments.
Comments suppressed due to low confidence (3)
hycon/interfaces/hercules_v1_interface.py:1
- The nested controls schema elsewhere uses
controls_dict[\"battery\"][\"power_setpoint\"], but this code looks upbattery_power_setpoint, so battery commands will silently default to 0.0. Change this to readpower_setpoint(and keep naming consistent with the rest of the interfaces/controllers).
tests/battery_controllers_test.py:1 - These
np.isclose(...)checks are missingassert, so the test will pass even if the computed setpoints are wrong. Change these toassert np.isclose(...)to actually validate the behavior.
hycon/interfaces/hercules_v1_interface.py:1 - The v1
check_controls()no longer validates that turbine-indexed controls (e.g.,yaw_angles/power_setpoint) have lengthn_turbines. Sincesend_controls()assumes correct lengths, restoring length validation would prevent hard-to-debug runtime shape issues and aligns with the previous safety checks.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Apply copilot commit suggestions Co-authored-by: Copilot Autofix powered by AI <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a new controller,
HybridSupervisoryControllerGeneric(name possibly to change), that supersedes bothHybridSupervisoryControllerBaselineandHybridSupervisoryControllerMultiRef. This supervisor can have arbitrary component controllers assigned to it, and curtails them in a user-specified order when satisfying a grid interconnection limit or power reference tracking target. The control of the individual components (e.g. profit maximizing, power tracking) is handled by the individual component controllers.This PR is a work in progress. Once complete, this should supersede #99 , and address the following issues: #98 , #60, and possibly #62.
This PR does include breaking changes. I intend to release a new version of Hycon (v0.8) once it has been merged (and has been on develop for some time to identify any issues).
To do:
HybridSupervisoryControllerBaselineandHybridSupervisoryControllerMultiRefcontrollersConsider addressing Feature request: Forced outage override #101 (or work on this in a separate PR)Decided to leave this for a later PR