- K_dCoefficient for the derivative term
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Coefficient for the derivative term
- K_iCoefficient for the integral term
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Coefficient for the integral term
- K_pCoefficient for the proportional term
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Coefficient for the proportional term
- inputInput control data
C++ Type:std::string
Unit:(no unit assumed)
Controllable:No
Description:Input control data
- set_pointSet point control data
C++ Type:std::string
Unit:(no unit assumed)
Controllable:No
Description:Set point control data
PIDChainControl
This ChainControl implements the classic PID controller, which takes as its input a value and the set point for that value, . It produces an output signal , which should be used as the input for some controllable device that impacts the measured quantity . For example, in a thermal system, may be the temperature of a fluid at some location, and may be the power sent to the heaters in the system, with the goal to heat the fluid such that the temperature at some location is .
"PID" stands for its three components:
P: Proportional
I: Integral
D: Derivative
The output signal at time is computed as follows:
where is the time step size and is the error:
The implementation assumes that the control will only be executed once per time step, so you should set "execute_on" accordingly, such as execute_on = 'INITIAL TIMESTEP_END'
, which is the default.
The inputs and outputs are retrieved and named as follows, respectively:
is set with "input".
is set with "set_point".
is declared with the name
<control_name>:value
, where<control_name>
is the user-given name of thePIDChainControl
.
If you are unsure on how to select the PID coefficients , , and , you may try the following strategy, which involves some trial and error. First, set and to zero. Then, set to some arbitrary (positive) value. Run a simulation with and examine the transient response of to the set point value . The goal should be to maximize without causing an unstable response, where oscillates indefinitely around . Some initial overshoot and subsequent diminishing oscillations are acceptable. After this acceptable value of is found, you'll likely find that appears to be nearly constant in time, but at the wrong value. At this point, you should start increasing from zero until you get an acceptable response time to get the initial response (largely driven by ) to bridge the gap to , without introducing oscillatory behavior. Lastly, can be used to fine-tune the response, but it is not necessary, and it risks some oscillatory behavior if the inputs have any noise, so it should only be used for relatively smooth inputs.
To control a controllable value directly instead of using a ChainControlData, use PIDTransientControl.
Input Parameters
- depends_onThe Controls that this control relies upon (i.e. must execute before this one)
C++ Type:std::vector<std::string>
Unit:(no unit assumed)
Controllable:No
Description:The Controls that this control relies upon (i.e. must execute before this one)
- execute_onINITIAL TIMESTEP_ENDThe list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
Default:INITIAL TIMESTEP_END
C++ Type:ExecFlagEnum
Unit:(no unit assumed)
Controllable:No
Description:The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
- initial_integral0Initial value for the integral component
Default:0
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Initial value for the integral component
Optional Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Unit:(no unit assumed)
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Unit:(no unit assumed)
Controllable:No
Description:Set the enabled status of the MooseObject.
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Unit:(no unit assumed)
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form