Tuesday, February 21, 2012

Basic Simulation of PID and PIDE

Question

What does a working PID or PIDE look like?

Answer

Please see Basic Setup Help for Logix PID It references several technotes and manuals which are needed to understand PID/PIDE.
Attached is a basic simple simulation with a working PID and PIDE control. Download the attachment, open it and compare the behavior of a PID and PIDE.
In 'out of the box' condition both PID and PIDE are running the same simulation. Each has its own and different solution; even though they are running with the same frequency (and therefore in the same time domain).
It can also be used to explore the use of SCALING and changes to the TIME DOMAIN in a controlled environment.
Note the use of a function block as the main program.
The main variables are bough Controller tags. Those controlling the PID, start PID_; those controlling the PIDE, start PIDE_.
Thus,

 Variable
 PID
 PIDE
 Set Point
 PID_SP
 PIDE_SP
 Process Variable
 PID_PV
 PIDE_PV
 Control Variable
 PID_CV
 PIDE_CV
Control
Variable
 PID
 PIDE
 Enable PID Rung
 PID_ON
 -
 Enable PIDE FB
 -
 PIDE_ON
 Set PID MANUAL
 PID_MANUAL
 -
 Set PIDE AUTOMATIC
 -
 PIDE_AUTO_RQ

A trend has been set up for each control loop.

Suggested Experiments

  • Change scheduled task schedule - note the tuning parameters (change in the time domain).
    • What would happen if the PID/PIDE were configured in the main program; such that the PID/PIDE executed with a non-constant repetition period (as the main program varies its execution time)
  • Change tuning parameters.
    • set I and D terms to zero - vary P only
    • Introduce some D
    • Introduce some I
  • Change scale - try setting the input PV to 0-100 range - don't forget to think about the SP range as well. In the PID routine you can use the controller variable PID_Scale_Max; which will change the other PID_Scale parameters and push the new values into the PID controller.
  • What happens if  the Sim program is in scheduled task that executes
    • slower than the PID/PIDE
    • at the same rate (Nyquist theory)
  • What does the Deadband do?
  • On PIDE - experiment with the Autotune facility.
This should go some way to helping understand the following recommendations:
  • PID and PIDE use different equations; they will give different results. However both are applicable for most control loops; use the one that you are most "at home" with. However: the PIDE control should give better results (and be easier to tune) for those harder to stabilize loops.
  • PID/PIDE should always be placed in a scheduled task.
  • PV should be scanned at least 10 times faster then the PID/PIDE executes.
  • The PID/PIDE should execute at least 10 times per process period (though it does not mater if the loop executes very much faster; 1 second is a good maximum for loops with a process period >> 5 minutes).
  • PV should be left at Input card resolution; tags scaled for HMI use should be derived from the PID/PIDE tags.
  • The P, I and D terms are arbitrary.
  • There is no 'best' values for P, I or D - what works best is the best!
  • Some PID loops do not need to be well tuned. As long as control is reasonable for the impact that the loop has on the overall process.
  • Some loops are critical - either they impact financially or in terms of quality or in terms of plant wear and tear. These loops should be identified and time spent getting a good stable response.
File Attachments

No comments:

Post a Comment