Package with base classes
Information
This package contains base classes to construct blocks in
Buildings.Controls.OBC.Utilities.PIDWithAutotuning.AutoTuner.AMIGO.
Package Content
Name |
Description |
PIDDerivativeTime
|
Identify the derivative time of a PID controller |
PIDGain
|
Identify the control gain of a PID controller |
PIDIntegralTime
|
Identify the integral time of a PID controller |
PIGain
|
Identify the control gain of a PI controller |
PIIntegralTime
|
Identify the integral time of a PI controller |
Validation
|
Collection of validation models |
Identify the derivative time of a PID controller
Information
This block calculates the derivative time of a PID controller as
Td = 0.5 L T/(0.3 L + T),
where T
is the time constant of the first-order plus time-delay (FOPTD) model
and L
is the time delay of the FOPTD model.
References
Åström, Karl Johan and Tore Hägglund (2004)
"Revisiting the Ziegler–Nichols step response method for PID control."
Journal of Process Control 14.6 (2004): 635-650.
Connectors
Type | Name | Description |
input RealInput | T | Time constant of a first-order plus time-delay (FOPTD) model [s] |
input RealInput | L | Time delay of the FOPTD model [s] |
output RealOutput | Td | Time constant signal for the derivative term [s] |
Modelica definition
block PIDDerivativeTime
Buildings.Controls.OBC.CDL.Interfaces.RealInput T(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput L(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput Td(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
;
protected
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(
final k=0.3)
;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai2(
final k=0.5)
;
Buildings.Controls.OBC.CDL.Reals.Multiply mul
;
Buildings.Controls.OBC.CDL.Reals.Add add
;
Buildings.Controls.OBC.CDL.Reals.Divide div
;
equation
connect(div.y, Td);
connect(gai1.u, L);
connect(gai1.y, add.u2);
connect(add.u1, T);
connect(gai2.u, T);
connect(mul.u2, L);
connect(gai2.y, mul.u1);
connect(mul.y, div.u1);
connect(div.u2, add.y);
end PIDDerivativeTime;
Identify the control gain of a PID controller
Information
This block calculates the control gain of a PID model as
k = 1/kp + (0.2 + 0.45 T/L),
where kp
is the gain of the first-order plus time-delay (FOPTD) model,
T
is the time constant of the FOPTD model,
and L
is the time delay of the FOPTD model.
References
Åström, Karl Johan and Tore Hägglund (2004)
"Revisiting the Ziegler–Nichols step response method for PID control."
Journal of Process Control 14.6 (2004): 635-650.
Connectors
Type | Name | Description |
input RealInput | kp | Gain of a first-order plus time-delay (FOPTD) model |
input RealInput | T | Time constant of the FOPTD model [s] |
input RealInput | L | Time delay of the FOPTD model [s] |
output RealOutput | k | Control gain |
Modelica definition
block PIDGain
Buildings.Controls.OBC.CDL.Interfaces.RealInput kp(
final min=1E-6)
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput T(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput L(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput k
;
protected
Buildings.Controls.OBC.CDL.Reals.Divide div1
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant const(
final k=1)
;
Buildings.Controls.OBC.CDL.Reals.AddParameter add(
final p=0.2)
;
Buildings.Controls.OBC.CDL.Reals.Divide div2
;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(
final k=0.45)
;
Buildings.Controls.OBC.CDL.Reals.Multiply mul
;
equation
connect(div1.u2, kp);
connect(const.y, div1.u1);
connect(div2.u2, L);
connect(div2.u1, T);
connect(gai1.u, div2.y);
connect(gai1.y, add.u);
connect(mul.y, k);
connect(div1.y, mul.u1);
connect(mul.u2, add.y);
end PIDGain;
Identify the integral time of a PID controller
Information
This block calculates the integral time of a PID model as
Ti = L (0.4 L + 0.8 T)/(L + 0.1 T),
where T
is the time constant of the first-order plus time-delay (FOPTD) model
and L
is the time delay of the FOPTD model.
References
Åström, Karl Johan and Tore Hägglund (2004)
"Revisiting the Ziegler–Nichols step response method for PID control."
Journal of Process Control 14.6 (2004): 635-650.
Connectors
Type | Name | Description |
input RealInput | T | Time constant of a first-order plus time-delay (FOPTD) model [s] |
input RealInput | L | Time delay of the FOPTD model [s] |
output RealOutput | Ti | Time constant signal for the integral term [s] |
Modelica definition
block PIDIntegralTime
Buildings.Controls.OBC.CDL.Interfaces.RealInput T(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput L(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput Ti(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
;
protected
Buildings.Controls.OBC.CDL.Reals.Add add1
;
Buildings.Controls.OBC.CDL.Reals.Add add2
;
Buildings.Controls.OBC.CDL.Reals.Divide div
;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(
final k=0.4)
;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai2(
final k=0.8)
;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai3(
final k=0.1)
;
Buildings.Controls.OBC.CDL.Reals.Multiply mul
;
equation
connect(gai1.u, L);
connect(gai3.u, T);
connect(gai2.u, T);
connect(gai1.y, add2.u2);
connect(add2.u1, gai2.y);
connect(add1.u2, L);
connect(add1.u1, gai3.y);
connect(div.y, mul.u1);
connect(mul.u2, L);
connect(mul.y, Ti);
connect(div.u2, add1.y);
connect(div.u1, add2.y);
end PIDIntegralTime;
Identify the control gain of a PI controller
Information
This block calculates the control gain of a PI model as
k = 0.15/kp + (0.35-LT/(L+T)2)(T/kp/L),
where kp
is the gain of the first-order plus time-delay (FOPTD) model,
T
is the time constant of the FOPTD model, and
L
is the time delay of the FOPTD model.
References
Garpinger, Olof, Tore Hägglund, and Karl Johan Åström (2014)
"Performance and robustness trade-offs in PID control."
Journal of Process Control 24.5 (2014): 568-577.
Connectors
Type | Name | Description |
input RealInput | kp | Gain of a first-order plus time-delay (FOPTD) model |
input RealInput | T | Time constant of the FOPTD model [s] |
input RealInput | L | Time delay of the FOPTD model [s] |
output RealOutput | k | Control gain |
Modelica definition
block PIGain
Buildings.Controls.OBC.CDL.Interfaces.RealInput kp(
final min=1E-6)
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput T(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput L(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput k
;
protected
Buildings.Controls.OBC.CDL.Reals.Add add1
;
Buildings.Controls.OBC.CDL.Reals.Add add2
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant const1(
final k=0.35)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant const2(
final k=0.15)
;
Buildings.Controls.OBC.CDL.Reals.Divide div1
;
Buildings.Controls.OBC.CDL.Reals.Divide div2
;
Buildings.Controls.OBC.CDL.Reals.Divide div3
;
Buildings.Controls.OBC.CDL.Reals.Multiply mul1
;
Buildings.Controls.OBC.CDL.Reals.Multiply mul2
;
Buildings.Controls.OBC.CDL.Reals.Multiply mul3
;
Buildings.Controls.OBC.CDL.Reals.Multiply mul4
;
Buildings.Controls.OBC.CDL.Reals.Subtract sub
;
equation
connect(div1.u2, kp);
connect(add2.u1, div1.y);
connect(add1.u1, T);
connect(add1.u2, L);
connect(mul4.u1, T);
connect(mul4.u2, L);
connect(mul1.u1, add1.y);
connect(mul1.u2, add1.y);
connect(div2.u2, mul1.y);
connect(div2.u1, mul4.y);
connect(mul2.u1, kp);
connect(mul2.u2, L);
connect(div3.u2, mul2.y);
connect(div3.u1, T);
connect(mul3.u1, div3.y);
connect(const2.y, div1.u1);
connect(add2.u2, mul3.y);
connect(add2.y, k);
connect(div2.y, sub.u2);
connect(const1.y, sub.u1);
connect(sub.y, mul3.u2);
end PIGain;
Identify the integral time of a PI controller
Information
This block calculates the integral time of a PI model as
Ti = 0.35 L + 13 L T2/(T2 + 12 L T + 7 L2),
where T
is the time constant of the first-order plus time-delay (FOPTD) model
and L
is the time delay of the FOPTD model.
References
Garpinger, Olof, Tore Hägglund, and Karl Johan Åström (2014)
"Performance and robustness trade-offs in PID control."
Journal of Process Control 24.5 (2014): 568-577.
Connectors
Type | Name | Description |
input RealInput | T | Time constant of a first-order plus time-delay (FOPTD) model [s] |
input RealInput | L | Time delay of the FOPTD model [s] |
output RealOutput | Ti | Time constant for the integral term [s] |
Modelica definition
block PIIntegralTime
Buildings.Controls.OBC.CDL.Interfaces.RealInput T(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput L(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput Ti(
final quantity="Time",
final unit="s",
min=100*Buildings.Controls.OBC.CDL.Constants.eps)
;
protected
Buildings.Controls.OBC.CDL.Reals.Add add1
;
Buildings.Controls.OBC.CDL.Reals.Add add2
;
Buildings.Controls.OBC.CDL.Reals.Add add3
;
Buildings.Controls.OBC.CDL.Reals.Divide div
;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(
final k=12)
;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai2(
final k=7)
;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai3(
final k=13)
;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai4(
final k=0.35)
;
Buildings.Controls.OBC.CDL.Reals.Multiply mul1
;
Buildings.Controls.OBC.CDL.Reals.Multiply mul2
;
Buildings.Controls.OBC.CDL.Reals.Multiply mul3
;
Buildings.Controls.OBC.CDL.Reals.Multiply mul4
;
equation
connect(add2.y, Ti);
connect(gai4.u, L);
connect(mul3.u1, T);
connect(mul3.u2, T);
connect(gai1.u, L);
connect(gai1.y, mul1.u2);
connect(mul1.u1, T);
connect(gai2.u, L);
connect(gai2.y, mul2.u2);
connect(mul2.u1, L);
connect(gai3.u, mul3.y);
connect(add1.u1, mul3.y);
connect(mul1.y, add1.u2);
connect(mul2.y, add3.u2);
connect(add3.u1, add1.y);
connect(add3.y, div.u2);
connect(div.y, add2.u1);
connect(add2.u2, gai4.y);
connect(mul4.u2, L);
connect(gai3.y, mul4.u1);
connect(mul4.y, div.u1);
end PIIntegralTime;