Use the Proportional Integral Derivative instruction

This section provides specific details and examples for using the proportional integral derivative instruction.

Example: How to create a feedback loop for the manipulated value

Adding a feedback loop for the manipulated value prevents excessive overshooting by providing a minimum and maximum value for the MV.

Temperature feedback loop example

At the beginning of the temperature control process, the difference between the process value (PV) and the setpoint value (SP) is large, as shown in the following graph. In this example of a temperature feedback loop, the PV starts at 0 degrees Celsius and moves towards the SP value of 40 degrees Celsius. Notice also that the fluctuation between the high and low manipulated value (MV) decreases and stabilizes with time. The behavior of the MV depends on the values used in each of the P, I, and D parameters.
Temperature feedback loop example
Temperature feedback loop example
Temperature feedback loop example

IPIDController with a feedback loop

The following function block diagram includes a feedback loop for the manipulated value that prevents excessive overshooting by providing a minimum and maximum value for the MV.
IPIDController with a feedback loop

Example: How to implement auto-tuning in a IPIDController function block

Use AutoTune parameter of the IPIDController function block to implement auto-tuning in the control program.
Auto-tuning requirements and recommendations
The following is a summary of requirements and recommendations for implementing successful auto-tuning:
  • Autotuning must cause the output of the control loop to oscillate, which means the IPIDController must be called frequently enough to adequately sample the oscillation.
  • The IPIDController instruction block must be executed at a relatively constant time interval.
  • Configure the scan time of the program to be than half of the oscillation period.
  • Consider using a Structured Text Interrupt (STI) instruction block to control the IPIDController instruction block.

Example: How to add a UDFB to a PID program

Add UDFBs outside the main program to perform specialized functions, such as converting units or transferring values.
Transfer the auto-tune gain value
Transfer the auto-tune gain value
Transfer the auto-tune gain value
This UDFB transfers the Autotune gain value to My_GainTransfer. So it can be used by the controller.
Convert a manipulated value to a digital output
Convert a manipulated value to a digital output
Convert a manipulated value to a digital output
This UDFB converts a manipulated value (MV) to a digital output (DO). So it can be used to control a digital input n(DI).
Convert a manipulated value to an analog output
Convert a manipulated value to an analog output
Convert a manipulated value to an analog output
This UDFB converts a manipulated value (MV) to an analog output (AO). So it can be used to control an analog input (AI).
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal