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

Using Trend Variables through EMS for Shading Control

asked 2020-03-30 23:32:28 -0600

Amir Tabadkani's avatar

updated 2020-03-31 07:57:16 -0600

Dear Unmethours Community,

I am planning to actuate the blinds angle based on indoor sensors (glare index and illuminance), in which I have written the EMS coding so far as below:

EnergyManagementSystem:Sensor,
S1,                      !- Name D1,      !- Output:Variable or Output:Meter Index Key Name
Daylighting Reference Point 1 Illuminance ;  !- Output:Variable or Output:Meter Name

EnergyManagementSystem:Sensor,
S2,                      !- Name
D1,      !- Output:Variable or Output:Meter Index Key Name
Daylighting Reference Point 1 Glare Index ;  !- Output:Variable or Output:Meter Name

EnergyManagementSystem:Actuator,
myA1,                    !- Name
ASF,                     !- Actuated Component Unique Name
Schedule:Year,           !- Actuated Component Type
Schedule Value;          !- Actuated Component Control Type

EnergyManagementSystem:ProgramCallingManager,
MyComputedTransProg,     !- Name
BeginTimestepBeforePredictor,  !- EnergyPlus Model Calling Point
myProgram1;      !- Program Name 1

EnergyManagementSystem:Program,
myProgram1, ! Name
Set Daylit = S1 ,
Set DGI = S2 ,
IF (Daylit <= 2000) && (DGI < 24),
Set myA1 = 90 ,
ELSEIF (Daylit > 2000) && (DGI < 24),
Set myA1 = 25 ,
ElSEIF (Daylit > 2000) && (DGI > 24),
Set myA1 = 0,
ElSEIF (Daylit <= 2000) && (DGI > 24),
Set myA1 = 45,
ENDIF ;

EnergyManagementSystem:GlobalVariable,
myglobeA1;               !- Erl Variable 1 Name

EnergyManagementSystem:OutputVariable,
WeightedShadeFractionSchedule,  !- Name
myglobeA1,               !- EMS Variable Name
Averaged,                !- Type of Data in Variable
SystemTimestep;          !- Update Frequency

Output:EnergyManagementSystem ,
Verbose ,
Verbose ,
Verbose;

It works perfectly, but now I want to make a control logic that corresponds to the time steps, I mean I want to say if the venetian blinds had to be at 90 degrees, it should remain at least for 20 minutes (if my time steps are in minutes) regardless of sensors' values.

I have read that there is Trend Variables that I think is the one that I should use, and I have seen some examples here as well but they could not give a clue how should I perform this, or is this possible at all or not?

Cheers Amir

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-03-31 10:18:41 -0600

You don't need to use the Trend Variables to implement this. Rather, you can use the built-in EMS variables.

For example, you can store the DayOfYear and CurrentHour for the start of the 20 minutes and then compare the stored values to the current values to determine if 20 minutes has elapsed. To do this, the stored values will each need to be an EnergyManagementSystem:GlobalVariable so that they maintain their value across multiple executions of your EMS program.

edit flag offensive delete link more

Comments

Thanks a lot @shorowit

Can you please make a simple example here? I am quite confused here

Cheers

Amir Tabadkani's avatar Amir Tabadkani  ( 2020-04-04 02:20:06 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

2 followers

Stats

Asked: 2020-03-30 23:32:28 -0600

Seen: 165 times

Last updated: Mar 31 '20