From 42c9e86eb4b9e1c80c9cf0785272fc53b20a452c Mon Sep 17 00:00:00 2001 From: JayHuLBL Date: Tue, 19 Nov 2024 22:33:45 -0800 Subject: [PATCH] avoided using getInstance() function --- .../PIDWithAutotuning/FirstOrderAMIGO.mo | 17 +++++------------ .../Relay/BaseClasses/NormalizedTimeDelay.mo | 5 +---- .../FirstOrderTimeDelay/ControlProcessModel.mo | 10 +++------- 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/FirstOrderAMIGO.mo b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/FirstOrderAMIGO.mo index ace401085c2..c8f290c8551 100644 --- a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/FirstOrderAMIGO.mo +++ b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/FirstOrderAMIGO.mo @@ -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")); @@ -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" @@ -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) @@ -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 @@ -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" diff --git a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/NormalizedTimeDelay.mo b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/NormalizedTimeDelay.mo index 0e651f49893..d2efafc1602 100644 --- a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/NormalizedTimeDelay.mo +++ b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/NormalizedTimeDelay.mo @@ -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( diff --git a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimeDelay/ControlProcessModel.mo b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimeDelay/ControlProcessModel.mo index 01598742e68..d0387834813 100644 --- a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimeDelay/ControlProcessModel.mo +++ b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/SystemIdentification/FirstOrderTimeDelay/ControlProcessModel.mo @@ -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" @@ -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) @@ -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}},