Browse Source

update supply air temperature set control logic of AHU

highing666 3 years ago
parent
commit
e9fb91ca3f

+ 2 - 1
app/controllers/equipment/ahu/supply_air_temperature_set.py

@@ -49,7 +49,7 @@ class ACATAHSupplyAirTemperatureController:
             elif cold_ratio <= 0.7:
                 new = self.current + 1.0
             elif cold_ratio <= 1.0:
-                new = self.return_air + 1.0
+                new = self.current + 1.5
             else:
                 new = self.current
         elif self.thermal_mode == ThermalMode.heating:
@@ -79,6 +79,7 @@ class ACATAHSupplyAirTemperatureController:
                 box.supply_air_flow_upper_limit,
                 box.supply_air_flow_lower_limit,
                 box.supply_air_flow_set,
+                box.valve_opening,
                 self.season
             )
             cold += temp if temp < 0 else 0

+ 16 - 8
app/controllers/equipment/ahu/thermal_mode.py

@@ -15,6 +15,7 @@ def count_vav_box_weight(
         upper_limit_flow: float,
         lower_limit_flow: float,
         current_flow_set: float,
+        valve_opening: float,
         season: Season
 ) -> float:
     diff = realtime - target
@@ -27,15 +28,19 @@ def count_vav_box_weight(
             if diff > 0:
                 flag = True
     elif current_flow_set > upper_limit_flow * 0.9:
-        if season == Season.cooling:
-            if diff > 0:
-                flag = True
-        if season == Season.heating:
-            if diff < 0:
-                flag = True
+        if valve_opening > 90.0:
+            if season == Season.cooling:
+                if diff > 0:
+                    flag = True
+            if season == Season.heating:
+                if diff < 0:
+                    flag = True
 
     if flag:
-        weight = round(diff, 0)
+        if abs(diff) < 1:
+            weight = 0.0
+        else:
+            weight = diff
         weight = max(-4.0, min(4.0, weight))
     else:
         weight = 0
@@ -63,6 +68,7 @@ class ACATAHThermalModeController:
                 box.supply_air_flow_upper_limit,
                 box.supply_air_flow_lower_limit,
                 box.supply_air_flow_set,
+                box.valve_opening,
                 self.season
             )
 
@@ -93,13 +99,15 @@ async def fetch_status_params(project_id: str, device_id: str) -> Dict:
             virtual_temperature_target = await duoduo.query_device_virtual_data(vav_id, 'TargetTemperatureSet')
             lower_limit_flow, upper_limit_flow = await platform.get_air_flow_limit(vav_id)
             current_flow_set = await platform.get_realtime_data(InfoCode.supply_air_flow_set, vav_id)
+            valve_opening = await platform.get_realtime_data(InfoCode.valve_opening, vav_id)
             vav_params = {
                 'id': vav_id,
                 'virtual_realtime_temperature': virtual_realtime_temperature,
                 'virtual_target_temperature': virtual_temperature_target,
                 'supply_air_flow_lower_limit': lower_limit_flow,
                 'supply_air_flow_upper_limit': upper_limit_flow,
-                'supply_air_flow_set': current_flow_set
+                'supply_air_flow_set': current_flow_set,
+                'valve_opening': valve_opening
             }
             vav = VAVBox(**vav_params)
             vav_boxes_list.append(vav)

+ 4 - 0
app/schemas/equipment.py

@@ -27,11 +27,14 @@ class BaseEquipment(BaseModel):
 class FCU(BaseEquipment):
     work_mode: Optional[int]
     air_valve_speed: Optional[AirValveSpeed] = AirValveSpeed.off
+    air_valve_speed_set: Optional[AirValveSpeed] = AirValveSpeed.off
+    recommended_speed: Optional[AirValveSpeed] = AirValveSpeed.off
     space: Optional[Space]
     setting_temperature: Optional[float] = 0.0
     supply_air_temperature: Optional[float] = 0.0
     water_out_temperature: Optional[float] = 0.0
     water_in_temperature: Optional[float] = 0.0
+    speed_limit: Optional[AirValveSpeed] = AirValveSpeed.high
 
 
 class VAVBox(BaseEquipment):
@@ -41,6 +44,7 @@ class VAVBox(BaseEquipment):
     supply_air_flow_set: Optional[float]
     supply_air_flow_lower_limit: Optional[float]
     supply_air_flow_upper_limit: Optional[float]
+    valve_opening: Optional[float]
     setting_temperature: Optional[float] = 0.0
     virtual_realtime_temperature: Optional[float]
     virtual_target_temperature: Optional[float]

+ 1 - 0
app/services/platform.py

@@ -42,6 +42,7 @@ class InfoCode(str, Enum):
     supply_temperature = 'SupplyTemp'
     water_out_temperature = 'WaterOutTemp'
     water_in_temperature = 'WaterInTemp'
+    valve_opening = 'ValveOpening'
 
 
 class DataPlatformService(Service):