Skip to content

Commit

Permalink
Merge pull request modelica#4118 from modelica/WorkingMSL
Browse files Browse the repository at this point in the history
Removing min attribute of gain in `Block.Continuous.LimPID`
  • Loading branch information
TManikantan authored Jun 1, 2023
2 parents 43fa0dc + 109b517 commit 07b45a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Modelica/Blocks/Continuous.mo
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ to compute u by an algebraic equation.
"Control error (set point - measurement)";
parameter .Modelica.Blocks.Types.SimpleController controllerType=
.Modelica.Blocks.Types.SimpleController.PID "Type of controller";
parameter Real k(min=0) = 1 "Gain of controller";
parameter Real k = 1 "Gain of controller, must be non-zero";
parameter SI.Time Ti(min=Modelica.Constants.small)=0.5
"Time constant of Integrator block" annotation (Dialog(enable=
controllerType == .Modelica.Blocks.Types.SimpleController.PI or
Expand Down Expand Up @@ -881,6 +881,7 @@ to compute u by an algebraic equation.
gainPID.y = y_start;
end if;
equation
assert(abs(k) >= Modelica.Constants.small, "Controller gain must be non-zero.");
if initType == Init.InitialOutput and (y_start < yMin or y_start > yMax) then
Modelica.Utilities.Streams.error("LimPID: Start value y_start (=" + String(y_start) +
") is outside of the limits of yMin (=" + String(yMin) +") and yMax (=" + String(yMax) + ")");
Expand Down

0 comments on commit 07b45a6

Please sign in to comment.