PID Online Autotuning (Relay Feedback) VI
- Updated2025-07-30
- 6 minute(s) read
Controls the parameters of a PID controller based on the autotuning technique of the polymorphic instance you select. You can use this VI in applications with other PID VIs, such as PID or PID Advanced, to construct and tune a PID controller. You must manually select the polymorphic instance to use.

Inputs/Outputs
autotuning parameters
—
autotuning parameters specifies various parameters used for the autotuning process.
manipulated variable
—
manipulated variable specifies a quantity or condition to vary as a function of the actuating error signal so as to change the value of the directly controlled variable. The manipulated variable also can be referred to as the controller output.
setpoint
—
setpoint specifies the setpoint value, or desired value, of the process variable being controlled.
process variable
—
process variable specifies the measured value of the process variable being controlled. This value is equal to the feedback value of the feedback control loop.
PID gains in
—
PID gains in specifies the proportional gain, integral time, and derivative time parameters of the controller.
dt (s)
—
dt (s) specifies the interval, in seconds, at which this VI is called. If dt (s) is less than or equal to zero, this VI uses an internal timer with a one millisecond resolution. The default is –1. Use the same dt (s) value as you use for the PID or PID Advanced VI.
reinitialize? (F)
—
reinitialize? specifies whether to reinitialize the internal parameters, such as the integrated error, of the controller. Set reinitialize? to TRUE if your application must stop and restart the control loop without restarting the entire application. The default is FALSE.
autotune? (F)
—
autotune? specifies to begin autotuning. Wire this input from a Boolean control with latched mechanical action and a default value of FALSE. The default is FALSE.
setpoint out
—
setpoint out returns the updated setpoint value.
process variable out
—
process variable out returns the value of the process variable. If autotune? is TRUE, this output returns 0.
tuning completed?
—
tuning completed? returns TRUE when the autotuning process is complete. You can use this output to determine when to update the PID gains in.
PID gains out
—
PID gains out returns the updated PID gain parameters upon completion of the autotuning process. Normal output values are identical to the values in the PID gains in input.
tuned PID gains
—
tuned PID gains returns the tuned proportional gain, integral time, and derivative time parameters of the controller.
|
Examples
Refer to the following example files included with LabVIEW.
- labview\examples\control\PID\Autotuning PID Online and Inline.vi
autotuning parameters
—
type of controller
—
relay cycles
—
relay amplitude
—
reinitialize? (F)
—
setpoint out
—
tuning completed?
—
PID gains out
—