Specifying the Inputs for (Tuning) a PID Controller

The PID Controller has four parameters that need to be “tuned” to achieve good performance: the Bias, the Proportional Gain, the Integral Gain and the Derivative Gain.

This is done by selecting their values so that they provide good control (i.e., that allow the target to be closely tracked). To do so, what should the values be and how should you go about adjusting them? This will require experimentation as they will differ for each system. In most cases, you will find that the two most important parameters are the Proportional Gain and the Integral Gain, so the following approach is often helpful:

  1. Start with zero values for the three Gain paramaters.
  2. Define the Bias. This parameter will generally only have an impact at early times. To have good performance at those early times, it should be on the same order as the initial uncontrolled inflows and outflows. Therefore, if this is an Outflow Controller, define this such that it approximates the initial sum of the expected uncontrolled inflows minus other expected uncontrolled outflows. If this is an Inflow Controller define this such that it approximates the initial sum of the expected uncontrolled outflows minus other expected uncontrolled inflows.
  3. Define an initial guess for the Proportional Gain.
  4. Define an initial guess for the Integral Gain.
  5. Run the model (a single realization A single model run within a Monte Carlo simulation. It represents one possible path the system could follow through time.).
  6. Adjust the Integral Gain (up or down) and rerun the model until the process variable is able to (on average) track the target.
  7. Adjust the Proportional Gain (up or down) and rerun the model to improve performance. Note that if the Proportional Gain is too high it will produce oscillations, while if the Proportional Gain is too low it will have minimal impact.
  8. Iterate on Steps 6 and 7 (slightly adjusting the Integral and Proportional Gains to find the best performance).
  9. Define the Derivative Gain. Note that a higher Derivative Gain may offset increases in the Proportional and Integral Gain. However, if it is too high it can result in oscillations. Note that for some systems the Derivative Gain may not have a significant improvement (in which case you can set it to zero).
  10. If the model is probabilistic, run multiple realizations and verify that the Controller still performs well.
Note: After step 9, an optional approach would be to use GoldSim’s optimization capabilities (using the manually determined values as Initial Values) to see if you could further improve performance. The Objective Function would be perhaps the root mean square error between the target and the process variable over the simulation. Note, however, that this would typically rarely be necessary.