Pid_Controlled

Syntax

Bc Flux For Energy [{of} SpeciesName | {in} MaterialPhaseName | {ls} {a | b | c}] {on} Mesh Extent Name [Touching TouchingMeshExtent | Opposing OpposingMeshExtent] = Pid_Controlled [Using Data Specification Data Spec Name] [Power_Output = power_output | Flux_Output = flux_output | Toggle = toggle | Max_Output = Max_Output | P = p | I = i | D = d | Band = Band | Filter_Tau = Filter_Tau | Setpoint_Function_Name = Setpoint_Function_Name | Control_Variable = Control_Variable]

Summary

This flux term imposes an energy flux using a PID controller

Description

The controller setpoint vs. time is defined in a user function, and the controller feedback point uses a global variable (a data probe or Encore function).

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 heat flux will be truncated at 0. Likewise, the applied heat flux cannot exceed the specified max flux.

The nominal scaled PID controller output (between 0 and 1) is

u(t) = K_p e(t) + K_i \int_0^{\t}{e(\tau) d\tau} + 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 flux. This means you should not include the output magnitude scaling in your P, I, or D parameters.

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.

  • 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.

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.

Flux_Output

If specified, the average flux of the given BC/Src is calculated and stored into the global variable name specified as the flux_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}

Mesh Extent Name

string

TouchingMeshExtent

string

OpposingMeshExtent

string

Data Spec Name

string

power_output

“string”

flux_output

“string”

toggle

“string”

Max_Output

real

p

real

0

i

real

0

d

real

0

Band

real

0

Filter_Tau

real

1

Setpoint_Function_Name

“string”

Control_Variable

“string”