/
Controller.mo
892 lines (806 loc) · 38.7 KB
/
Controller.mo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
within Buildings.Controls.OBC.ASHRAE.G36_PR1.AHUs.MultiZone.VAV;
block Controller "Multizone AHU controller that composes subsequences for controlling fan speed, dampers, and supply air temperature"
parameter Real samplePeriod(
final unit="s",
final quantity="Time")=120
"Sample period of component, set to the same value to the trim and respond sequence";
parameter Integer numZon(min=2) "Total number of served VAV boxes"
annotation (Dialog(group="System and building parameters"));
parameter Real AFlo[numZon](
each final unit="m2",
final quantity=fill("Area", numZon)) "Floor area of each zone"
annotation (Dialog(group="System and building parameters"));
parameter Boolean have_occSen=false
"Set to true if zones have occupancy sensor"
annotation (Dialog(group="System and building parameters"));
parameter Boolean have_winSen=false
"Set to true if zones have window status sensor"
annotation (Dialog(group="System and building parameters"));
parameter Boolean have_perZonRehBox=true
"Check if there is any VAV-reheat boxes on perimeter zones"
annotation (Dialog(group="System and building parameters"));
parameter Boolean have_duaDucBox=false
"Check if the AHU serves dual duct boxes"
annotation (Dialog(group="System and building parameters"));
parameter Boolean have_airFloMeaSta=false
"Check if the AHU has AFMS (Airflow measurement station)"
annotation (Dialog(group="System and building parameters"));
// ----------- Parameters for economizer control -----------
parameter Boolean use_enthalpy=false
"Set to true if enthalpy measurement is used in addition to temperature measurement"
annotation (Dialog(tab="Economizer"));
parameter Real delta(
final unit="s",
final quantity="Time")=5
"Time horizon over which the outdoor air flow measurment is averaged"
annotation (Dialog(tab="Economizer"));
parameter Real delTOutHis(
final unit="K",
final displayUnit="K",
final quantity="TemperatureDifference")=1
"Delta between the temperature hysteresis high and low limit"
annotation (Dialog(tab="Economizer"));
parameter Real delEntHis(
final unit="J/kg",
final quantity="SpecificEnergy")=1000
"Delta between the enthalpy hysteresis high and low limits"
annotation (Dialog(tab="Economizer", enable=use_enthalpy));
parameter Real retDamPhyPosMax(
final min=0,
final max=1,
final unit="1") = 1
"Physically fixed maximum position of the return air damper"
annotation (Dialog(tab="Economizer", group="Damper limits"));
parameter Real retDamPhyPosMin(
final min=0,
final max=1,
final unit="1") = 0
"Physically fixed minimum position of the return air damper"
annotation (Dialog(tab="Economizer", group="Damper limits"));
parameter Real outDamPhyPosMax(
final min=0,
final max=1,
final unit="1") = 1
"Physically fixed maximum position of the outdoor air damper"
annotation (Dialog(tab="Economizer", group="Damper limits"));
parameter Real outDamPhyPosMin(
final min=0,
final max=1,
final unit="1") = 0
"Physically fixed minimum position of the outdoor air damper"
annotation (Dialog(tab="Economizer", group="Damper limits"));
parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerTypeMinOut=
Buildings.Controls.OBC.CDL.Types.SimpleController.PI
"Type of controller"
annotation (Dialog(group="Economizer PID controller"));
parameter Real kMinOut(final unit="1")=0.05
"Gain of controller for minimum outdoor air intake"
annotation (Dialog(group="Economizer PID controller"));
parameter Real TiMinOut(
final unit="s",
final quantity="Time")=1200
"Time constant of controller for minimum outdoor air intake"
annotation (Dialog(group="Economizer PID controller",
enable=controllerTypeMinOut == Buildings.Controls.OBC.CDL.Types.SimpleController.PI
or controllerTypeMinOut == Buildings.Controls.OBC.CDL.Types.SimpleController.PID));
parameter Real TdMinOut(
final unit="s",
final quantity="Time")=0.1
"Time constant of derivative block for minimum outdoor air intake"
annotation (Dialog(group="Economizer PID controller",
enable=controllerTypeMinOut == Buildings.Controls.OBC.CDL.Types.SimpleController.PD
or controllerTypeMinOut == Buildings.Controls.OBC.CDL.Types.SimpleController.PID));
parameter Boolean use_TMix=true
"Set to true if mixed air temperature measurement is enabled"
annotation(Dialog(group="Economizer freeze protection"));
parameter Boolean use_G36FrePro=false
"Set to true to use G36 freeze protection"
annotation(Dialog(group="Economizer freeze protection"));
parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerTypeFre=
Buildings.Controls.OBC.CDL.Types.SimpleController.PI
"Type of controller"
annotation(Dialog(group="Economizer freeze protection", enable=use_TMix));
parameter Real kFre(final unit="1/K") = 0.1
"Gain for mixed air temperature tracking for freeze protection, used if use_TMix=true"
annotation(Dialog(group="Economizer freeze protection", enable=use_TMix));
parameter Real TiFre(
final unit="s",
final quantity="Time",
final max=TiMinOut)=120
"Time constant of controller for mixed air temperature tracking for freeze protection. Require TiFre < TiMinOut"
annotation(Dialog(group="Economizer freeze protection",
enable=use_TMix
and (controllerTypeFre == Buildings.Controls.OBC.CDL.Types.SimpleController.PI
or controllerTypeFre == Buildings.Controls.OBC.CDL.Types.SimpleController.PID)));
parameter Real TdFre(
final unit="s",
final quantity="Time")=0.1
"Time constant of derivative block for freeze protection"
annotation (Dialog(group="Economizer freeze protection",
enable=use_TMix and
(controllerTypeFre == Buildings.Controls.OBC.CDL.Types.SimpleController.PD
or controllerTypeFre == Buildings.Controls.OBC.CDL.Types.SimpleController.PID)));
parameter Real TFreSet(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")= 279.15
"Lower limit for mixed air temperature for freeze protection, used if use_TMix=true"
annotation(Dialog(group="Economizer freeze protection", enable=use_TMix));
parameter Real yMinDamLim=0
"Lower limit of damper position limits control signal output"
annotation (Dialog(tab="Economizer", group="Damper limits"));
parameter Real yMaxDamLim=1
"Upper limit of damper position limits control signal output"
annotation (Dialog(tab="Economizer", group="Damper limits"));
parameter Real retDamFulOpeTim(
final unit="s",
final quantity="Time")=180
"Time period to keep RA damper fully open before releasing it for minimum outdoor airflow control
at disable to avoid pressure fluctuations"
annotation (Dialog(tab="Economizer", group="Economizer delays at disable"));
parameter Real disDel(
final unit="s",
final quantity="Time")=15
"Short time delay before closing the OA damper at disable to avoid pressure fluctuations"
annotation (Dialog(tab="Economizer", group="Economizer delays at disable"));
// ----------- parameters for fan speed control -----------
parameter Real pIniSet(
final unit="Pa",
final displayUnit="Pa",
final quantity="PressureDifference")=60
"Initial pressure setpoint for fan speed control"
annotation (Dialog(tab="Fan speed", group="Trim and respond for reseting duct static pressure setpoint"));
parameter Real pMinSet(
final unit="Pa",
final displayUnit="Pa",
final quantity="PressureDifference")=25
"Minimum pressure setpoint for fan speed control"
annotation (Dialog(tab="Fan speed", group="Trim and respond for reseting duct static pressure setpoint"));
parameter Real pMaxSet(
final unit="Pa",
final displayUnit="Pa",
final quantity="PressureDifference")=400
"Maximum pressure setpoint for fan speed control"
annotation (Dialog(tab="Fan speed", group="Trim and respond for reseting duct static pressure setpoint"));
parameter Real pDelTim(
final unit="s",
final quantity="Time")=600
"Delay time after which trim and respond is activated"
annotation (Dialog(tab="Fan speed", group="Trim and respond for reseting duct static pressure setpoint"));
parameter Integer pNumIgnReq=2
"Number of ignored requests for fan speed control"
annotation (Dialog(tab="Fan speed", group="Trim and respond for reseting duct static pressure setpoint"));
parameter Real pTriAmo(
final unit="Pa",
final displayUnit="Pa",
final quantity="PressureDifference")=-12.0
"Trim amount for fan speed control"
annotation (Dialog(tab="Fan speed", group="Trim and respond for reseting duct static pressure setpoint"));
parameter Real pResAmo(
final unit="Pa",
final displayUnit="Pa",
final quantity="PressureDifference")=15
"Respond amount (must be opposite in to triAmo) for fan speed control"
annotation (Dialog(tab="Fan speed", group="Trim and respond for reseting duct static pressure setpoint"));
parameter Real pMaxRes(
final unit="Pa",
final displayUnit="Pa",
final quantity="PressureDifference")=32
"Maximum response per time interval (same sign as resAmo) for fan speed control"
annotation (Dialog(tab="Fan speed", group="Trim and respond for reseting duct static pressure setpoint"));
parameter Buildings.Controls.OBC.CDL.Types.SimpleController
controllerTypeFanSpe=Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller"
annotation (Dialog(group="Fan speed PID controller"));
parameter Real kFanSpe(final unit="1")=0.1
"Gain of fan fan speed controller, normalized using pMaxSet"
annotation (Dialog(group="Fan speed PID controller"));
parameter Real TiFanSpe(
final unit="s",
final quantity="Time")=60
"Time constant of integrator block for fan speed"
annotation (Dialog(group="Fan speed PID controller",
enable=controllerTypeFanSpe == Buildings.Controls.OBC.CDL.Types.SimpleController.PI
or controllerTypeFanSpe == Buildings.Controls.OBC.CDL.Types.SimpleController.PID));
parameter Real TdFanSpe(
final unit="s",
final quantity="Time")=0.1
"Time constant of derivative block for fan speed"
annotation (Dialog(group="Fan speed PID controller",
enable=controllerTypeFanSpe == Buildings.Controls.OBC.CDL.Types.SimpleController.PD
or controllerTypeFanSpe == Buildings.Controls.OBC.CDL.Types.SimpleController.PID));
parameter Real yFanMax=1 "Maximum allowed fan speed"
annotation (Dialog(group="Fan speed PID controller"));
parameter Real yFanMin=0.1 "Lowest allowed fan speed if fan is on"
annotation (Dialog(group="Fan speed PID controller"));
// ----------- parameters for minimum outdoor airflow setting -----------
parameter Real zonDisEffHea[numZon]=
fill(0.8, outAirSetPoi.numZon)
"Zone air distribution effectiveness during heating"
annotation (Dialog(tab="Minimum outdoor airflow rate"));
parameter Real zonDisEffCoo[numZon]=
fill(1.0, outAirSetPoi.numZon)
"Zone air distribution effectiveness during cooling"
annotation (Dialog(tab="Minimum outdoor airflow rate"));
parameter Real occDen[numZon](each final unit="1/m2")=
fill(0.05, outAirSetPoi.numZon)
"Default number of person in unit area"
annotation (Dialog(tab="Minimum outdoor airflow rate", group="Nominal conditions"));
parameter Real VOutPerAre_flow[numZon](
each final unit = "m3/(s.m2)")=fill(3e-4, outAirSetPoi.numZon)
"Outdoor air rate per unit area"
annotation (Dialog(tab="Minimum outdoor airflow rate", group="Nominal conditions"));
parameter Real VOutPerPer_flow[numZon](
each final unit="m3/s",
final quantity=fill("VolumeFlowRate", numZon))=fill(2.5e-3, outAirSetPoi.numZon)
"Outdoor air rate per person"
annotation (Dialog(tab="Minimum outdoor airflow rate", group="Nominal conditions"));
parameter Real minZonPriFlo[numZon](
each final unit="m3/s",
final quantity=fill("VolumeFlowRate", numZon))
"Minimum expected zone primary flow rate"
annotation (Dialog(tab="Minimum outdoor airflow rate", group="Nominal conditions"));
parameter Real VPriSysMax_flow(
final unit="m3/s",
final quantity="VolumeFlowRate")
"Maximum expected system primary airflow at design stage"
annotation (Dialog(tab="Minimum outdoor airflow rate", group="Nominal conditions"));
parameter Real desZonDisEff[numZon]=fill(1.0, outAirSetPoi.numZon)
"Design zone air distribution effectiveness"
annotation (Dialog(tab="Minimum outdoor airflow rate", group="Nominal conditions"));
parameter Real desZonPop[numZon]={
outAirSetPoi.occDen[i]*outAirSetPoi.AFlo[i]
for i in 1:outAirSetPoi.numZon}
"Design zone population during peak occupancy"
annotation (Dialog(tab="Minimum outdoor airflow rate", group="Nominal conditions"));
parameter Real peaSysPop=1.2*sum(
{outAirSetPoi.occDen[iZon]*outAirSetPoi.AFlo[iZon]
for iZon in 1:outAirSetPoi.numZon})
"Peak system population"
annotation (Dialog(tab="Minimum outdoor airflow rate", group="Nominal conditions"));
// parameter Real uLow=-0.5
// "If zone space temperature minus supply air temperature is less than uLow,
// then it should use heating supply air distribution effectiveness"
// annotation (Dialog(tab="Minimum outdoor airflow rate", group="Advanced"));
// parameter Real uHig=0.5
// "If zone space temperature minus supply air temperature is more than uHig,
// then it should use cooling supply air distribution effectiveness"
// annotation (Dialog(tab="Minimum outdoor airflow rate", group="Advanced"));
// ----------- parameters for supply air temperature control -----------
parameter Real TSupSetMin(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")=285.15
"Lowest cooling supply air temperature setpoint"
annotation (Dialog(tab="Supply air temperature", group="Temperature limits"));
parameter Real TSupSetMax(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")=291.15
"Highest cooling supply air temperature setpoint. It is typically 18 degC (65 degF) in mild and dry climates, 16 degC (60 degF) or lower in humid climates"
annotation (Dialog(tab="Supply air temperature", group="Temperature limits"));
parameter Real TSupSetDes(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")=286.15
"Nominal supply air temperature setpoint"
annotation (Dialog(tab="Supply air temperature", group="Temperature limits"));
parameter Real TOutMin(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")=289.15
"Lower value of the outdoor air temperature reset range. Typically value is 16 degC (60 degF)"
annotation (Dialog(tab="Supply air temperature", group="Temperature limits"));
parameter Real TOutMax(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")=294.15
"Higher value of the outdoor air temperature reset range. Typically value is 21 degC (70 degF)"
annotation (Dialog(tab="Supply air temperature", group="Temperature limits"));
parameter Real iniSetSupTem(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")=supTemSetPoi.maxSet
"Initial setpoint for supply temperature control"
annotation (Dialog(tab="Supply air temperature", group="Trim and respond for reseting TSup setpoint"));
parameter Real maxSetSupTem(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")=supTemSetPoi.TSupSetMax
"Maximum setpoint for supply temperature control"
annotation (Dialog(tab="Supply air temperature", group="Trim and respond for reseting TSup setpoint"));
parameter Real minSetSupTem(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")=supTemSetPoi.TSupSetDes
"Minimum setpoint for supply temperature control"
annotation (Dialog(tab="Supply air temperature", group="Trim and respond for reseting TSup setpoint"));
parameter Real delTimSupTem(
final unit="s",
final quantity="Time")=600
"Delay timer for supply temperature control"
annotation (Dialog(tab="Supply air temperature", group="Trim and respond for reseting TSup setpoint"));
parameter Integer numIgnReqSupTem=2
"Number of ignorable requests for supply temperature control"
annotation (Dialog(tab="Supply air temperature", group="Trim and respond for reseting TSup setpoint"));
parameter Real triAmoSupTem(
final unit="K",
final displayUnit="K",
final quantity="TemperatureDifference")=0.1
"Trim amount for supply temperature control"
annotation (Dialog(tab="Supply air temperature", group="Trim and respond for reseting TSup setpoint"));
parameter Real resAmoSupTem(
final unit="K",
final displayUnit="K",
final quantity="TemperatureDifference")=-0.2
"Response amount for supply temperature control"
annotation (Dialog(tab="Supply air temperature", group="Trim and respond for reseting TSup setpoint"));
parameter Real maxResSupTem(
final unit="K",
final displayUnit="K",
final quantity="TemperatureDifference")=-0.6
"Maximum response per time interval for supply temperature control"
annotation (Dialog(tab="Supply air temperature", group="Trim and respond for reseting TSup setpoint"));
parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerTypeTSup=
Buildings.Controls.OBC.CDL.Types.SimpleController.PI
"Type of controller for supply air temperature signal"
annotation (Dialog(group="Supply air temperature"));
parameter Real kTSup(final unit="1/K")=0.05
"Gain of controller for supply air temperature signal"
annotation (Dialog(group="Supply air temperature"));
parameter Real TiTSup(
final unit="s",
final quantity="Time")=600
"Time constant of integrator block for supply air temperature control signal"
annotation (Dialog(group="Supply air temperature",
enable=controllerTypeTSup == Buildings.Controls.OBC.CDL.Types.SimpleController.PI
or controllerTypeTSup == Buildings.Controls.OBC.CDL.Types.SimpleController.PID));
parameter Real TdTSup(
final unit="s",
final quantity="Time")=0.1
"Time constant of integrator block for supply air temperature control signal"
annotation (Dialog(group="Supply air temperature",
enable=controllerTypeTSup == Buildings.Controls.OBC.CDL.Types.SimpleController.PD
or controllerTypeTSup == Buildings.Controls.OBC.CDL.Types.SimpleController.PID));
parameter Real uHeaMax(min=-0.9)=-0.25
"Upper limit of controller signal when heating coil is off. Require -1 < uHeaMax < uCooMin < 1."
annotation (Dialog(group="Supply air temperature"));
parameter Real uCooMin(max=0.9)=0.25
"Lower limit of controller signal when cooling coil is off. Require -1 < uHeaMax < uCooMin < 1."
annotation (Dialog(group="Supply air temperature"));
Buildings.Controls.OBC.CDL.Interfaces.RealInput VDis_flow[numZon](
each final unit="m3/s",
each quantity="VolumeFlowRate",
each min=0)
"Primary airflow rate to the ventilation zone from the air handler, including outdoor air and recirculated air"
annotation (Placement(transformation(extent={{-240,130},{-200,170}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput TMix(
final unit="K",
final displayUnit="degC",
final quantity = "ThermodynamicTemperature") if use_TMix
"Measured mixed air temperature, used for freeze protection if use_TMix=true"
annotation (Placement(transformation(extent={{-240,-150},{-200,-110}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput ducStaPre(
final unit="Pa",
final displayUnit="Pa")
"Measured duct static pressure"
annotation (Placement(transformation(extent={{-240,100},{-200,140}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput TOut(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature") "Outdoor air temperature"
annotation (Placement(transformation(extent={{-240,160},{-200,200}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput TOutCut(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")
"OA temperature high limit cutoff. For differential dry bulb temeprature condition use return air temperature measurement"
annotation (Placement(transformation(extent={{-240,-30},{-200,10}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput hOut(
final unit="J/kg",
final quantity="SpecificEnergy") if use_enthalpy "Outdoor air enthalpy"
annotation (Placement(transformation(extent={{-240,-60},{-200,-20}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput hOutCut(
final unit="J/kg",
final quantity="SpecificEnergy") if use_enthalpy
"OA enthalpy high limit cutoff. For differential enthalpy use return air enthalpy measurement"
annotation (Placement(transformation(extent={{-240,-90},{-200,-50}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput TSup(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")
"Measured supply air temperature"
annotation (Placement(transformation(extent={{-240,0},{-200,40}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput TZonHeaSet(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")
"Zone air temperature heating setpoint"
annotation (Placement(transformation(extent={{-240,250},{-200,290}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput VOut_flow(
final unit="m3/s",
final quantity="VolumeFlowRate")
"Measured outdoor volumetric airflow rate"
annotation (Placement(transformation(extent={{-240,-120},{-200,-80}})));
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput nOcc[numZon] if have_occSen
"Number of occupants"
annotation (Placement(transformation(extent={{-240,70},{-200,110}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput TZon[numZon](
each final unit="K",
each final displayUnit="degC",
each final quantity="ThermodynamicTemperature")
"Measured zone air temperature"
annotation (Placement(transformation(extent={{-240,50},{-200,90}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput TDis[numZon](
each final unit="K",
each final displayUnit="degC",
each final quantity="ThermodynamicTemperature")
"Discharge air temperature"
annotation (Placement(transformation(extent={{-240,30},{-200,70}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput TZonCooSet(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")
"Zone air temperature cooling setpoint"
annotation (Placement(transformation(extent={{-240,220},{-200,260}})));
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput uZonTemResReq
"Zone cooling supply air temperature reset request"
annotation (Placement(transformation(extent={{-240,-210},{-200,-170}})));
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput uZonPreResReq
"Zone static pressure reset requests"
annotation (Placement(transformation(extent={{-240,-240},{-200,-200}})));
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput uOpeMod
"AHU operation mode status signal"
annotation (Placement(transformation(extent={{-240,-180},{-200,-140}})));
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uWin[numZon] if have_winSen
"Window status, true if open, false if closed"
annotation (Placement(transformation(extent={{-240,190},{-200,230}})));
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput uFreProSta if
use_G36FrePro
"Freeze protection status, used if use_G36FrePro=true"
annotation (Placement(transformation(extent={{-240,-270},{-200,-230}})));
Buildings.Controls.OBC.CDL.Interfaces.RealOutput TSupSet(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")
"Setpoint for supply air temperature"
annotation (Placement(transformation(extent={{200,70},{240,110}})));
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yHea(
final min=0,
final max=1,
final unit="1")
"Control signal for heating"
annotation (Placement(transformation(extent={{200,30},{240,70}})));
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yCoo(
final min=0,
final max=1,
final unit="1") "Control signal for cooling"
annotation (Placement(transformation(extent={{200,-20},{240,20}})));
Buildings.Controls.OBC.CDL.Interfaces.RealOutput ySupFanSpe(
final min=0,
final max=1,
final unit="1") "Supply fan speed"
annotation (Placement(transformation(extent={{200,110},{240,150}})));
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yRetDamPos(
final min=0,
final max=1,
final unit="1") "Return air damper position"
annotation (Placement(transformation(extent={{200,-60},{240,-20}})));
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yOutDamPos(
final min=0,
final max=1,
final unit="1") "Outdoor air damper position"
annotation (Placement(transformation(extent={{200,-160},{240,-120}})));
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput ySupFan
"Supply fan status, true if fan should be on"
annotation (Placement(transformation(extent={{200,170},{240,210}})));
Buildings.Controls.OBC.CDL.Continuous.Average TZonSetPoiAve
"Average of all zone set points"
annotation (Placement(transformation(extent={{-160,240},{-140,260}})));
Buildings.Controls.OBC.ASHRAE.G36_PR1.AHUs.MultiZone.VAV.SetPoints.OutsideAirFlow
outAirSetPoi(
final AFlo=AFlo,
final VPriSysMax_flow=VPriSysMax_flow,
final minZonPriFlo=minZonPriFlo,
final numZon=numZon,
final have_occSen=have_occSen,
final VOutPerAre_flow=VOutPerAre_flow,
final VOutPerPer_flow=VOutPerPer_flow,
final occDen=occDen,
final zonDisEffHea=zonDisEffHea,
final zonDisEffCoo=zonDisEffCoo,
final desZonDisEff=desZonDisEff,
final desZonPop=desZonPop,
final peaSysPop=peaSysPop,
final have_winSen=have_winSen)
"Controller for minimum outdoor airflow rate"
annotation (Placement(transformation(extent={{-40,30},{-20,50}})));
Buildings.Controls.OBC.ASHRAE.G36_PR1.AHUs.MultiZone.VAV.SetPoints.SupplyFan
supFan(
final numZon=numZon,
final samplePeriod=samplePeriod,
final have_perZonRehBox=have_perZonRehBox,
final have_duaDucBox=have_duaDucBox,
final have_airFloMeaSta=have_airFloMeaSta,
final iniSet=pIniSet,
final minSet=pMinSet,
final maxSet=pMaxSet,
final delTim=pDelTim,
final numIgnReq=pNumIgnReq,
final triAmo=pTriAmo,
final resAmo=pResAmo,
final maxRes=pMaxRes,
final controllerType=controllerTypeFanSpe,
final k=kFanSpe,
final Ti=TiFanSpe,
final Td=TdFanSpe,
final yFanMax=yFanMax,
final yFanMin=yFanMin)
"Supply fan controller"
annotation (Placement(transformation(extent={{-160,100},{-140,120}})));
Buildings.Controls.OBC.ASHRAE.G36_PR1.AHUs.MultiZone.VAV.SetPoints.SupplyTemperature
supTemSetPoi(
final samplePeriod=samplePeriod,
final TSupSetMin=TSupSetMin,
final TSupSetMax=TSupSetMax,
final TSupSetDes=TSupSetDes,
final TOutMin=TOutMin,
final TOutMax=TOutMax,
final iniSet=iniSetSupTem,
final maxSet=maxSetSupTem,
final minSet=minSetSupTem,
final delTim=delTimSupTem,
final numIgnReq=numIgnReqSupTem,
final triAmo=triAmoSupTem,
final resAmo=resAmoSupTem,
final maxRes=maxResSupTem) "Setpoint for supply temperature"
annotation (Placement(transformation(extent={{0,60},{20,80}})));
Buildings.Controls.OBC.ASHRAE.G36_PR1.AHUs.MultiZone.VAV.Economizers.Controller eco(
final use_enthalpy=use_enthalpy,
final delTOutHis=delTOutHis,
final delEntHis=delEntHis,
final retDamFulOpeTim=retDamFulOpeTim,
final disDel=disDel,
final controllerTypeMinOut=controllerTypeMinOut,
final kMinOut=kMinOut,
final TiMinOut=TiMinOut,
final TdMinOut=TdMinOut,
final retDamPhyPosMax=retDamPhyPosMax,
final retDamPhyPosMin=retDamPhyPosMin,
final outDamPhyPosMax=outDamPhyPosMax,
final outDamPhyPosMin=outDamPhyPosMin,
final uHeaMax=uHeaMax,
final uCooMin=uCooMin,
final uOutDamMax=(uHeaMax + uCooMin)/2,
final uRetDamMin=(uHeaMax + uCooMin)/2,
final TFreSet=TFreSet,
final controllerTypeFre=controllerTypeFre,
final kFre=kFre,
final TiFre=TiFre,
final TdFre=TdFre,
final delta=delta,
final use_TMix=use_TMix,
final use_G36FrePro=use_G36FrePro) "Economizer controller"
annotation (Placement(transformation(extent={{140,-80},{160,-60}})));
Buildings.Controls.OBC.ASHRAE.G36_PR1.AHUs.MultiZone.VAV.SetPoints.SupplySignals val(
final controllerType=controllerTypeTSup,
final kTSup=kTSup,
final TiTSup=TiTSup,
final TdTSup=TdTSup,
final uHeaMax=uHeaMax,
final uCooMin=uCooMin) "AHU coil valve control"
annotation (Placement(transformation(extent={{80,0},{100,20}})));
protected
Buildings.Controls.OBC.CDL.Continuous.Division VOut_flow_normalized(
u1(final unit="m3/s"),
u2(final unit="m3/s"),
y(final unit="1"))
"Normalization of outdoor air flow intake by design minimum outdoor air intake"
annotation (Placement(transformation(extent={{20,-40},{40,-20}})));
equation
connect(eco.yRetDamPos, yRetDamPos)
annotation (Line(points={{161.25,-67.5},{180,-67.5},{180,-40},{220,-40}},
color={0,0,127}));
connect(eco.yOutDamPos, yOutDamPos)
annotation (Line(points={{161.25,-72.5},{180,-72.5},{180,-140},{220,-140}},
color={0,0,127}));
connect(eco.uSupFan, supFan.ySupFan)
annotation (Line(points={{138.75,-75},{-84,-75},{-84,117},{-138,117}},
color={255,0,255}));
connect(supFan.ySupFanSpe, ySupFanSpe)
annotation (Line(points={{-138,110},{42,110},{42,130},{220,130}},
color={0,0,127}));
connect(TOut, eco.TOut)
annotation (Line(points={{-220,180},{-60,180},{-60,-60.625},{138.75,-60.625}},
color={0,0,127}));
connect(eco.TOutCut, TOutCut)
annotation (Line(points={{138.75,-62.5},{-74,-62.5},{-74,-10},{-220,-10}},
color={0,0,127}));
connect(eco.hOut, hOut)
annotation (Line(points={{138.75,-64.375},{-78,-64.375},{-78,-40},{-220,-40}},
color={0,0,127}));
connect(eco.hOutCut, hOutCut)
annotation (Line(points={{138.75,-65.625},{-94,-65.625},{-94,-70},{-220,-70}},
color={0,0,127}));
connect(eco.uOpeMod, uOpeMod)
annotation (Line(points={{138.75,-76.875},{60,-76.875},{60,-160},{-220,-160}},
color={255,127,0}));
connect(supTemSetPoi.TSupSet, TSupSet)
annotation (Line(points={{22,70},{122,70},{122,90},{220,90}}, color={0,0,127}));
connect(supTemSetPoi.TOut, TOut)
annotation (Line(points={{-2,74},{-60,74},{-60,180},{-220,180}},
color={0,0,127}));
connect(supTemSetPoi.uSupFan, supFan.ySupFan)
annotation (Line(points={{-2,66},{-84,66},{-84,117},{-138,117}},
color={255,0,255}));
connect(supTemSetPoi.uZonTemResReq, uZonTemResReq)
annotation (Line(points={{-2,70},{-52,70},{-52,-190},{-220,-190}},
color={255,127,0}));
connect(supTemSetPoi.uOpeMod, uOpeMod)
annotation (Line(points={{-2,62},{-48,62},{-48,-160},{-220,-160}},
color={255,127,0}));
connect(supFan.uOpeMod, uOpeMod)
annotation (Line(points={{-162,118},{-180,118},{-180,-160},{-220,-160}},
color={255,127,0}));
connect(supFan.uZonPreResReq, uZonPreResReq)
annotation (Line(points={{-162,107},{-176,107},{-176,-220},{-220,-220}},
color={255,127,0}));
connect(supFan.ducStaPre, ducStaPre)
annotation (Line(points={{-162,102},{-192,102},{-192,120},{-220,120}},
color={0,0,127}));
connect(eco.VOutMinSet_flow_normalized, outAirSetPoi.VOutMinSet_flow)
annotation (Line(points={{138.75,-71.25},{-4,-71.25},{-4,37},{-18,37}},
color={0,0,127}));
connect(outAirSetPoi.nOcc, nOcc)
annotation (Line(points={{-42,49},{-128,49},{-128,90},{-220,90}},
color={255,127,0}));
connect(outAirSetPoi.TZon, TZon)
annotation (Line(points={{-42,43},{-132,43},{-132,70},{-220,70}},
color={0,0,127}));
connect(outAirSetPoi.TDis, TDis)
annotation (Line(points={{-42,40},{-126,40},{-126,50},{-220,50}},
color={0,0,127}));
connect(supFan.ySupFan, outAirSetPoi.uSupFan)
annotation (Line(points={{-138,117},{-84,117},{-84,37},{-42,37}},
color={255,0,255}));
connect(supTemSetPoi.TZonSetAve, TZonSetPoiAve.y)
annotation (Line(points={{-2,78},{-20,78},{-20,250},{-138,250}},
color={0,0,127}));
connect(outAirSetPoi.VDis_flow, VDis_flow)
annotation (Line(points={{-42,31},{-184,31},{-184,150},{-220,150}},
color={0,0,127}));
connect(supFan.VDis_flow, VDis_flow)
annotation (Line(points={{-162,113},{-184,113},{-184,150},{-220,150}},
color={0,0,127}));
connect(supFan.ySupFan, ySupFan)
annotation (Line(points={{-138,117},{180,117},{180,190},{220,190}},
color={255,0,255}));
connect(outAirSetPoi.uOpeMod, uOpeMod)
annotation (Line(points={{-42,34},{-120,34},{-120,-160},{-220,-160}},
color={255,127,0}));
connect(TZonSetPoiAve.u2, TZonCooSet)
annotation (Line(points={{-162,244},{-180,244},{-180,240},{-220,240}},
color={0,0,127}));
connect(eco.TMix, TMix)
annotation (Line(points={{138.75,-73.125},{-12,-73.125},{-12,-130},{-220,-130}},
color={0,0,127}));
connect(TSup, val.TSup)
annotation (Line(points={{-220,20},{-66,20},{-66,5},{78,5}},
color={0,0,127}));
connect(supFan.ySupFan, val.uSupFan)
annotation (Line(points={{-138,117},{-84,117},{-84,15},{78,15}},
color={255,0,255}));
connect(val.uTSup, eco.uTSup)
annotation (Line(points={{102,14},{120,14},{120,-67.5},{138.75,-67.5}},
color={0,0,127}));
connect(val.yHea, yHea)
annotation (Line(points={{102,10},{180,10},{180,50},{220,50}},
color={0,0,127}));
connect(val.yCoo, yCoo)
annotation (Line(points={{102,6},{180,6},{180,0},{220,0}},
color={0,0,127}));
connect(outAirSetPoi.uWin, uWin)
annotation (Line(points={{-42,46},{-120,46},{-120,210},{-220,210}},
color={255,0,255}));
connect(supTemSetPoi.TSupSet, val.TSupSet)
annotation (Line(points={{22,70},{40,70},{40,10},{78,10}},
color={0,0,127}));
connect(TZonHeaSet, TZonSetPoiAve.u1)
annotation (Line(points={{-220,270},{-180,270},{-180,256},{-162,256}},
color={0,0,127}));
connect(eco.uFreProSta, uFreProSta)
annotation (Line(points={{138.75,-79.375},{66,-79.375},{66,-250},{-220,-250}},
color={255,127,0}));
connect(eco.VOut_flow_normalized, VOut_flow_normalized.y)
annotation (Line(points={{138.75,-69.375},{60,-69.375},{60,-30},{42,-30}},
color={0,0,127}));
connect(outAirSetPoi.VDesOutMin_flow_nominal, VOut_flow_normalized.u2)
annotation (Line(points={{-18,43},{0,43},{0,-36},{18,-36}}, color={0,0,127}));
connect(VOut_flow_normalized.u1, VOut_flow)
annotation (Line(points={{18,-24},{-160,-24},{-160,-100},{-220,-100}},
color={0,0,127}));
annotation (defaultComponentName="conAHU",
Diagram(coordinateSystem(extent={{-200,-280},{200,280}}, initialScale=0.2)),
Icon(coordinateSystem(extent={{-200,-280},{200,280}}, initialScale=0.2),
graphics={Rectangle(
extent={{200,280},{-200,-280}},
lineColor={0,0,0},
fillColor={255,255,255},
fillPattern=FillPattern.Solid), Text(
extent={{-148,328},{152,288}},
textString="%name",
lineColor={0,0,255})}),
Documentation(info="<html>
<p>
Block that is applied for multizone VAV AHU control. It outputs the supply fan status
and the operation speed, outdoor and return air damper position, supply air
temperature setpoint and the valve position of the cooling and heating coils.
It is implemented according to the ASHRAE Guideline 36, PART 5.N.
</p>
<p>
The sequence consists of five subsequences.
</p>
<h4>Supply fan speed control</h4>
<p>
The fan speed control is implemented according to PART 5.N.1. It outputs
the boolean signal <code>ySupFan</code> to turn on or off the supply fan.
In addition, based on the pressure reset request <code>uZonPreResReq</code>
from the VAV zones controller, the
sequence resets the duct pressure setpoint, and uses this setpoint
to modulate the fan speed <code>ySupFanSpe</code> using a PI controller.
See
<a href=\"modelica://Buildings.Controls.OBC.ASHRAE.G36_PR1.AHUs.MultiZone.VAV.SetPoints.SupplyFan\">
Buildings.Controls.OBC.ASHRAE.G36_PR1.AHUs.MultiZone.VAV.SetPoints.SupplyFan</a>
for more detailed description.
</p>
<h4>Minimum outdoor airflow setting</h4>
<p>
According to current occupany <code>nOcc</code>, supply operation status
<code>ySupFan</code>, zone temperatures <code>TZon</code> and the discharge
air temperature <code>TDis</code>, the sequence computes the minimum outdoor airflow rate
setpoint, which is used as input for the economizer control. More detailed
information can be found in
<a href=\"modelica://Buildings.Controls.OBC.ASHRAE.G36_PR1.AHUs.MultiZone.VAV.SetPoints.OutsideAirFlow\">
Buildings.Controls.OBC.ASHRAE.G36_PR1.AHUs.MultiZone.VAV.SetPoints.OutsideAirFlow</a>.
</p>
<h4>Economizer control</h4>
<p>
The block outputs outdoor and return air damper position, <code>yOutDamPos</code> and
<code>yRetDamPos</code>. First, it computes the position limits to satisfy the minimum
outdoor airflow requirement. Second, it determines the availability of the economizer based
on the outdoor condition. The dampers are modulated to track the supply air temperature
loop signal, which is calculated from the sequence below, subject to the minimum outdoor airflow
requirement and economizer availability. Optionally, there is also an override for freeze protection.
See
<a href=\"modelica://Buildings.Controls.OBC.ASHRAE.G36_PR1.AHUs.MultiZone.VAV.Economizers.Controller\">
Buildings.Controls.OBC.ASHRAE.G36_PR1.AHUs.MultiZone.VAV.Economizers.Controller</a>
for more detailed description.
</p>
<h4>Supply air temperature setpoint</h4>
<p>
Based on PART 5.N.2, the sequence first sets the maximum supply air temperature
based on reset requests collected from each zone <code>uZonTemResReq</code>. The
outdoor temperature <code>TOut</code> and operation mode <code>uOpeMod</code> are used
along with the maximum supply air temperature, for computing the supply air temperature
setpoint. See
<a href=\"modelica://Buildings.Controls.OBC.ASHRAE.G36_PR1.AHUs.MultiZone.VAV.SetPoints.SupplyTemperature\">
Buildings.Controls.OBC.ASHRAE.G36_PR1.AHUs.MultiZone.VAV.SetPoints.SupplyTemperature</a>
for more detailed description.
</p>
<h4>Coil valve control</h4>
<p>
The subsequence retrieves supply air temperature setpoint from previous sequence.
Along with the measured supply air temperature and the supply fan status, it
generates coil valve positions. See
<a href=\"modelica://Buildings.Controls.OBC.ASHRAE.G36_PR1.AHUs.MultiZone.VAV.SetPoints.SupplySignals\">
Buildings.Controls.OBC.ASHRAE.G36_PR1.AHUs.MultiZone.VAV.SetPoints.SupplySignals</a>
</p>
</html>",
revisions="<html>
<ul>
<li>
October 27, 2017, by Jianjun Hu:<br/>
First implementation.
</li>
</ul>
</html>"));
end Controller;