Skip to content

Commit 78bd717

Browse files
Refactor for latest controller updates
1 parent 5d7ac6b commit 78bd717

15 files changed

Lines changed: 1472 additions & 1887 deletions

File tree

Buildings/Templates/Components/Interfaces/PartialBoilerHotWater.mo

Lines changed: 15 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,9 @@ partial model PartialBoilerHotWater "Interface class for hot water boiler models
4747
"Boiler"
4848
annotation (Placement(transformation(extent={{-10,-70},{10,-50}})));
4949

50-
Buildings.Controls.OBC.CDL.Reals.PIDWithReset ctl(
51-
Ti=60,
52-
final yMax=1,
53-
final yMin=0,
54-
final reverseActing=true)
50+
Plants.Controls.Utilities.PIDWithEnable ctlPID
5551
"HW supply temperature controller"
56-
annotation (Placement(transformation(extent={{-50,30},{-30,50}})));
57-
Buildings.Controls.OBC.CDL.Reals.Switch swiSet
58-
"Switch setpoint to measured value when disabled"
59-
annotation (Placement(transformation(extent={{-80,30},{-60,50}})));
60-
Buildings.Controls.OBC.CDL.Reals.Switch swiSig
61-
"Switch control signal to zero when disabled"
62-
annotation (Placement(transformation(extent={{0,30},{20,50}})));
63-
Buildings.Controls.OBC.CDL.Reals.Sources.Constant valDis(final k=0)
64-
"Value when disabled"
6552
annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
66-
6753
initial equation
6854
if typMod==Buildings.Templates.Components.Types.BoilerHotWaterModel.Table then
6955
assert(mHeaWat_flow_nominal <= dat.per.m_flow_nominal,
@@ -93,38 +79,24 @@ equation
9379
connect(boi.port_b, port_b)
9480
annotation (Line(points={{10,-60},{80,-60},{80,0},{100,0}},
9581
color={0,127,255}));
96-
connect(boi.T, ctl.u_m) annotation (Line(points={{11,-52},{20,-52},{20,20},{
97-
-40,20},{-40,28}},
98-
color={0,0,127}));
99-
connect(swiSet.y, ctl.u_s)
100-
annotation (Line(points={{-58,40},{-52,40}}, color={0,0,127}));
101-
connect(boi.T, swiSet.u3) annotation (Line(points={{11,-52},{20,-52},{20,20},
102-
{-90,20},{-90,32},{-82,32}}, color={0,0,127}));
103-
connect(bus.THeaWatSupSet, swiSet.u1) annotation (Line(
104-
points={{0,100},{0,80},{-90,80},{-90,48},{-82,48}},
105-
color={255,204,51},
106-
thickness=0.5));
107-
connect(bus.y1, swiSet.u2) annotation (Line(
108-
points={{0,100},{0,80},{-90,80},{-90,40},{-82,40}},
109-
color={255,204,51},
110-
thickness=0.5));
111-
connect(swiSet.u2, ctl.trigger) annotation (Line(points={{-82,40},{-86,40},{
112-
-86,24},{-46,24},{-46,28}}, color={255,0,255}));
113-
connect(ctl.y, swiSig.u1) annotation (Line(points={{-28,40},{-20,40},{-20,48},
114-
{-2,48}}, color={0,0,127}));
115-
connect(valDis.y, swiSig.u3) annotation (Line(points={{-28,0},{-4,0},{-4,32},
116-
{-2,32}}, color={0,0,127}));
117-
connect(swiSet.u2, swiSig.u2) annotation (Line(points={{-82,40},{-86.1538,40},
118-
{-86.1538,24},{-10,24},{-10,40},{-2,40}}, color={255,0,255}));
119-
connect(swiSig.y, bus.y_actual) annotation (Line(points={{22,40},{40,40},{40,
120-
96},{0,96},{0,100}},
121-
color={0,0,127}));
122-
connect(swiSig.y, boi.y) annotation (Line(points={{22,40},{40,40},{40,-40},{
123-
-20,-40},{-20,-52},{-12,-52}}, color={0,0,127}));
12482
connect(boi.T, bus.THeaWatSup) annotation (Line(points={{11,-52},{60,-52},{60,
12583
98},{0,98},{0,100}}, color={0,0,127}));
12684

12785

86+
connect(ctlPID.y, boi.y) annotation (Line(points={{-28,0},{-20,0},{-20,-52},{
87+
-12,-52}}, color={0,0,127}));
88+
connect(boi.T, ctlPID.u_m) annotation (Line(points={{11,-52},{20,-52},{20,-40},
89+
{-40,-40},{-40,-12}}, color={0,0,127}));
90+
connect(bus.y1, ctlPID.uEna) annotation (Line(
91+
points={{0,100},{0,20},{-60,20},{-60,-20},{-44,-20},{-44,-12}},
92+
color={255,204,51},
93+
thickness=0.5));
94+
connect(bus.THeaWatSupSet, ctlPID.u_s) annotation (Line(
95+
points={{0,100},{0,20},{-60,20},{-60,0},{-52,0}},
96+
color={255,204,51},
97+
thickness=0.5));
98+
connect(ctlPID.y, bus.y_actual) annotation (Line(points={{-28,0},{20,0},{20,
99+
96},{0,96},{0,100}}, color={0,0,127}));
128100
annotation (Documentation(info="<html>
129101
<p>
130102
This partial class provides a standard interface for hot water boiler models.

Buildings/Templates/Plants/Boilers/HotWater/BoilerPlant.mo

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,16 @@ model BoilerPlant "Boiler plant"
541541
Dialog(group="Controls"),
542542
Placement(transformation(extent={{-10,130},{10,150}})));
543543

544+
protected
545+
Buildings.Templates.Components.Interfaces.Bus busLooCon if have_boiCon
546+
"Condensing boiler loop control bus" annotation (Placement(transformation(
547+
extent={{-300,140},{-260,180}}), iconTransformation(extent={{-466,50},
548+
{-426,90}})));
549+
protected
550+
Buildings.Templates.Components.Interfaces.Bus busLooNon if have_boiNon
551+
"Non-condensing boiler loop control bus" annotation (Placement(
552+
transformation(extent={{-300,100},{-260,140}}), iconTransformation(
553+
extent={{-466,50},{-426,90}})));
544554
equation
545555
/* Control point connection - start */
546556

@@ -552,18 +562,18 @@ equation
552562
connect(bus.valHeaWatMinByp, valHeaWatMinBypNon.bus);
553563
connect(bus.pumHeaWatSec, pumHeaWatSec.bus);
554564
connect(dpHeaWatLoc.y, bus.dpHeaWatLoc);
555-
connect(VHeaWatPriSupCon_flow.y, bus.VHeaWatPriCon_flow);
556-
connect(VHeaWatPriRetCon_flow.y, bus.VHeaWatPriCon_flow);
557-
connect(VHeaWatPriSupNon_flow.y, bus.VHeaWatPriNon_flow);
558-
connect(VHeaWatPriRetNon_flow.y, bus.VHeaWatPriNon_flow);
565+
connect(VHeaWatPriSupCon_flow.y, busLooCon.VHeaWatPri_flow);
566+
connect(VHeaWatPriRetCon_flow.y, busLooCon.VHeaWatPri_flow);
567+
connect(VHeaWatPriSupNon_flow.y, busLooNon.VHeaWatPri_flow);
568+
connect(VHeaWatPriRetNon_flow.y, busLooNon.VHeaWatPri_flow);
559569
connect(VHeaWatSecSup_flow.y, bus.VHeaWatSec_flow);
560570
connect(VHeaWatSecRet_flow.y, bus.VHeaWatSec_flow);
561-
connect(VHeaWatBypCon_flow.y, bus.VHeaWatBypCon_flow);
562-
connect(VHeaWatBypNon_flow.y, bus.VHeaWatBypNon_flow);
563-
connect(THeaWatPriSupCon.y, bus.THeaWatPriSupCon);
564-
connect(THeaWatPlaRetCon.y, bus.THeaWatPlaRetCon);
565-
connect(THeaWatPriSupNon.y, bus.THeaWatPriSupNon);
566-
connect(THeaWatPlaRetNon.y, bus.THeaWatPlaRetNon);
571+
connect(VHeaWatBypCon_flow.y, busLooCon.VHeaWatByp_flow);
572+
connect(VHeaWatBypNon_flow.y, busLooNon.VHeaWatByp_flow);
573+
connect(THeaWatPriSupCon.y, busLooCon.THeaWatPriSup);
574+
connect(THeaWatPlaRetCon.y, busLooCon.THeaWatPlaRet);
575+
connect(THeaWatPriSupNon.y, busLooNon.THeaWatPriSup);
576+
connect(THeaWatPlaRetNon.y, busLooNon.THeaWatPlaRet);
567577
connect(THeaWatSecSup.y, bus.THeaWatSecSup);
568578
connect(THeaWatSecRet.y, bus.THeaWatSecRet);
569579
connect(THeaWatIntSup.y, bus.THeaWatIntSup);
@@ -801,6 +811,14 @@ equation
801811
color={0,0,0},
802812
thickness=0.5,
803813
visible=have_boiNon));
814+
connect(busLooCon, bus.looCon) annotation (Line(
815+
points={{-280,160},{-260,160},{-260,140},{-300,140}},
816+
color={255,204,51},
817+
thickness=0.5));
818+
connect(busLooNon, bus.looNon) annotation (Line(
819+
points={{-280,120},{-260,120},{-260,140},{-300,140}},
820+
color={255,204,51},
821+
thickness=0.5));
804822
annotation (
805823
Documentation(info="<html>
806824
<p>

0 commit comments

Comments
 (0)