7.17.1.20.45. Pid_Controlled
- Syntax
Source For Energy ([ SpeciesName] | [ MaterialPhaseName] | [ ]) MeshPartIdentifier = Pid_Controlled ([Power_Output = power_output] | [Toggle = toggle] | [P = p] | [I = i] | [D = d] | [T_I = t_i] | [T_D = t_d] | [Band = Band] | [Filter_Tau = Filter_Tau] | [Filter_Number = Filter_Number] | Setpoint_Function_Name = Setpoint_Function_Name | Control_Variable = Control_Variable | [Enable_Clamping = enable_clamping] | Max_Output = Max_Output)
- Summary
PID controlled energy source term
- Description
The controller setpoint vs. time is defined in a user function, and the controller feedback point uses a global variable (e.g. a data probe or reduction postprocessor).
The derivative term uses a filtered error value, using a low pass filter whose time constant is specified by the user. Like a heater, this is only capable of providing a positive influx. Even if the controller output is negative, the applied energy source will be truncated at 0. Likewise, the applied energy source cannot exceed the specified max source.
The nominal scaled PID controller output (between 0 and 1) is
where it is important to note that the
coefficient does not scale the others unless you have set it using the Band argument. In some PID implementations, the
and
coefficients are internally multiplied by
so care must be taken to provide the correct coefficients. This output
which is from 0 to 1 is scaled by the specified Max_Output value to produce the applied energy source. This means you should not include the output magnitude scaling in your P, I, or D parameters. If this controller is meant to recreate a controller that commands power directly, one must normalize by the max power.
When a derivative gain is provided, the derivative action is calculated using a filtered error to avoid derivative kick. The
Filter_Tauargument can be used to specify the first-order derivative filter time constant, with a default value of 1 otherwise. Alternatively, one can provide the
Filter_Numberas argumentwhere
The P, I, and D coefficients can be specified in a number of ways:
Just give a ‘Band’ argument. This calculates
and uses the defaults of
and
Give a ‘Band’ argument and non-defaults for I and/or D. This still multiplies whatever you give for I and D by P.
Give a ‘P’ argument instead of ‘Band’. NOTE: in this mode the I and D values are not scaled by P.
If you provide both P and Band, P is used, the Band argument is ignored, and I and D are not scaled.
Alternatively, the integral and/or derivative gains can be provided using the integral time
(
T_iargument) and derivative time(
T_dargument) so thatand
(regardless if P was set via band arg or not).
If
ENABLE_CLAMPINGis set to true, a clamping anti-windup algorithm is applied to the integral action of the controller.The default values for I and D are 0.01 and 0 if not provided. The setpoint, controller output, error, filtered error, and filtered error time derivative are all output to automatically created global variables for diagnostics and postprocessing.
The following options are present in most boundary conditions/sources. The meaning of each option is as follows:
- Power_Output
If specified, the total (integrated) power of the given BC/Src is calculated and stored into the global variable name specified as the power_output argument.
- Toggle
If given, specifies which toggle block controls whether this BC is active or not.
Parameter |
Value |
Default |
|---|---|---|
{of | species | subindex} |
– |
|
SpeciesName |
string |
– |
{in | material_phase} |
– |
|
MaterialPhaseName |
string |
– |
{levelset_phase | ls} |
– |
|
MeshPartIdentifier |
string |
– |
power_output |
“string” |
– |
toggle |
“string” |
– |
p |
real |
0 |
i |
real |
0 |
d |
real |
0 |
t_i |
real |
0 |
t_d |
real |
0 |
Band |
real |
0 |
Filter_Tau |
real |
1 |
Filter_Number |
real |
1 |
Setpoint_Function_Name |
“string” |
– |
Control_Variable |
“string” |
– |
enable_clamping |
integer |
– |
Max_Output |
real |
– |