PID and PI-PI Controller Tuning Methods
PID and PI-PI Controller Tuning Methods
Department of Computer and Control Engineering, Rzeszów University of Technology, W. Pola 2, 35-959 Rzeszów, Poland
Abstract. Tuning rules for PID and PI-PI servo controllers are developed using a pole placement approach with a multiple pole, i.e. a triple
one in the case of PID and a quadruple for PI-PI. The controllers involve complex roots in the numerators of the transfer functions. This is not
possible in the classical P-PI structure which admits real roots only. The settling time of the servos determined by the multiple time constant
is the only design parameter. Nomograms to read out discrete controller settings in terms of the time constant and control cycle are given. As
compared to the classical structures, the upper limit on the control cycle is now twice longer in the case of PID, and four times in the case of
PI-PI. This implies that the settling times can be shortened by the same ratios. Responses of a PLC-controlled servo confirm the validity of the
design.
Key words: servomechanism; double integrator; pole placement; PID controller; discrete-time control.
Bull. Pol. Acad. Sci. Tech. Sci., vol. 70, no. 1, p. e139957, 2022 1
© 2022 The Author(s). This is an open access article under the CC BY license ([Link]
A. Bożek and L. Trybus
2.1. Root-locus
Consider the control system of Fig. 1 involving a double inte-
grator, PID controller, and reference filter F. The double integra-
tor ko /s2 represents in practice a connection of servo-drive, ser-
0
vomotor and mechanical load resulting in the effective gain ko .
yr ko y
F PID
− s2
b)
Let the controller be described by
kI
GPID (s) = kP + + kD s (1)
s
with the gains kP , kI , kD of corresponding PID actions. As
0
demonstrated later in Section 4, such a controller may be con-
verted into classical servo structure composed of PI velocity
loop and P position loop, provided that its transfer function has
real zeros. This in turn requires the ratio TI /TD of the integral
time TI = kP /kI to the derivative time TD = kD /kP to be no
smaller than 4. If TI /TD = 4, as in the familiar Ziegler-Nichols 0
tuning rules [13], the PID transfer function can be written as
Fig. 2. Root-locus plot for the PID control system with: a) double real
(s + α)2 zero, b) complex zeros (× – open-loop pole, ◦ – open-loop zero,
GPID (s) = kR (2a) – closed-loop pole)
s
2 Bull. Pol. Acad. Sci. Tech. Sci., vol. 70, no. 1, p. e139957, 2022
Tuning servo controllers by multiple pole placement
Let the system dynamic be specified by a required settling If natural frequency ωn is the preferred specification param-
time ts . Since ts is determined by the dominant pole s1 close to eter to calculate the settings, the corresponding settling time
−α (which speeds up the transient), so taking ts ∼= 3/|s1 | gives follows from ts ∼ = 4/ωn [5] (for unity damping ratio).
the modulus of the controller zero as The experimental step response of the designed PID system
4 strictly corresponding to P-PI is shown in Section 6, as well
α= . (6) as the response when the derivative action involves additional
ts
filtering.
Using it in (5) and (2b) yields the following PID settings
2.4. Frequency characteristics
216 432 27 To compare the robustness of the pole placement and root-
kP = 2 , kI = 3 , kD = . (7)
ts ko ts ko ts ko locus designs one can check sensitivity with respect to the servo
gain ko which may be inaccurately determined. Sensitivities
2.2. Pole placement
|dGclosed /dko | of the closed-loop transfer function for ko = 1,
To get a triple closed-loop time constant λ as in IMC (Ap-
λ = 1 (ts = 8) in relevant frequency range are shown in Fig. 3.
pendix) we remove the condition TI /TD ≥ 4 required by the
As seen, the pole placement design is slightly more sensitive to
transformation of PID to P-PI. The following pole placement
ko than the root-locus.
equation for the denominator of the closed-loop transfer func-
tion holds 1
pole placement
s3 + ko kD s2 + kP s + kI = (s + p)3 , p = 1/λ .
(8) 0.8
root-locus
Bull. Pol. Acad. Sci. Tech. Sci., vol. 70, no. 1, p. e139957, 2022 3
A. Bożek and L. Trybus
with
∆2
Ki = ko ki (14b)
2
for i = 1, 2, 3. Therefore the denominator of the closed-loop
transfer function becomes 0
4 Bull. Pol. Acad. Sci. Tech. Sci., vol. 70, no. 1, p. e139957, 2022
Tuning servo controllers by multiple pole placement
50 a)
45 yr ko y
PIP PIV
− − s2
40 v
35
s
30
25 b)
20
yr ko y
F R
15 − s2
10
5 Fig. 7. a) PI-PI servo control system, b) single-loop equivalent
0
0.7 0.75 0.8 0.85 0.9 0.95
single one of Fig. 7b, where [10]
r
Fig. 5. Nomograms for the discrete PID controller settings (kPV s + kIV )(s2 + kP s + kI )
R(s) = , (25a)
s2
calculated for the discretization step ∆ = 0.015 s as in labora- kP s + kI
F(s) = 2 . (25b)
tory experiments in Section 6. It implies the approximate lower s + kP s + kI
bounds on settling time equal to 26∆ ∼ = 0.4 s and 45∆ ∼= 0.7 s Before going into design issues note that by setting kI to 0
for the PID and P-PI, respectively. One can try to ignore the we get the classical P-PI structure represented by
condition ∆ ≤ ts /45 for P-PI to obtain a system as fast as for
PID, but then the step response becomes oscillatory (Fig. 6). (kPV s + kIV )(s + kP )
R(s) kI =0
= ,
s
(26)
kP
1 F(s) k =0 = .
I s + kP
0.8 So R(s) for kI = 0 is just the PID controller of Fig. 1. As seen
from above, such a controller may have real zeros only. If kP =
0.6 kIV /kPV , it has a double zero equal to −α in (2a).
y
Bull. Pol. Acad. Sci. Tech. Sci., vol. 70, no. 1, p. e139957, 2022 5
A. Bożek and L. Trybus
One may comment that the solution can also be obtained from
the equations f (s04 ) = f 0 (s04 ) = f 00 (s04 ) = f 000 (s04 ) = 0 (see (17)
in Section 3). Roots of the polynomial s0 2 + 2s0 + 2, i.e. normal- 0
ized zeros of the controller, are −1 ± j1. b)
2
4.3. Tunings
As before, assume that a settling time ts and gain ko are given. 1
For the quadruple pole s4 = s04 α = −2α one may write ts ∼ =
10/|s4 |, hence 0
5
α∼ = . (32) -1
ts
-2
Values of the remaining parameters K, β , γ follow from (28b)
and those of the PI controllers from (27b). Finally, one obtains -3 -2 -1 0
the settings for the pair of controllers
Fig. 8. Root-locus plot for PI-PI structure with: a) three real zeros
10 50 (β double), b) two complex zeros and a real one
kP = , kI = 2 ,
ts ts
(33)
40 200 5. DISCRETE PI-PI CONTROL
kPV = , kIV = 2 .
ts ko ts ko We follow the steps of Section 3 with some extensions.
Step and ramp responses for such settings are presented in Sec- 5.1. Basic derivation
tion 6. Discrete implementation of the PI-PI system from Fig. 7a con-
sists of the double integrator (13a) and the controllers
4.4. Idea of the previous design [10]
Although not necessary, the term s2 + kP s + kI in (25a) has been z
GPI p (z) = kP + kI ∆ ,
assumed to have a double root −β , analogously as in the P-PI z−1
(36)
case. So the controller transfer function becomes z
GPIv (z) = kPV + kIV ∆ ,
z−1
(s + α)(s + β )2
R(s) = K . (34) whith the operator s replaced by (z − 1)/(∆z). As before, the
s2
two loops are equivalent to the single one of Fig. 7b with [10]
The corresponding root-locus plot shown in Fig. 8a has two
breakpoints sb1 and sb2 . Critically damped responses are ob- (z − α)(z − β )(z − γ)
R(z) = kR , (37a)
tained when the two breakpoints are reached simultaneously. ∆z(z − 1)2
This condition yields the following solution
∆z [(kP + kI ∆)z − kP ]
F(z) = , (37b)
16α (kI ∆2 + kP ∆ + 1)(z − α)(z − β )
K= , β = 2α . (35)
ko
where
Settling time is determined by the pair of dominant poles in the
breakpoint kR = (kPV + kIV ∆)(kI ∆2 + kP ∆ + 1),
√ 1
αβ = ,
sb1 = −2(2 − 2)α ∼
= −1.17α. 2
kI ∆ + kP ∆ + 1
kP ∆ + 2 (38)
α +β = ,
In the pole placement case, instead of the two breakpoints, kI ∆2 + kP ∆ + 1
we have one quadruple breakpoint s04 as in Fig. 8b, where the kPV
internal and external branches meet. γ= .
kPV + kIV ∆
6 Bull. Pol. Acad. Sci. Tech. Sci., vol. 70, no. 1, p. e139957, 2022
Tuning servo controllers by multiple pole placement
In [10] it was assumed that α, β , γ are real (R). However, since 5.2. Intervals for r and ∆
the formulas above express the product and sum of the zeros α, The general shape of root-locus plot (not shown) is very similar
β , they remain correct also for complex (C) case provided that to the one of Fig. 4, but with the right part replaced by discrete
version of Fig. 8b. The fifth single pole z1 is obtained by substi-
β = α ∈ C, γ ∈ R. (39) tuting (42) into (41) and dividing the resulting f (z) by (z − r)4 .
This yields
We want the closed-loop system with a quadruple pole z4 = r.
Let us rewrite R(z) in the form similar to PID in (13b), (1 − r)(r + 3)(r2 + 2r + 5) K4
i.e. with the numerator linear with respect to the coefficients z1 = = 4. (45)
(r + 1)4 r
k1 z3 − k2 z2 + k3 z − k4
R(z) = . (40) As before,
√ the equation z1 (r) = r gives the unique real solution
z(z − 1)2 r5 = 5 16 − 1 ∼= 0.741 that represents the quintuple pole of the
closed-loop system. Moreover, properties of the expression (45)
For such R(z) the denominator of the closed-loop transfer func- imply that if r ∈ [r5 , 1) then z1 ∈ (0, r5 ], hence the system is
tion becomes stable with the dominant pole r.
This time the condition r ≥ r5 yields ∆ ≤ 0.3λ , so for ts ∼ =
f (z) = z(z − 1)4 + (z + 1)(K1 z3 − K2 z2 + K3 z − K4 ) (41)
12λ (quintuple λ ) we get
with Ki , i = 1, . . . , 4 defined in (14b). Applying the condi- ts
tion (17) with the multiplicity k = 4 to f (z) above, we get a ∆≤ . (46)
40
system of four equations linear with respect to K1 , . . . , K4 . Its
solution has the form [14] This is considerably better than ts /130 in [10] where the double
4 3 2 real zero prevented getting the quadruple pole (see Fig. 8a).
K1 = C(4r + 15r + 19r + 5r − 11),
K2 = C(6r5 + 30r4 + 55r3 + 35r2 − 25r − 5), 5.3. Tunings and responses
(42a)
K3 = C(4r6 + 20r5 + 44r4 + 45r3 − 11r2 − 5r − 1), Having kR , a, b, γ calculated from (43) and (44), the original pa-
rameters of the controllers are obtained by solving (38). Hence
K4 = Cr4 (r + 3)(r2 + 2r + 5),
b − 2a 1+a−b
where kP = , kI = ,
1−r a∆ a∆2
C= . (42b) (47)
(r + 1)4 a(1 − γ)kr
kPV = aγkr , kIV = .
∆
Comparing (37a) with (40) and taking into account (14b), we
get As in Section 3 we can combine the formulas (42), (43), (44),
2K1 (47) to get the following compact expressions for the settings
kR = (43)
ko ∆
ρP ρI
kP = , kI = ,
and α, β , γ as the roots of the equation K1 z3 −K2 z2 +K3 z−K4
= 300∆ 2000∆2
0. Assuming K1 6= 0, it is a cubic equation in a general form (48)
ρPV ρIV
whose real root γ, as well as the product a = αβ and the sum kPV = , kIV = .
110ko ∆ 930ko ∆2
b = α + β of the two other roots can be consecutively obtained
from the following expressions to satisfy the conditions (39) The coefficients ρP , ρI , ρPV , ρIV are read out from the nomo-
grams in Fig. 9 for a given r. The nomograms confirm that the
27K1 2 K4 − 9K1 K2 K3 + 2K2 3 PI-PI structure is realizable for the quadruple pole placement,
δ=
54K1 3 since all the settings are positive for r ∈ [r5 , 1).
Simulated step responses for the PI-PI controllers with the
p
27K1 2 K4 2 +(4K2 3 −18K1 K2 K3 )K4 +4K1 K3 3 −K2 2 K3 2
+ , settings developed in this section and those proposed in [10]
33/2 2K1 2
are compared in Fig. 10. The discretization step ∆ = 0.015 s
√ is used as in Section 3. Approximate lower bounds on settling
3K1 K3 − K2 2 K2
time are 40∆ ∼= 0.6 s and 130∆ ∼
3
γ= δ− √3
+ ∈ R, = 2.0 s for the new PI-PI settings
9 δ K1 2 3K1
(44) and the previous ones from [10], respectively. Again, one can
K4 K2 − γK1 try to ignore the condition ∆ ≤ ts /130 attached to the formulas
a = αβ = ∈ R, b = α +β = ∈ R,
γK1 K1 from [10] to have the settling time 0.6 s, but this leads to an
unstable system. The stability limit is reached for the settling
where δ is an auxiliary variable calculated first to get γ. time 0.75 s, as shown in Fig. 10.
Bull. Pol. Acad. Sci. Tech. Sci., vol. 70, no. 1, p. e139957, 2022 7
A. Bożek and L. Trybus
50 6. EXPERIMENTAL RESULTS
45 A laboratory servo system shown in Fig. 11 has been set-up
40
to verify the designs. It consists of a ball screw linear actua-
tor, Estun AC servomotor and servo drive [15] with EtherCAT
35
bus, Beckhoff C6920 industrial PC [16] for PLC code execu-
30 tion, and standard PC with TwinCAT 3 engineering software
25 for programming. The continuous and discrete controllers have
20
been implemented in ST (Structured Text) language as function
blocks of the IEC 61131-3 standard [17]. All calculations de-
15
scribed by the formulas (11), (18), (22) for PID, and (33), (42),
10 (43), (44), (47) for PI-PI have been embedded in a PLC pro-
5 gram to compute target settings for given data. Although some
0
of the formulas look complicated, they can be expressed by ele-
0.75 0.8 0.85 0.9 0.95 mentary ST instructions, including EXPT function for the cube
r root in (44).
Fig. 9. Nomograms for the discrete PI-PI control structure settings The servo has been controlled using a combined reference
trajectory composed of step and ramp parts shown in Fig. 12.
Disturbance has been simulated by a signal added to controller
1 output.
The discrete control algorithms have been running with the
0.8 cycle ∆ = 15 ms. Their settings have been calculated for the
multiple poles corresponding to the shortest settling time, i.e.
0.6 for the design parameter r = r4 = 0.682 in the case of PID (Sec-
y
industrial PC
servo drive
TwinCAT 3 software
servomotor
linear actuator
8 Bull. Pol. Acad. Sci. Tech. Sci., vol. 70, no. 1, p. e139957, 2022
Tuning servo controllers by multiple pole placement
Fig. 12. Experimental results recorded by TwinCAT 3 software: green – reference position, blue – actual position, red – control output
(1 − z f )z a)
F1,PID (z) = , (49)
z−zf
0.1
where z f denotes the real part of the zeros, i.e. z f = 0.5K2 /K1 .
The full 2nd order filter 0.08
(K1 − K2 + K3 )z2
y [m]
0.06 yr
F2,PID (z) = , (50)
K1 z2 − K2 z + K3 PID+F1
0.04 PID+F2
slightly more complicated, cancels out both zeros. PI-PI+F1
The discrete PI-PI control structure has two real zeros 0.02 PI-PI+F2
P-PI [10]
kP kPV 0 PI-PI+F [10]
zfa = , zfb = , (51)
kP + kI ∆ kPV + kIV ∆ 0 0.5 1 1.5 2
t [s]
where z f a emerges in the connection of R(z) from (37a) with
F(z) from (37b) according to the diagram in Fig. 7b, and z f b b)
follows from (37a) and (38). One can eliminate the zero z f a by 0.1
the reference filter
0.08
(1 − z f a )z
F1,PI-PI (z) = (52)
z−zfa 0.06
y [m]
Bull. Pol. Acad. Sci. Tech. Sci., vol. 70, no. 1, p. e139957, 2022 9
A. Bożek and L. Trybus
Table 1 a)
Settling times of discrete control structures 0.08 y
r
PID
Multiple pole Double zero [10]
Controller PI-PI
0.06
MIN EX MIN EX PID+F1
PID+F2
PID / P-PI 26∆ 0.4 s 45∆ 0.7 s
y [m]
0.04 PI-PI+F1
PI-PI 40∆ 0.6 s 130∆ 2.0 s PI-PI+F2
0.02
(MIN) in terms of ∆ are given, along with the values obtained
in the experiments for ∆ = 15 ms (EX).
The continuous control has been emulated for the shortest 0
available cycle ∆min = 1 ms. The controllers are tuned for ts = -0.2 0 0.2 0.4 0.6 0.8
0.5 s, being actually the average of settling times obtained in the t [s]
discrete control (0.4 vs. 0.6 s). Experimental step responses are b)
presented in Fig. 13b. The responses of the structures without 0.08 y
r
reference filters exhibit overshoots, as in the case of discrete
PID
controllers. The control structure PID+F1 with the filter (12) PI-PI
0.06
completely eliminates the overshoot. For the PI-PI structure, PID+F1
the inertial filter PI-PI+F1
y [m]
0.04 PI-PI+F2
kI 1
F1,PI-PI (s) = = t (54)
kP s + kI s
s+1
5 0.02
10 Bull. Pol. Acad. Sci. Tech. Sci., vol. 70, no. 1, p. e139957, 2022
Tuning servo controllers by multiple pole placement
ever, the control signal u for the PIDR is a decaying oscillation APPENDIX
due to the increased order of the system and unchanged set- Following notation from [11], let G denote a plant transfer func-
tings. Since high-resolution encoder is used in the servo, the tion, G
e its approximation such that Ge=G e+ Ge− where G e+ in-
oscillations may be easily reduced by increasing D. Neverthe- cludes delays and right half-plane zeros, and has unity steady-
less, extension of the pole placement method on arbitrary D in state gain. To analyze the robustness of the approximation, an
the real PID remains a subject of future work. IMC controller R∗ is defined
1
0.1 R∗ = f, (56)
G−
e
0.1
account integral action of the controller, assume the closed-loop
0.05 transfer function as
0 as2 + bs + 1
f= , (58)
-0.05 (λ s + 1)3
-0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
t [s] so with a triple time constant λ . Using (58) in (56), and
Fig. 16. Step responses of the servos with ideal and real continuous then (56) in (57) gives
PID controllers
1 s(as2 + bs + 1)
R= . (59)
ko λ 3 s2 + (3λ 2 − a)s + (3λ − b)
7. CONCLUSIONS
By taking a = 3λ 2 and b = 3λ the controller R becomes of PID
New tuning rules for PID and PI-PI servo controllers have been
type, namely
derived using multiple pole placement approach, as an alter-
native to the root-locus design [10]. The root-locus assumes 3 1 1 3
real zeros of the PID controller, so it can be converted into the R= + + s. (60)
λ 2 ko λ 3 ko s λ ko
classical P-PI two-loop structure. This is not the case for the
pole placement PID which has complex zeros, so it must be
implemented in a standard single loop. The new approach ad- ACKNOWLEDGEMENTS
mits twice longer control cycle for the discrete PID and four Discussions with Dr T. Żabiński and Prof. R. Leniowski are
times for PI-PI. This in turn implies that twice or four times gratefully acknowledged.
shorter settling times can be obtained for the same control cy-
cle. Shorter settling time may be important in the case of high-
performance servos, whereas longer control cycle suits heavily REFERENCES
loaded PLCs executing demanding tasks in parallel. Actually, [1] B. Siciliano and O. Khatib, Eds., Springer Handbook of
the pole placement approach has been motivated by an earlier Robotics. Berlin Heidelberg: Springer, 2008.
IMC solution for a double integrator. [2] G. Ellis, Ed., Control System Design Guide, 4th ed. Butterworth-
Nomograms for tuning the discrete PID and PI-PI controllers Heinemann, 2012.
given a settling time and control cycle are provided. They may [3] G.W. Younkin, Industrial Servo Control Systems, 2nd ed. New
be useful to obtain the settings quickly in practical applications. York: Marcel Dekker, 2002.
[4] S.-M. Yang and K.-W. Lin, “Automatic Control Loop Tuning for
However, the design formulas can also be directly implemented
Permanent-Magnet AC Servo Motor Drives,” IEEE Trans. Ind.
using an IEC 61131-3 engineering software. Electron., vol. 63, no. 3, pp. 1499–1506, 2016.
Lab experiments have confirmed the feasibility of the pole [5] G.F. Franklin, J.D. Powell, and A.F. Emami-Naeini, Feedback
placement design. In particular, the smooth shape and settling Control of Dynamic Systems, 7th ed. Reading: Addison-Wesley,
time of the step responses have been verified both for continu- 2019.
ous and discrete cases, as well as the ability of ramp tracking [6] L. Sciavicco and B. Siciliano, Modelling and Control of Robot
and disturbance suppression. Manipulators. London: Springer, 2000.
Bull. Pol. Acad. Sci. Tech. Sci., vol. 70, no. 1, p. e139957, 2022 11
A. Bożek and L. Trybus
[7] T. Tarczewski, M. Skiwski, L.J. Niewiara, and L.M. Grzesiak, [12] C. Grimholt and S. Skogestad, “Optimal PI and PID control of
“High-performance PMSM servo-drive with constrained state first-order plus delay processes and evaluation of the original and
feedback position controller,” Bull. Pol. Acad. Sci. Tech. Sci., improved SIMC rules,” J. Process Control, vol. 70, pp. 36–46,
vol. 66, pp. 49–58, 2018. 2018.
[8] V. Rao and D. Bernstein, “Naive control of the double integra- [13] K.J. Åström and T. Hägglund, Advanced PID Control, Research
tor,” IEEE Control Syst. Mag., vol. 21, pp. 86–97, 2001. Triangle Park, 2005.
[9] P.B. Schmidt and R.D. Lorenz, “Design principles and imple- [14] “Maxima CAS homepage.” [Online]. Available: [Link]
mentation of acceleration feedback to improve performance of [Link]/.
DC drives,” IEEE Trans. Ind. Appl., vol. 28, no. 3, pp. 594–599, [15] “ESTUN Industrial Technology Europe.” [Online]. Available:
1992. [Link]
[10] T. Żabiński and L. Trybus, “Tuning P-PI and PI-PI controllers [16] “BECKHOFF New Automation Technology.” [Online]. Avail-
for electrical servos,” Bull. Pol. Acad. Sci. Tech. Sci., vol. 58, pp. able: [Link]
51–58, 2010. [17] EN 61131-3, Programmable controllers – Part 3: Programming
[11] D.E. Seborg, T.F. Edgar, D.A. Mellichamp, and F.J. Doyle, Pro- languages (IEC 61131-3:2013), International Standard, CEN-
cess Dynamics and Control, 4th ed. New York: Wiley, 2016. ELEC Std., 2013.
12 Bull. Pol. Acad. Sci. Tech. Sci., vol. 70, no. 1, p. e139957, 2022