Skip to content

Commit

Permalink
Solar now runs as expected, with some mods on hercules.
Browse files Browse the repository at this point in the history
  • Loading branch information
misi9170 committed May 7, 2024
1 parent b6324df commit 761346f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions whoc/controllers/hybrid_supervisory_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ def supervisory_control(self):
solar_power = self.measurements_dict["solar_power"]
battery_power = self.measurements_dict["battery_power"]

# Temporary print statements
# Temporary print statements (note that negative battery indicates discharging)
print("Measured powers (wind, solar, battery):", wind_power, solar_power, battery_power)

# Placeholder for supervisory control logic
wind_reference = 2.5 #1e9 # Unit is kW
solar_reference = 0.5e9 # Check if this is working
battery_reference = 3.0 # 0.5e9
wind_reference = 20 # kW
solar_reference = 50 # kW, not currently working
battery_reference = -30 # kW, Negative requests discharging, positive requests charging

return wind_reference, solar_reference, battery_reference
6 changes: 3 additions & 3 deletions whoc/interfaces/hercules_hybrid_actuator_disk_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def get_measurements(self, hercules_dict):
"wind_turbine_powers": turbine_powers,
"plant_power_reference": plant_power_reference,
"battery_power": hercules_dict["py_sims"][self.battery_name]["outputs"]["power"],
"solar_power": hercules_dict["py_sims"][self.solar_name]["outputs"]["power"],
}
"solar_power": hercules_dict["py_sims"][self.solar_name]["outputs"]["power_mw"] * 1000,
} # Note: solar_power converted to kW here

return measurements

Expand Down Expand Up @@ -87,7 +87,7 @@ def send_controls(
] = wind_power_setpoints
hercules_dict["py_sims"]["inputs"].update(
{"battery_signal": battery_power_setpoint,
"solar_signal": solar_power_setpoint}
"solar_setpoint_mw": solar_power_setpoint / 1000} # Convert to MW
)

return hercules_dict

0 comments on commit 761346f

Please sign in to comment.