7.16.1.20.45. Pid_Controlled

Syntax

Source For Energy [{of} SpeciesName | {in} MaterialPhaseName | {ls} {a | b | c}] {on} 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

u(t) = K_p e(t) + K_i \int_0^{\t}{e(s) ds} + K_d \frac{\partial e_f}{\partial t}

where it is important to note that the K_p coefficient does not scale the others unless you have set it using the Band argument. In some PID implementations, the K_i and K_d coefficients are internally multiplied by K_p so care must be taken to provide the correct coefficients. This output u(t) 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_Tau argument can be used to specify the first-order derivative filter time constant \tau, with a default value of 1 otherwise. Alternatively, one can provide the Filter_Number as argument \tau = \frac{1}{N} where

K_d \frac{N}{1 + N \frac{1}{s}} = K_d \frac{1}{\tau + \frac{1}{s}} = \frac{K_d s}{\tau s + 1}

The P, I, and D coefficients can be specified in a number of ways:

  • Just give a ‘Band’ argument. This calculates P = 1/Band and uses the defaults of I = 0.01 P and D = 0.0

  • 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_i (T_i argument) and derivative time T_d (T_d argument) so that I = P/T_i and D = P*T_d (regardless if P was set via band arg or not).

If ENABLE_CLAMPING is 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}

{of | species | subindex}

SpeciesName

string

{in}

{in | material_phase}

MaterialPhaseName

string

{ls}

{levelset_phase | ls}

{on}

{@ | at | for | in | on | over}

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