Skip to content

Commit

Permalink
Add other necessary measurements for supervisory control.
Browse files Browse the repository at this point in the history
  • Loading branch information
misi9170 committed May 7, 2024
1 parent 5d58a19 commit ca3b10e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
9 changes: 7 additions & 2 deletions whoc/controllers/hybrid_supervisory_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,15 @@ def compute_controls(self):
return None

def supervisory_control(self):
# Extract current power production
# Extract measurements sent
time = self.measurements_dict["time"] # noqa: F841
wind_power = np.array(self.measurements_dict["wind_turbine_powers"]).sum()
solar_power = self.measurements_dict["solar_power"]
battery_power = self.measurements_dict["battery_power"]
battery_power = self.measurements_dict["battery_power"] # noqa: F841
wind_speed = self.measurements_dict["wind_speed"] # noqa: F841
battery_soc = self.measurements_dict["battery_soc"] # noqa: F841
solar_dni = self.measurements_dict["solar_dni"] # direct normal irradiance # noqa: F841
solar_aoi = self.measurements_dict["solar_aoi"] # angle of incidence # noqa: F841

# Temporary print statements (note that negative battery indicates discharging)
print("Measured powers (wind, solar, battery):", wind_power, solar_power, battery_power)
Expand Down
9 changes: 8 additions & 1 deletion whoc/interfaces/hercules_hybrid_actuator_disk_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,17 @@ def get_measurements(self, hercules_dict):
measurements = {
"time": time,
"wind_turbine_powers": turbine_powers,
"wind_speed": hercules_dict["hercules_comms"]["amr_wind"][self.wind_name]["wind_speed"],
"plant_power_reference": plant_power_reference,
"battery_power": hercules_dict["py_sims"][self.battery_name]["outputs"]["power"],
"battery_soc": hercules_dict["py_sims"][self.battery_name]["outputs"]["soc"],
"solar_power": hercules_dict["py_sims"][self.solar_name]["outputs"]["power_mw"] * 1000,
} # Note: solar_power converted to kW here
"solar_dni": hercules_dict["py_sims"][self.solar_name]["outputs"]["dni"],
"solar_aoi": hercules_dict["py_sims"][self.solar_name]["outputs"]["aoi"],
}
# Notes: solar_power converted to kW here
# solar_dni is the direct normal irradiance
# solar_aoi is the angle of incidence

return measurements

Expand Down

0 comments on commit ca3b10e

Please sign in to comment.