Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

EMS control is off by one hour

A bug report. I've been aware of it for a long time. Now I posted just because I have time to do so.

When we try to control actuated components in AirLoop and PlantLoop with the built-In Unique Variable "Hour" by EMS, the components are controlled one hour later than the "Hour" we specify.

I reprodued the bug with an ExampleFile 5ZoneCAV_MaxTemp.idf (Any ExampleFiles are fine). The idf file is here (V23-2-0). I added EMS to override Fan Air Mass Flow Rate of Supply Fan 1 as follows.

Fan:VariableVolume,
    Supply Fan 1,            !- Name
    FanAvailSched,           !- Availability Schedule Name
    0.7,                     !- Fan Total Efficiency
    600.0,                   !- Pressure Rise {Pa}
    autosize,                !- Maximum Flow Rate {m3/s}
    Fraction,                !- Fan Power Minimum Flow Rate Input Method
    0.25,                    !- Fan Power Minimum Flow Fraction
    ,                        !- Fan Power Minimum Air Flow Rate {m3/s}
    0.9,                     !- Motor Efficiency
    1.0,                     !- Motor In Airstream Fraction
    0.35071223,              !- Fan Power Coefficient 1
    0.30850535,              !- Fan Power Coefficient 2
    -0.54137364,             !- Fan Power Coefficient 3
    0.87198823,              !- Fan Power Coefficient 4
    0.000,                   !- Fan Power Coefficient 5
    Main Heating Coil 1 Outlet Node,  !- Air Inlet Node Name
    VAV Sys 1 Outlet Node;   !- Air Outlet Node Name

EnergyManagementSystem:Actuator,
    Fan_Flow,                !- Name
    Supply Fan 1,            !- Actuated Component Unique Name
    Fan,                     !- Actuated Component Type
    Fan Air Mass Flow Rate;  !- Actuated Component Control Type

EnergyManagementSystem:ProgramCallingManager,
    EMS_PCM_Fan_Flow,        !- Name
    InsideHVACSystemIterationLoop,  !- EnergyPlus Model Calling Point
    EMS_Program_Fan_Flow;    !- Program Name 1

EnergyManagementSystem:Program,
    EMS_Program_Fan_Flow,    !- Name
    IF (Hour >10) && (Hour <= 15),  !- Program Line 1
    SET Fan_Flow = 0,        !- Program Line 2
    ELSE,                    !- A4
    SET Fan_Flow = 0.480944716911248,  !- A5
    ENDIF;                   !- A6

TimeStep is set to 6. The original Fan Availability Schedule is 1 for 24h a day from Jan to Mar. Fan Air Mass Flow Rate of Supply Fan 1 is supposed to be 0 kg/s from 10:10:00 to 15:00:00 aftter I added EMS above. However, the simulation result shows that it is 0 kg/s from 11:10:00 to 16:00:00.

image description

The bug occurs in other actuated components in AirLoop and PlantLoop as well such as Pumps. I haven't tested all the Calling Points, but InsideHVACSystemIterationLoop is often used to control HVAC systems, and the "Hour" specification in that calling point should be correctly simulated as entered by users.

EMS control is off by one hour

A bug report. I've been aware of it for a long time. Now I posted just because I have time to do so.

When we try to control actuated components in AirLoop and PlantLoop with the built-In Unique Variable "Hour" by EMS, the components are controlled one hour later than the "Hour" we specify.

I reprodued the bug with an ExampleFile 5ZoneCAV_MaxTemp.idf (Any ExampleFiles are fine). The idf file is here (V23-2-0). I added EMS to override Fan Air Mass Flow Rate of Supply Fan 1 as follows.

Fan:VariableVolume,
    Supply Fan 1,            !- Name
    FanAvailSched,           !- Availability Schedule Name
    0.7,                     !- Fan Total Efficiency
    600.0,                   !- Pressure Rise {Pa}
    autosize,                !- Maximum Flow Rate {m3/s}
    Fraction,                !- Fan Power Minimum Flow Rate Input Method
    0.25,                    !- Fan Power Minimum Flow Fraction
    ,                        !- Fan Power Minimum Air Flow Rate {m3/s}
    0.9,                     !- Motor Efficiency
    1.0,                     !- Motor In Airstream Fraction
    0.35071223,              !- Fan Power Coefficient 1
    0.30850535,              !- Fan Power Coefficient 2
    -0.54137364,             !- Fan Power Coefficient 3
    0.87198823,              !- Fan Power Coefficient 4
    0.000,                   !- Fan Power Coefficient 5
    Main Heating Coil 1 Outlet Node,  !- Air Inlet Node Name
    VAV Sys 1 Outlet Node;   !- Air Outlet Node Name

EnergyManagementSystem:Actuator,
    Fan_Flow,                !- Name
    Supply Fan 1,            !- Actuated Component Unique Name
    Fan,                     !- Actuated Component Type
    Fan Air Mass Flow Rate;  !- Actuated Component Control Type

EnergyManagementSystem:ProgramCallingManager,
    EMS_PCM_Fan_Flow,        !- Name
    InsideHVACSystemIterationLoop,  !- EnergyPlus Model Calling Point
    EMS_Program_Fan_Flow;    !- Program Name 1

EnergyManagementSystem:Program,
    EMS_Program_Fan_Flow,    !- Name
    IF (Hour >10) && (Hour <= 15),  !- Program Line 1
    SET Fan_Flow = 0,        !- Program Line 2
    ELSE,                    !- A4
    SET Fan_Flow = 0.480944716911248,  !- A5
    ENDIF;                   !- A6

TimeStep is set to 6. The original Fan Availability Schedule is 1 for 24h a day from Jan to Mar. Fan Air Mass Flow Rate of Supply Fan 1 is supposed to be 0 kg/s from 10:10:00 to 15:00:00 aftter I added EMS above. However, the simulation result shows that it is 0 kg/s from 11:10:00 to 16:00:00.

image description

The bug occurs in other actuated components in AirLoop and PlantLoop as well such as Pumps. I haven't tested all the Calling Points, but InsideHVACSystemIterationLoop is often used to control HVAC systems, and the "Hour" specification in that calling point should be correctly simulated as entered by users.


Addendum

@Aaron Boranian, please let me show you another example. An ExampleFile EMSCustomSchedule.idf overrides Cooling Setpoint Temperature Schedule in ThermostatSetpoint:DualSetpoint as follows.

EnergyManagementSystem:Actuator,
    myCLGSETP_SCH_Override,  !- Name
    CLGSETP_SCH,             !- Actuated Component Unique Name
    Schedule:Constant,       !- Actuated Component Type
    Schedule Value;          !- Actuated Component Control Type

EnergyManagementSystem:ProgramCallingManager,
    My Setpoint Schedule Calculator Example,  !- Name
    InsideHVACSystemIterationLoop,  !- EnergyPlus Model Calling Point
    MyComputedCoolingSetpointProg,  !- Program Name 1

EnergyManagementSystem:Program,
    MyComputedCoolingSetpointProg,  !- Name
    IF (DayOfWeek == 1),     !- Program Line 1
    Set myCLGSETP_SCH_Override = 30.0,  !- Program Line 2
    ELSEIF (Holiday == 3.0) && (DayOfMonth == 21) && (Month == 1),  !- A4
    Set myCLGSETP_SCH_Override = 30.0,  !- A5
    ELSEIF HOUR < 6,         !- A6
    Set myCLGSETP_SCH_Override = 30.0,  !- A7
    ELSEIF (Hour >= 6) && (Hour < 22)  && (DayOfWeek >=2) && (DayOfWeek <=6),  !- A8
    Set myCLGSETP_SCH_Override = 24.0,  !- A9
    ELSEIF (Hour >= 6) && (hour < 18) && (DayOfWeek == 7),  !- A10
    Set myCLGSETP_SCH_Override = 24.0,  !- A11
    ELSEIF (Hour >= 6) && (hour >= 18) && (DayOfWeek == 7),  !- A12
    Set myCLGSETP_SCH_Override = 30.0,  !- A13
    ELSEIF (Hour > 22),      !- A14
    Set myCLGSETP_SCH_Override = 30.0,  !- A15
    ENDIF;                   !- A16

image description

If your answer is correct, the cooling setpoint in the chart below should be 30ºC until 06:50:00 and 24ºC from 07:00:00. However, it is actually 30ºC until 06:00:00 and 24ºC from 06:10:00. Is this a bug? Which is a bug?

EMS control is off by one hour

A bug report. I've been aware of it for a long time. Now I posted just because I have time to do so.

When we try to control actuated components in AirLoop and PlantLoop with the built-In Unique Variable "Hour" by EMS, the components are controlled one hour later than the "Hour" we specify.

I reprodued the bug with an ExampleFile 5ZoneCAV_MaxTemp.idf (Any ExampleFiles are fine). The idf file is here (V23-2-0). I added EMS to override Fan Air Mass Flow Rate of Supply Fan 1 as follows.

Fan:VariableVolume,
    Supply Fan 1,            !- Name
    FanAvailSched,           !- Availability Schedule Name
    0.7,                     !- Fan Total Efficiency
    600.0,                   !- Pressure Rise {Pa}
    autosize,                !- Maximum Flow Rate {m3/s}
    Fraction,                !- Fan Power Minimum Flow Rate Input Method
    0.25,                    !- Fan Power Minimum Flow Fraction
    ,                        !- Fan Power Minimum Air Flow Rate {m3/s}
    0.9,                     !- Motor Efficiency
    1.0,                     !- Motor In Airstream Fraction
    0.35071223,              !- Fan Power Coefficient 1
    0.30850535,              !- Fan Power Coefficient 2
    -0.54137364,             !- Fan Power Coefficient 3
    0.87198823,              !- Fan Power Coefficient 4
    0.000,                   !- Fan Power Coefficient 5
    Main Heating Coil 1 Outlet Node,  !- Air Inlet Node Name
    VAV Sys 1 Outlet Node;   !- Air Outlet Node Name

EnergyManagementSystem:Actuator,
    Fan_Flow,                !- Name
    Supply Fan 1,            !- Actuated Component Unique Name
    Fan,                     !- Actuated Component Type
    Fan Air Mass Flow Rate;  !- Actuated Component Control Type

EnergyManagementSystem:ProgramCallingManager,
    EMS_PCM_Fan_Flow,        !- Name
    InsideHVACSystemIterationLoop,  !- EnergyPlus Model Calling Point
    EMS_Program_Fan_Flow;    !- Program Name 1

EnergyManagementSystem:Program,
    EMS_Program_Fan_Flow,    !- Name
    IF (Hour >10) && (Hour <= 15),  !- Program Line 1
    SET Fan_Flow = 0,        !- Program Line 2
    ELSE,                    !- A4
    SET Fan_Flow = 0.480944716911248,  !- A5
    ENDIF;                   !- A6

TimeStep is set to 6. The original Fan Availability Schedule is 1 for 24h a day from Jan to Mar. Fan Air Mass Flow Rate of Supply Fan 1 is supposed to be 0 kg/s from 10:10:00 to 15:00:00 aftter I added EMS above. However, the simulation result shows that it is 0 kg/s from 11:10:00 to 16:00:00.

image description

The bug occurs in other actuated components in AirLoop and PlantLoop as well such as Pumps. I haven't tested all the Calling Points, but InsideHVACSystemIterationLoop is often used to control HVAC systems, and the "Hour" specification in that calling point should be correctly simulated as entered by users.


Addendum

@Aaron Boranian, please let me show you another example. An ExampleFile EMSCustomSchedule.idf overrides Cooling Setpoint Temperature Schedule in ThermostatSetpoint:DualSetpoint as follows.

EnergyManagementSystem:Actuator,
    myCLGSETP_SCH_Override,  !- Name
    CLGSETP_SCH,             !- Actuated Component Unique Name
    Schedule:Constant,       !- Actuated Component Type
    Schedule Value;          !- Actuated Component Control Type

EnergyManagementSystem:ProgramCallingManager,
    My Setpoint Schedule Calculator Example,  !- Name
    InsideHVACSystemIterationLoop,  !- EnergyPlus Model Calling Point
    MyComputedCoolingSetpointProg,  !- Program Name 1

EnergyManagementSystem:Program,
    MyComputedCoolingSetpointProg,  !- Name
    IF (DayOfWeek == 1),     !- Program Line 1
    Set myCLGSETP_SCH_Override = 30.0,  !- Program Line 2
    ELSEIF (Holiday == 3.0) && (DayOfMonth == 21) && (Month == 1),  !- A4
    Set myCLGSETP_SCH_Override = 30.0,  !- A5
    ELSEIF HOUR < 6,         !- A6
    Set myCLGSETP_SCH_Override = 30.0,  !- A7
    ELSEIF (Hour >= 6) && (Hour < 22)  && (DayOfWeek >=2) && (DayOfWeek <=6),  !- A8
    Set myCLGSETP_SCH_Override = 24.0,  !- A9
    ELSEIF (Hour >= 6) && (hour < 18) && (DayOfWeek == 7),  !- A10
    Set myCLGSETP_SCH_Override = 24.0,  !- A11
    ELSEIF (Hour >= 6) && (hour >= 18) && (DayOfWeek == 7),  !- A12
    Set myCLGSETP_SCH_Override = 30.0,  !- A13
    ELSEIF (Hour > 22),      !- A14
    Set myCLGSETP_SCH_Override = 30.0,  !- A15
    ENDIF;                   !- A16

image description

If your answer is correct, the cooling setpoint in the chart below should be 30ºC until 06:50:00 and 24ºC from 07:00:00. However, it is actually 30ºC until 06:00:00 and 24ºC from 06:10:00. Is this a bug? Which is a bug?