Home » Control Systems » How to Tune the PID Controller

How to Tune the PID Controller

Before we discuss how to tune the PID controller, let’s look at some basic facts about PID Controller.

Basic Facts about PID Controller

Many control systems use a combinational of three types of control i.e. Proportional + Integral + Derivative (PID) control. The foundation of the system is the Proportional Control, adding Integral Control provides a means to eliminate steady-state error but may increase overshoot. Derivative Control is good for getting slow systems moving faster, and reduces the tendency to overshoot. The response of the PID systems can be described by the following equation:

PID Controller

Where,

 OutputPID = Output of the PID Controller

KP = Proportional Control gain

KI = Integral Control gain often seen as 1/TI

KD = Derivative Control gain (often seen as TD)

E = Error (deviation from the setpoint)

∑(EΔt) = Sum of all past errors (Area under the error x time curve)

ΔE/Δt = Rate of change of error (slope of the error curve)

Tuning the PID Controller

The method of arriving at numerical values for the constants KP, KI and KD depends on the application. A practical step-by-step procedure can be used to arrive at the PID constants. First the constants KP, KI, and KD are set to initial values, and the controller is connected to the system. The system could consist of the actual hardware or a computer simulation of the same. Then the system is operated, and the response is noted. Based on the response, adjustments are made to KP, KI and KD and the system is operated again. This iterative process of adjusting each constant in an orderly manner until the desired system response is achieved is called tuning. To make the system stable under all conditions, certain modification may be necessary to the basic PID equation. The two most common methods of tuning PID Controllers are the ones that were developed by Ziegler and Nichols, which are:

  1. Continuous-cycle method
  2. Reaction-curve method

Continuous-cycle method

This method is used for closed loop systems. It is used when there is no harm done if the system goes into oscillation. This method will produce a system with a quick response, which implies a step-function will cause a shift overshoot that settles out very quickly.

The tuning procedure is as follows:

Don’t miss out on key updates, join our newsletter  List

  • Set KP = 1, KI = 0, and KD = 0 and connect the controller to the system.
  • Using manual control, adjust the system until it is operating in the middle of its range. Then increase the proportional gain K´P while forcing small disturbances to the set point (or the process) until the system oscillates with constant amplitude as illustrated below in figure 1(a). Record the values of K´P and TC for this condition.

    

System forced into oscillation
 Figure 1(a) system forced into oscillation
  • Based on the values of K´P  and TC from step 2, calculate the initial settings of KP, KI, and KD as follows:
Tuning PID Controller
  • Using the settings calculated above of KP, KI and KD, operate the system, and observe the response, and make the adjustments as called for.  Increasing KP will produce a stiffer and quicker response, increasing KI will reduce the time it takes to settle out the zero error, and increasing KD will decrease the overshoot. It is obvious that, KP, KI and KD do not act independently therefore changing one constant will have an effect across the board on system response. Tuning the system is an iterative process of making smaller and smaller adjustments until the desired response is achieved as shown below:
Resulting response after tuning the PID
Figure 1(b) resulting response after tuning

Reaction-curve method

Reaction-curve method (open loop method) does not require driving the system to oscillation. Instead, the feedback loop is opened, and the controller is manually directed to output a small step function to the actuator as illustrated in figure 1(c).

block diagram of test set up for PID tuning
Figure 1 (c) block diagram of test set up for PID tuning

The system response as reported by the sensor  is used to calculate KP, KI and KD. You can notice that the actuator, the process itself and the sensor are operational in this test, so their individual characteristics are accounted for. Since the loop is open, this procedure will only work for systems that are inherently stable.

In the test setup in figure 1(c), the loop was opened by placing the controller into manual mode, and then a small step function was manually introduced. This signal caused the controlled variable to move a little, and the resulting position response was recorded. A typical response curve is illustrated in figure (d). Note that the vertical axis corresponds to the range of the process variable (in %)

Graph of response to step input
Figure 1(d) graph of response to step input

The system constants are calculated based on the response curve, as outlined below:

  • Draw a line tangent to the rising part of the curve as shown in figure 1(d). This line defines the lag time (L) and rise time (T) values. Lag time is the time delay between the controller output and the controlled variable response.
  • Calculate the slope of the curve:
Slope of a graph of response to step input

      Where,

       N = slope of the system-response curve

      ΔPV = change in the process variable as reported by the  sensor (in %).

      T = rise time, from response curve

  • Calculate PID constants as follows:

KD = 0.5L

Where, ΔCV = Percentage step change in the control variable (output of the controller)

N = slope as determined in step 2

L = lag time

Autotuning Controllers

Autotuning is the ability of the some digital controllers to monitor their own output and make minor changes in the gain constants (KP, KI, and KD) e.g. a temperature control system may decrease its proportional gain slightly if the overshoot is beyond a certain threshold and increase the gain if the response is too sluggish. In the same way as manual tuning, autotuning is an iterative process, however, since it is ongoing, the system can adapt to the changes in the process. Hence, controllers that use autotuning are known as adaptive controllers.

Please follow us & share:

Comments

One response to “How to Tune the PID Controller”

  1. […] How to Tune the PID Controller […]

Currently trending: