Example: IPIDController with auto-tune

The following example program shows the variables used to configure the parameters for auto-tuning.
IPIDController with auto-tune
IPIDController with auto-tune

Auto-tune parameters

The following table describes the variables that are used with each parameter in the example to configure auto-tuning.
Auto-tune parameters
Input Parameters
Variable
Parameter
Description
AutoMode
Auto
The operation mode of the PID controller:
  • TRUE: Controller runs in normal mode.
  • FALSE: Derivative term is ignored forcing the controller output to track the feedback within the controller limits and allowing the controller to switch back to auto without bumping the output.
Initialize
Initialize
Initializes AutoTune sequence.
A change in value from TRUE to FALSE or FALSE to TRUE causes the controller to eliminate any proportional gain during the cycle.
My_Gains
Gains
Establishes the Gains PID for IPIDController.
My_Gains.DirectActing
DirectActing
Defines the type of acting for the output.
  • TRUE: Direct acting in which the output moves in the same direction as the error. That is, the actual process value is greater than the SetPoint and the appropriate controller action is to increase the output. For example, chilling.
  • FALSE: Reverse acting in which the output moves in the opposite direction as the error. That is, the actual process value is greater than the SetPoint and the appropriate controller action is to decrease the output. For example: heating.
My_Gains.ProportionalGain
ProportionalGain
Proportional gain for PID (>= 0.0001).
My_Gains.TimeIntegral
TimeIntegral
Time integral value for PID (>= 0.0001).
The tendency for oscillation increases with a decrease in ti.
My_Gains.TimeDerivative
TimeDerivative
Time derivative value for PID (> 0.0).
Damping increases with an increase in derivative time, but decreases if the derivative time value is too large.
My_Gains.DerivativeGain
Derivative gain for PID (> 0.0).
AutoTune
When set to TRUE and Auto and Initialize are FALSE, the AutoTune sequence is started.
ATParameters
Load
  • Initial output value during auto-tuning.
  • Allows the process value to stabilize at the load.
Deviation
  • The standard deviation for a series of stabilized process values. For example, if the process value stabilized between 31.4 and 32.0, then the deviation value would be (32.0-31.4)/2 = 0.3.
  • Some process values, such as temperature, take a very long time to stabilize.
Step
The auto-tune process considers how the process value reacts to the changes in step value and derives the Gain parameters.
ATDynaSet
  • Allocated time for the auto-tune to complete. It must be longer than what is required for the auto-tune process.
  • A common value for many systems is 600 seconds but some systems might require more time.
ATReset
  • If TRUE, the output will be reset to "0" after auto-tune completes.
  • If FALSE, the output will remain at the load value after auto-tune completes.
Output parameters
AbsoluteError
Absolute error (Process – SetPoint) from the controller.
ATWarning
Warning for the Auto Tune sequence. Possible values are:
  • 0: No auto tune done.
  • 1: In auto tune mode.
  • 2: Auto tune done.
  • -1: ERROR 1 input automatically set to TRUE, no auto tune possible.
  • -2: ERROR 2 auto tune error, ATDynaSet expired
OutGains
Gains calculated after AutoTune sequences.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal