How natlabrockies/hycon works
1. What Hycon is
Hycon is a Python package for real-time hybrid power plant control. Its core role is to sit between a plant simulator or plant runtime and a set of plant-level controllers, producing coordinated setpoints for assets like wind turbines, batteries, solar, and hydrogen systems.
2. Top-level structure
The repository is organized around three main runtime subsystems:
- hycon/controllers: control logic
- hycon/interfaces: adapters to external simulators/control systems
- hycon/design_tools: offline analysis and precomputation tools, especially for wake steering
Supporting pieces include examples/, tests/, and docs/.
3. Controller layer
Controllers are the main decision-making components. controller_base.py defines the common controller contract, and the concrete controllers implement different plant behaviors:
- battery_controller.py
- solar_passthrough_controller.py
- wind_farm_power_tracking_controller.py
- hydrogen_plant_controller.py
- lookup_based_wake_steering_controller.py
- wake_steering_rosco_standin.py
- hybrid_supervisory_controller.py
The supervisory controller is the main coordination boundary for hybrid plants, combining multiple asset-specific controllers into one plant-level decision path.
4. Interface layer
The interface subsystem isolates Hycon from the runtime environment. interface_base.py defines the integration contract, while the concrete interfaces target specific external systems:
- hercules_interface.py and hercules_v1_interface.py for Hercules-based simulation integration
- rosco_zmq_interface.py for ROSCO communication over ZeroMQ
- python_interface_temp.py as a temporary or experimental Python-side interface
This layer is the key boundary where external plant state enters Hycon and setpoints/commands leave it.
5. Data flow through the system
The typical flow is: external simulator or plant runtime sends measurements and state through an interface, the interface maps them into Hycon’s internal format, the appropriate controller computes setpoints or reference signals, and the interface returns those outputs to the external system. This makes Hycon an orchestration layer rather than a full simulator itself.
6. Wake steering architecture
Wake steering is treated as a combination of design-time optimization and run-time control. hycon/design_tools/wake_steering_design.py and wake_steering_visualization.py support offline analysis, while the wake-steering controllers consume precomputed or lookup-based yaw strategies during operation. The repository also includes a ROSCO stand-in controller for scenarios where a lower-level yaw/torque controller is not available.
7. External dependencies that shape the architecture
Hycon is explicitly designed to integrate with:
- Hercules as a simulation/testbed environment
- FAST.Farm / OpenFAST as turbine/farm simulation context
- ROSCO as a lower-level controller
- FLORIS as the wake-modeling/design tool used by wake-steering workflows
These systems define the major integration boundaries and explain why the repo emphasizes adapters and design tools.
8. Examples as executable architecture
The examples/ directory shows the intended deployment patterns:
- battery control and market revenue control
- simple hybrid plant coordination
- single-turbine flexible interconnect
- wind farm power tracking
- lookup-based wake steering using a FLORIS stand-in
These examples use YAML configuration files, CSV time-series inputs, and runscript.py entry points, which indicates Hycon is configured primarily through files and executed as scripted simulations.
9. Input/output model
Example assets include wind inputs, LMP price series, turbine/filter models, reference power profiles, and FLORIS input files. This suggests Hycon controllers are driven by time-series operational data and configuration documents rather than by a persistent internal database. Output handling is example-specific, often using plotting scripts to inspect controller behavior after a run.
10. Testing and validation
The tests/ folder validates the controller base, interface contracts, Hercules compatibility, battery logic, and wake-steering design tools. This implies the most important architectural contracts are not UI contracts but controller/interface behavior and external integration semantics.
11. Packaging and runtime environment
The repo is a standard Python project (pyproject.toml) with support for automated testing and release. The GitHub workflows cover continuous integration, publishing to Python package infrastructure, and GitHub Pages deployment for documentation. This reinforces that Hycon is meant to be installed and used as a library plus runnable example suite.
12. Documentation boundary
The docs/ tree provides installation, controller, interface, example, and design-tool documentation, which mirrors the code boundaries. For diagramming, it is helpful to show documentation as a separate support layer around the main runtime modules, not part of the control loop itself.
Main entry points: controller_base.py Controller base · hybrid_supervisory_controller.py Supervisory · interface_base.py Interface base · wake_steering_design.py Wake design
Components 19
Runtime core
Main control loop for hybrid plant operation
- Hycon · Top-level package for hybrid power plant control
hycon/__init__.py
Controllers
Plant-level decision logic and asset-specific control policies
- Controller base · Shared controller interface and lifecycle
hycon/controllers/controller_base.py - Supervisory · Coordinates multiple asset controllers into one plant-level decision path
hycon/controllers/hybrid_supervisory_controller.py - Battery · Battery charging and dispatch logic
hycon/controllers/battery_controller.py - Solar pass-through · Forwards or relays solar setpoints
hycon/controllers/solar_passthrough_controller.py - Wind tracking · Tracks wind farm power reference signals
hycon/controllers/wind_farm_power_tracking_controller.py - Hydrogen · Hydrogen plant control logic
hycon/controllers/hydrogen_plant_controller.py - Wake lookup · Uses precomputed lookup-based yaw strategies
hycon/controllers/lookup_based_wake_steering_controller.py - ROSCO stand-in · Stand-in for lower-level yaw and torque control
hycon/controllers/wake_steering_rosco_standin.py
Interfaces
Adapters to simulators and external control systems
- Interface base · Common adapter boundary for external runtimes
hycon/interfaces/interface_base.py - Hercules · Integrates with Hercules-based simulation environments
hycon/interfaces/hercules_interface.py - Hercules v1 · Older Hercules integration path
hycon/interfaces/hercules_v1_interface.py - ROSCO ZMQ · Communicates with ROSCO over ZeroMQ
hycon/interfaces/rosco_zmq_interface.py - Python temp · Temporary Python-side interface for experiments
hycon/interfaces/python_interface_temp.py
Design tools
Offline analysis and wake-steering precomputation
- Wake design · Precomputes wake-steering strategies and design data
hycon/design_tools/wake_steering_design.py - Wake viz · Visualizes wake-steering design results
hycon/design_tools/wake_steering_visualization.py
Support
Examples, docs, tests, and packaging
Connections 31
- Hycon → Controller base: exposes · Package exports controller abstractions
- Hycon → Interface base: exposes · Package exports interface abstractions
- Hycon → Wake design: includes · Package includes design tooling
- Controller base → Supervisory: base for · Common contract implemented by concrete controllers
- Controller base → Battery: base for · Common contract implemented by concrete controllers
- Controller base → Solar pass-through: base for · Common contract implemented by concrete controllers
- Controller base → Wind tracking: base for · Common contract implemented by concrete controllers
- Controller base → Hydrogen: base for · Common contract implemented by concrete controllers
- Controller base → Wake lookup: base for · Common contract implemented by concrete controllers
- Controller base → ROSCO stand-in: base for · Common contract implemented by concrete controllers
- Interface base → Hercules: base for · Common contract implemented by adapters
- Interface base → Hercules v1: base for · Common contract implemented by adapters
- Interface base → ROSCO ZMQ: base for · Common contract implemented by adapters
- Interface base → Python temp: base for · Common contract implemented by adapters
- Supervisory → Battery: coordinates · Combines asset-specific control outputs
- Supervisory → Wind tracking: coordinates · Combines asset-specific control outputs
- Supervisory → Solar pass-through: coordinates · Combines asset-specific control outputs
- Supervisory → Hydrogen: coordinates · Combines asset-specific control outputs
- Wake design → Wake lookup: feeds · Precomputed wake-steering strategies are consumed at runtime
- Wake design → Wake viz: inspects · Visualization supports design-time analysis
- Hercules → Supervisory: invokes · Maps simulator state into controller inputs
- Hercules v1 → Supervisory: invokes · Legacy Hercules runtime path
- ROSCO ZMQ → ROSCO stand-in: invokes · Messaging bridge for wake-steering control
- Python temp → Supervisory: invokes · Experimental Python-side execution path
- Examples → Hercules: demonstrates · Example scenarios use Hercules-style inputs and runscripts
- Examples → Wake design: demonstrates · Wake-steering examples use FLORIS-style design data
- Docs → Hycon: documents · Documentation mirrors the code architecture
- Tests → Controller base: verifies · Validates controller contract behavior
- Tests → Interface base: verifies · Validates interface contract behavior
- Tests → Hercules: verifies · Checks Hercules compatibility
- Tests → Wake design: verifies · Checks wake-steering design tool behavior