Design of PID Controller
Design of PID Controller
PID controller
Systems that feed the error forward to the plant (or actual system) are called proportional control
systems.
Systems that feed the integral of the error to the plant are called integral control systems.
Systems that feed the derivative of the error to the plant are called derivative control systems.
PID stands for ‘Proportional-plus-integral-plus-derivative’.
Combination of PD controller and PI controller.
Implemented using active components (for example, op-amps) as active networks.
PD controller: The sum of a differentiator and a pure gain, also called an ideal derivative
compensator. Its purpose is to improve the transient response of a system.
PI controller: The sum of an integrator and a pure gain, also called an ideal integral
compensator. Its purpose is to reduce the steady-state error to zero.
Hence, the purpose of PID controller is to improve both the transient response and the steady-
state response (zero steady-state error).
A PID controller is shown in Figure 1.
Figure 4: Root locus for uncompensated system (zoomed for finding 20% overshoot)
Searching for the 20% overshoot in Figure 4 (zoomed graph of Figure 3), we find the dominant poles at
–5.41 ± 10.6 j with a gain of 121, and the corresponding damping ratio = 0.456.
Now, the step response of the uncompensated system with the gain value of 121 is shown in Figure 5.
Figure 5: Step response of the uncompensated system with K = 121
From Figure 5, the peak time is observed as 0.3 seconds. (Theoretically, the peak time can be calculated
from the imaginary part of the dominant pole (that is, 10.6j). We know that the dominant poles are given
by the roots n jd , where d n 1 2 . Now, the peak time (Tp) is given by
Tp 0.2964 seconds).
d 10.6
Step 2: Next, a PD controller has to be designed to reduce the peak time to two-thirds of that of the
uncompensated system, that is, (2 / 3) × 0.3 seconds = 0.2 seconds (theoretical value = 0.1976 seconds).
The dominant poles for the desired peak time of 0.1976 seconds (theoretical value) can be obtained by
theoretical means. From the peak time relation, the imaginary part of the desired dominant pole, d is
obtained as d = 15.9.
0.1976
Now, for finding the real part of the desired dominant pole, a line has to be drawn to the left of the
imaginary axis in s-plane with respect to the origin at an angle, cos 1 cos 1 0.456 = 62.87° as
shown in Figure 6. From that, the real part of the desired dominant pole can be obtained as follows:
15.9 15.9
tan 62.87 n = 8.147
n tan 62.87
Figure 6: Right angled triangle formed in s-plane to find the dominant pole
Therefore, the dominant poles for the desired transient response specification of peak time = 0.1976
seconds are –8.147±15.9j. Now, we start the design of PD controller by finding the location of the
controller’s zero using the root locus property as shown in Figure 7 by connecting the dominant pole to
all the uncompensated poles and zeros.
Figure 7: Angles formed between the dominant pole and all other poles and zeros
The angles formed between the dominant pole and all other poles and zeros can be obtained as follows:
15.9
1 = 180 tan 1 = 107.94°
8.147 3
15.9
2 180 tan 1 = 97.69°
8.147 6
15.9
3 180 tan 1 = 90.53°
8.147 8
15.9
tan 4 8.5807 4 = 83.35°
10 8.147
Now, the angle contribution required from the PD controller zero (zc) in order to make the root locus to
pass through the desired dominant pole can be obtained as
Angle contribution = 180° – (sum of angles from the dominant pole to all other poles)
+ (sum of angles from the dominant pole to all other zeros)
= 180 1 2 4 3 = 180 – (107.94+97.69+83.35) + 90.53 = –18.45°
Here, the angle contribution is for zero location, so, the angle can be taken as positive.
Now, the loop gain K for the PD-compensated system can be determined by either manual calculations
or from root locus graph of the PD-compensated system. The complete root locus of the PD-
compensated system GPD (s) G(s) is shown in Figure 9.
From the root locus graph obtained from MATLAB simulation (zoomed in Figure 10), it is evident that
the dominant pole for the PD-compensated system with 20% overshoot shows –8.17±15.9j with a loop
gain of 5.39.
Now, we can check the loop gain value through manual calculations.
Figure 9: Root locus for PD-compensated system
= 5.3735–0.0001 j
2 2
Therefore, K 5.3735 0.0001 = 5.3735 (remember, K = 5.39 from simulation)
Steps 3 and 4: Now, we have to check the PD-compensator design with loop gain of 5.39 in MATLAB
simulation. The step response of the PD-compensated system is shown in Figure 11.
In Figure 11, the peak time is observed as 0.174 seconds (desired value = 0.1976 seconds) with the loop
gain value of 5.39. Thus, it is evident from the simulation that the PD-compensated system satisfies the
peak time requirement better than the desired one and operating with overshoot of nearly 22%
(somewhat acceptable) and the result is satisfactory. The comparison of step responses of
uncompensated system and PD-compensated system is shown in Figure 12.
Figure 13: Comparison of step response for uncompensated system and PD-compensated system
From Figure 13, it is evident that the uncompensated system has the steady-state error of
1 – 0.843 = 0.157 and the PD-compensated system has the steady-state error of 1 – 0.93 = 0.07, thus the
PD-compensated system shown improvement in steady-state error also.
Step 5: Even though the PD-compensated system reduces the steady-state error over the uncompensated
system, the given requirement is zero steady-state error. So, we need to design the ideal integral
compensator (or PI controller) to reduce the steady-state error to zero for a step input. Any ideal integral
compensator zero will work, as long as the zero is placed close to the origin. Here, I am choosing the
ideal integral compensator zero to be 0.1, and thus the transfer function of the PI controller is given by
s 0.1
GPI s
s
Now, the loop gain K for the PID-compensated system (combination of PD and PI) can be determined
by either manual calculations or from root locus graph of the PID-compensated system. The complete
root locus of the PID-compensated system is shown in Figure 14. From the root locus graph obtained
from MATLAB simulation (zoomed in Figure 15), it is evident that the dominant pole for the PID-
compensated system with 20% overshoot shows –8.1±15.8j with a loop gain of 5.32.
Figure 14: Root locus for PID-compensated system
Manual calculations for finding the loop gain K for the PID-compensated system:
The characteristic equation is simply 1+G(s) = 0. The transfer function G(s) of the PID-
compensated system (including the loop gain K) is given by
K s 0.1 s 8 s 55.8
G s (Equation (2))
s s 3 s 6 s 10
K s 0.1 s 8 s 55.8 K s 0.1 s 8 s 55.8
From characteristic equation, 1 0 1
s s 3 s 6 s 10 s s 3 s 6 s 10
= 5.3871+0.0268 j
2 2
Therefore, K 5.3871 0.0268 = 5.3872 (remember, K = 5.32 from simulation)
Step 6: Now we determine the gains K1, K2, and K3 in Figure 1. We have obtained the transfer function
of the PID-compensated system and is given in Equation (2). From that equation, the transfer function
of the PID controller can be obtained as
K s 55.8 s 0.1
GPID s , K = 5.32
s
5.32 s 2 55.9 s 5.58
= (Equation (3))
s
Matching equations (1) and (3), K1 = 297.4, K2 = 29.7, K3 = 5.32
Steps 7 and 8: Now, we have to check the performance of PID controller design with loop gain of 5.32
in MATLAB simulation. The step response of the PID-compensated system is shown in Figure 16.
Figure 17: Comparison of step response for uncompensated system and PID-compensated system
Figure 18: Comparison of peak time for uncompensated system and PID-compensated system
Figure 19: Comparison of steady-state error for uncompensated system and PID-compensated system
Reference textbook
Norman S. Nise, ‘Control Systems Engineering’, Sixth Edition, John Wiley and Sons, 2011.
About the concepts explained here, feel free to ask your queries to: senthil.avionics@gmail.com