Skip to content

Update Hycon hybrid supervisory controller architecture to handle general components#100

Merged
misi9170 merged 39 commits intoNatLabRockies:developfrom
misi9170:feature/multiunit
May 6, 2026
Merged

Update Hycon hybrid supervisory controller architecture to handle general components#100
misi9170 merged 39 commits intoNatLabRockies:developfrom
misi9170:feature/multiunit

Conversation

@misi9170
Copy link
Copy Markdown
Collaborator

@misi9170 misi9170 commented Apr 21, 2026

This PR adds a new controller, HybridSupervisoryControllerGeneric (name possibly to change), that supersedes both HybridSupervisoryControllerBaseline and HybridSupervisoryControllerMultiRef. 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:

@misi9170 misi9170 added the new-feature A new feature label Apr 21, 2026
@misi9170 misi9170 mentioned this pull request May 1, 2026
3 tasks
@misi9170 misi9170 mentioned this pull request May 5, 2026
7 tasks
@misi9170 misi9170 marked this pull request as ready for review May 5, 2026 17:33
@misi9170
Copy link
Copy Markdown
Collaborator Author

misi9170 commented May 5, 2026

@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.

@misi9170 misi9170 requested a review from Copilot May 5, 2026 17:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@misi9170 misi9170 requested a review from Copilot May 5, 2026 18:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 up battery_power_setpoint, so battery commands will silently default to 0.0. Change this to read power_setpoint (and keep naming consistent with the rest of the interfaces/controllers).
    tests/battery_controllers_test.py:1
  • These np.isclose(...) checks are missing assert, so the test will pass even if the computed setpoints are wrong. Change these to assert 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 length n_turbines. Since send_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.

Comment thread hycon/interfaces/hercules_interface.py Outdated
Comment thread hycon/interfaces/hercules_interface.py Outdated
Comment thread hycon/controllers/controller_base.py Outdated
Comment thread hycon/controllers/hybrid_supervisory_controller.py
Comment thread hycon/controllers/hybrid_supervisory_controller.py
Comment thread hycon/controllers/hybrid_supervisory_controller.py
Comment thread hycon/controllers/price_curtailing_controller.py
Comment thread hycon/controllers/price_curtailing_controller.py Outdated
Comment thread hycon/controllers/controller_base.py
@misi9170 misi9170 merged commit e52a10a into NatLabRockies:develop May 6, 2026
5 checks passed
@misi9170 misi9170 deleted the feature/multiunit branch May 6, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants