Skip to content

Commit

Permalink
avoided using getInstance() function
Browse files Browse the repository at this point in the history
  • Loading branch information
JayHuLBL committed Nov 20, 2024
1 parent c79029c commit 42c9e86
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ block FirstOrderAMIGO
final min=1E-6)
"Deadband for holding the relay output";
parameter Real yRef
"Reference output for the tuning process. It must be greater than the
lower limit of the relay output and less than the upper limit of the
relay output";
"Reference output for the tuning process. It must be greater than the lower limit of the relay output and less than the upper limit of the relay output";
parameter Real yMax = 1
"Upper limit of output"
annotation (Dialog(group="Limits"));
Expand Down Expand Up @@ -72,7 +70,7 @@ block FirstOrderAMIGO
iconTransformation(extent={{-140,-20},{-100,20}})));
Buildings.Controls.OBC.CDL.Interfaces.RealInput u_m
"Connector of measurement input signal"
annotation (Placement(transformation(origin={0,-300}, extent={{20,-20},{-20,20}},rotation=270),
annotation (Placement(transformation(origin={0,-300}, extent={{20,-20},{-20,20}},rotation=270),
iconTransformation(extent={{20,-20},{-20,20}},rotation=270,origin={0,-120})));
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput triRes
"Connector for resetting the controller output"
Expand Down Expand Up @@ -163,9 +161,7 @@ protected
else Buildings.Controls.OBC.CDL.Types.SimpleController.PID
"Type of controller";
Buildings.Controls.OBC.CDL.Utilities.Assert assMes2(
final message="In " +
getInstanceName() +
": the relay output needs to be asymmetric. Check the value of yHig, yLow and yRef.")
final message="Warning: the relay output needs to be asymmetric. Check the value of yHig, yLow and yRef.")
"Warning message when the relay output is symmetric"
annotation (Placement(transformation(extent={{160,210},{180,230}})));
Buildings.Controls.OBC.CDL.Reals.Sources.Constant con1(final k=yHig)
Expand Down Expand Up @@ -203,8 +199,7 @@ protected
"Check if an autotuning is ongoing while a new autotuning request is received"
annotation (Placement(transformation(extent={{200,-150},{220,-130}})));
Buildings.Controls.OBC.CDL.Utilities.Assert assMes1(
final message="In " + getInstanceName() +
": a new tuning request is ignored as the autotuning is ongoing.")
final message="Warning: a new tuning request is ignored as the autotuning is ongoing.")
"Warning message when an autotuning tuning is ongoing while a new autotuning request is received"
annotation (Placement(transformation(extent={{242,-150},{262,-130}})));
Buildings.Controls.OBC.CDL.Logical.Edge edgReq
Expand Down Expand Up @@ -237,9 +232,7 @@ protected
"Check if the setpoint changes"
annotation (Placement(transformation(extent={{0,100},{20,120}})));
Buildings.Controls.OBC.CDL.Utilities.Assert assMes3(
final message=
"In " + getInstanceName()
+ ": the setpoint must not change when an autotuning tuning is ongoing.
final message="Warning: the setpoint must not change when an autotuning tuning is ongoing.
This ongoing autotuning will be aborted and the control gains will not
be changed.")
"Warning message when the setpoint changes during tuning process"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ protected
"Block that calculates the product of the two inputs"
annotation (Placement(transformation(extent={{20,-48},{40,-28}})));
Buildings.Controls.OBC.CDL.Utilities.Assert assMes(
final message="In " +
getInstanceName() +
": the asymmetry level of the relay controller is lower than the half period ratio.
Increase the asymmetry level.")
final message="Warning: the asymmetry level of the relay controller is lower than the half period ratio. Increase the asymmetry level.")
"Warning message when asymmetry level is less than the half period ratio"
annotation (Placement(transformation(extent={{60,50},{80,70}})));
Buildings.Controls.OBC.CDL.Reals.Greater gre(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ protected
"Check if the autotuning completes successfully"
annotation (Placement(transformation(extent={{80,-80},{100,-60}})));
Buildings.Controls.OBC.CDL.Utilities.Assert assMes4(
final message="In " +
getInstanceName() +
": an autotuning fails, the controller gains are unchanged.")
final message="Warning: an autotuning fails, the controller gains are unchanged.")
"Warning message when an autotuning fails"
annotation (Placement(transformation(extent={{134,50},{154,70}})));
Buildings.Controls.OBC.CDL.Logical.Not not2 "Check if an error occurs"
Expand All @@ -139,8 +137,7 @@ equation
connect(timConDel.T, samT.u)
annotation (Line(points={{82,28},{100,28},{100,20},{118,20}}, color={0,0,127}));
connect(samT.y, T)
annotation (Line(points={{142,20},{148,20},{148,40},{180,40}},
color={0,0,127}));
annotation (Line(points={{142,20},{148,20},{148,40},{180,40}}, color={0,0,127}));
connect(samT.trigger, triEnd) annotation (Line(points={{130,8},{130,-120}},
color={255,0,255}));
connect(L, samL.y)
Expand All @@ -150,8 +147,7 @@ equation
connect(samL.trigger, triEnd) annotation (Line(points={{110,-52},{110,-70},{130,
-70},{130,-120}}, color={255,0,255}));
connect(samk.y, timConDel.k)
annotation (Line(points={{-38,20},{58,20}},
color={0,0,127}));
annotation (Line(points={{-38,20},{58,20}}, color={0,0,127}));
connect(samk.trigger, triEnd) annotation (Line(points={{-50,8},{-50,-90},{130,
-90},{130,-120}},color={255,0,255}));
connect(samk.y, k) annotation (Line(points={{-38,20},{52,20},{52,80},{180,80}},
Expand Down

0 comments on commit 42c9e86

Please sign in to comment.