Problem with EMS code to control window operation according to indoor CO2 levels [closed]
I'm using EMS to set the window operation (open = 1, closed = 0) according to the zone CO2 levels (over 800 ppm the window should open). It's working fine but the problem is that the window state changes each timestep (reaches the target - window opens / the next timestep is below the target - window closes... and so on). Any suggestions on how I could overcome this oscillation?
My code is:
EnergyManagementSystem:Sensor,
Num_People,
Ocupacao_Z1,
People Occupant Count;
EnergyManagementSystem:Sensor,
Sensor_CO2,
Z1,
Zone Air CO2 Concentration;
EnergyManagementSystem:Actuator,
Window,
Window,
Schedule:Constant,
Schedule Value;
EnergyManagementSystem:Program,
CO2_window_control,
IF (Num_People > 0) && (Sensor_CO2 >= 800),
SET Window = 1,
ELSE,
SET Window = 0,
ENDIF;
Thank you.
@Leticia the EMS program will be called each timestep, which is why the actuator for the window opening schedule also can change each timestep. Are you saying that you want the window opening schedule to change at a larger frequency (i.e. hourly), or that the window opening actuator is oscillating back and forth every timestep when it shouldn't?
Hi Aaron. I want the window opening actuator to stop oscillating. I think Eric's suggestion of adding a deadband will solve my problem, thank you!