【发布时间】:2020-07-22 17:59:09
【问题描述】:
我有PID控制器,我想加一个块,使PID输出信号在某个时间点保持稳定不变,100秒后,PID输出信号又开始正常工作。 MSL中有这样的块组件吗?
【问题讨论】:
我有PID控制器,我想加一个块,使PID输出信号在某个时间点保持稳定不变,100秒后,PID输出信号又开始正常工作。 MSL中有这样的块组件吗?
【问题讨论】:
不在 MSL 中。据我记得,只有积分器块有重置/跟踪选项。
如果您使用“Modelica Buildings Library”或“Industrial Control Systems”库中的 PID,它具有布尔值和模拟跟踪/重置输入。将模拟输入连接到控制器输出,当 Bolan 输入为“真”时,输出将“暂停”
【讨论】:
您可以对输出进行采样和保持。例如,这里我使用正弦波代替 PID,并使用时间表来指示何时保持以及何时使用该输出:
model Hold_test
Modelica.Blocks.Discrete.TriggeredSampler triggeredSampler annotation(
Placement(visible = true, transformation(origin = {2, 8}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.Sine PIDPlaceholder(f = 0.01, phase = 0.5235987755982988) annotation(
Placement(visible = true, transformation(origin = {-74, 6}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Logical.Switch switch1 annotation(
Placement(visible = true, transformation(origin = {8, 58}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.TimeTable timeTable(table = [0, 0; 50, 0; 51, 1; 150, 1; 151, 0; 200, 0]) annotation(
Placement(visible = true, transformation(origin = {-70, -82}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Logical.LessThreshold lessThreshold(threshold = 1) annotation(
Placement(visible = true, transformation(origin = {-24, -80}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Logical.Not not1 annotation(
Placement(visible = true, transformation(origin = {26, -78}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(timeTable.y, lessThreshold.u) annotation(
Line(points = {{-58, -82}, {-47, -82}, {-47, -80}, {-36, -80}}, color = {0, 0, 127}));
connect(lessThreshold.y, not1.u) annotation(
Line(points = {{-12, -80}, {12, -80}, {12, -78}, {14, -78}}, color = {255, 0, 255}));
connect(not1.y, triggeredSampler.trigger) annotation(
Line(points = {{38, -78}, {48, -78}, {48, -24}, {2, -24}, {2, -4}, {2, -4}, {2, -4}}, color = {255, 0, 255}));
connect(lessThreshold.y, switch1.u2) annotation(
Line(points = {{-12, -80}, {-6, -80}, {-6, -30}, {-34, -30}, {-34, 58}, {-4, 58}, {-4, 58}, {-4, 58}}, color = {255, 0, 255}));
connect(PIDPlaceholder.y, triggeredSampler.u) annotation(
Line(points = {{-62, 6}, {-10, 6}, {-10, 8}, {-10, 8}}, color = {0, 0, 127}));
connect(triggeredSampler.y, switch1.u3) annotation(
Line(points = {{14, 8}, {28, 8}, {28, 38}, {-18, 38}, {-18, 50}, {-4, 50}, {-4, 50}}, color = {0, 0, 127}));
connect(PIDPlaceholder.y, switch1.u1) annotation(
Line(points = {{-62, 6}, {-48, 6}, {-48, 66}, {-4, 66}, {-4, 66}}, color = {0, 0, 127}));
annotation(
uses(Modelica(version = "4.0.0")),
experiment(StartTime = 0, StopTime = 200, Tolerance = 1e-6, Interval = 0.4));
end Hold_test;
【讨论】: